public class BoundingBoxTree
extends java.lang.Object
Each node in the tree contains a bounding box for a a subset of points. Those points are represented by a subarray of indices of point (x,y,z) coordinates. Point coordinates are specified when constructing a tree.
The bounding box for the root node is that for the entire set of points, with indices 0 through n-1, where n is the total number of points in the tree. The tree recursively splits this bounding box in two so that each child represents roughly half of the points in its parent.
This recursive splitting continues while splits will create child nodes with numbers of points not less than a specified minimum. When the total number of points in the tree is less than the specified minimum, then the tree consists of only the root node.
A bounding box tree is much like a k-d tree for k=3 dimensions.
Modifier and Type | Class and Description |
---|---|
class |
BoundingBoxTree.Node
A node in the binary tree of bounding boxes.
|
Constructor and Description |
---|
BoundingBoxTree(int minSize,
float[] xyz)
Constructs a bounding box tree for points with specified coordinates.
|
BoundingBoxTree(int minSize,
float[] x,
float[] y,
float[] z)
Constructs a bounding box tree for points with specified coordinates.
|
Modifier and Type | Method and Description |
---|---|
BoundingBoxTree.Node |
getRoot()
Gets the root node of this tree.
|
public BoundingBoxTree(int minSize, float[] xyz)
minSize
- the minimum number of points in a child node.xyz
- array of packed (x,y,z) coordinates.public BoundingBoxTree(int minSize, float[] x, float[] y, float[] z)
minSize
- the minimum number of points in a child node.x
- array of x coordinates.y
- array of y coordinates.z
- array of z coordinates.public BoundingBoxTree.Node getRoot()