public override Application setup(OcTree 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;
        }
 public override Application setup(OcTree 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.maximumDetail, (uint)exactMin.x, (uint)exactMin.y, (uint)exactMin.z);
     app.max = new Index(target.maximumDetail, (uint)exactMax.x, (uint)exactMax.y, (uint)exactMax.z);
     app.position = center;
     app.radius = radius;
     return app;
 }