Esempio n. 1
0
		public override Application setup(Tree target) {

			LineApplication app = new LineApplication();
			app.tree = target;
			app.position = target.globalToVoxelPosition(globalPoints[0]);
			app.points = new Vector3[globalPoints.Length];
			for (int i = 0; i < globalPoints.Length; ++i)
				app.points[i] = target.globalToVoxelPosition(globalPoints[i]) -app.position;
            app.childApp = (LocalApplication) child.setup(target);
			// TODO: set min, max and updateMesh.

			return app;
		}
Esempio n. 2
0
		public override Application setup(Tree target) {
			float radius = worldRadius / target.voxelSize();
			Vector3 radiusCube = new Vector3(radius, radius, radius);
			Vector3 center = target.globalToVoxelPosition(worldPosition);
			Vector3 exactMin = center - radiusCube;
			Vector3 exactMax = center + radiusCube;
			SphereApp app = new SphereApp();
			app.tree = target;
			app.min = new Index(target.maxDetail, (uint)exactMin.x, (uint)exactMin.y, (uint)exactMin.z);
			app.max = new Index(target.maxDetail, (uint)exactMax.x, (uint)exactMax.y, (uint)exactMax.z);
			app.position = center;
			app.radius = radius;
			return app;
		}