public Node(Quadtree <T> quadtree, Node parent, float x, float y, float width, float height, int depth) { this.quadtree = quadtree; bounding = new BoundingBox(new Vector3(x, y, float.MaxValue), new Vector3(x + width, y + height, float.MinValue)); this.depth = depth; this.parent = parent; if (depth > 0) { for (int i = 0; i < 4; i++) { int r = i % 2; int t = i / 2; children[i] = new Node(quadtree, this, x + r * width / 2f, y + t * height / 2f, width / 2f, height / 2f, depth - 1); } } }
public Culler(Quadtree <T> quadtree) { this.quadtree = quadtree; node = quadtree.root; }