The deepest box's depth, as traverse reports it (the root's children at 1).
StaticbuildBuilds a tree over the input's entries (see the file comment); keeps input as its source.
The point nearest point (geometry space): { point, distance, index }, point a Vector3.
Whether the geometry is as the tree was built from it (or last refitted to).
StaticdeserializeReads bytes from serialize, checked.
Bytes this object holds: nodes, records and bounds. Not the source.
Box around every primitive, current after refit, as CpuMeshBvh.getBoundingBox.
Optionaltarget: TThe point at a tree position, as the tree stores it.
Optionaltarget: TEvery primitive within threshold of the ray, sorted by distance (then
entry): three's Points.raycast / Line.raycast in the tree's space.
The direction is normalized first unless it is unit length (three's rays are).
The closest primitive within threshold of the ray (ties: the lower entry), or null: three-mesh-bvh's firstHitOnly.
three's Points.raycast for object (whose geometry this tree is), over the tree: see the file comment.
Refits to the geometry's current positions (three-mesh-bvh's refit()); with input, to those arrays.
Optionalinput: BvhPointsInputThe entry of the primitive at a tree position (as traverse reports them).
The tree as bytes: a 64-byte header ("BVHP", format 1, kind, mode,
entry range, counts, bounds), the nodes, the records. CpuPointsBvh.deserialize
and CpuSegmentsBvh.deserialize read it back, checked.
three-mesh-bvh's PointsBVH.shapecast, with Box3 boxes and Vector3 points (scratch objects).
Walks the tree with CpuMeshBvh.traverse's contract (three-mesh-bvh's
shapecast): depth first, the root's box never asked about, each child
scored once by boundsTraverseOrder and the lower score first, a falsy
intersectsBounds skipping the box, a contained box reported as one
range, a truthy intersectsRange stopping the walk. Ranges are tree
positions: map them with resolvePrimitiveIndex. Returns true when stopped.
three-mesh-bvh's node walk, as CpuMeshBvh.traverseNodes (for the
helper and the debug functions): every node depth first, the root at
depth 0 with the tree's bounds; a leaf gets its first tree position and
count, an inner node the axis its children's centres lie furthest apart on.
The box around the primitives at tree positions offset to
offset + count - 1: read from the source when the tree has one (so
edits since the last refit show, as validateBounds wants),
else from the records.
three-mesh-bvh's
PointsBVH: a tree over aPointsgeometry's entries (the core'sCpuPointsBvhwith three's types). Build it withgeometry.computeBoundsTree({ type: PointsBVH })ornew PointsBVH(geometry).