Description

Provides functions for reorganizing the data structure of scene graphs.
Example:

MinSG.TreeBuilder.rebuildAsOcTree(scene, {
	MinSG.TreeBuilder.MAX_TREE_DEPTH: 10,
	MinSG.TreeBuilder.MAX_CHILD_COUNT: 8,
	MinSG.TreeBuilder.LOOSE_FACTOR: 2,
	MinSG.TreeBuilder.PREFERE_CUBES: true,
	MinSG.TreeBuilder.USE_GEOMETRY_BB: false,
	MinSG.TreeBuilder.EXACT_CUBES: true,
});

Attributes

   
MinSG.TreeBuilder.EXACT_CUBES Boolean. If set, the bounding box is expanded to a cube/square before splitting (quadtree, octree). Don’t forget to disable `use geometry bounding boxes´.
MinSG.TreeBuilder.LOOSE_FACTOR Number. The scale factor for boxes when inserting nodes. If you don’t want a loose tree, set this value to one.
MinSG.TreeBuilder.MAX_CHILD_COUNT Number. The maximum number of nodes stored in leaves. Leaves with more nodes will be split up as long as the maximum depth is not reached.
MinSG.TreeBuilder.MAX_TREE_DEPTH Number. The maximum depth of the created tree. Leaves in depth >= maximum will not be split.
MinSG.TreeBuilder.PREFERE_CUBES Boolean. If set, bounding boxes will not always split in all dimensions (quadtree, octree, kd-tree).
If the ratio between maximum and minimum extent of the bounding box gets greater than squareroot of two, only the large dimensions are split.
MinSG.TreeBuilder.USE_GEOMETRY_BB Boolean. If set, bounding boxes of the geometry instead of those of the previous step are used for splitting (quadtree, octree, binary tree, kd-tree).

Functions

   
MinSG.TreeBuilder.rebuildAsBinaryTree(p0, p1) [ESF] void MinSG.rebuildAsBinaryTree(MinSG.GroupNode node, Map options)
Builds a binary tree by splitting allways the largest dimension.
MinSG.TreeBuilder.rebuildAsKDTree(p0, p1) [ESF] void MinSG.rebuildAsKDTree(MinSG.GroupNode node, Map options)
Builds several variants of kd-trees.
MinSG.TreeBuilder.rebuildAsList(p0, p1) [ESF] void MinSG.rebuildAsList(MinSG.GroupNode node, Map options)
Builds a simple list.
MinSG.TreeBuilder.rebuildAsOcTree(p0, p1) [ESF] void MinSG.rebuildAsOcTree(MinSG.GroupNode node, Map options)
Builds several variants of octrees.
MinSG.TreeBuilder.rebuildAsQuadTree(p0, p1) [ESF] void MinSG.rebuildAsQuadTree(MinSG.GroupNode node, Map options)
Builds several variants of quadtrees.