Refits the tree in floats/words (one buffer, two views) in place from
primitiveBoxes (PRIMITIVE_BOX_FLOATS per primitive), keeping its
shape: each leaf slot gets the union of its primitives' boxes, each inner
slot the union of its node's two slots. Empty primitive boxes (min > max)
stay empty, and an empty slot is stored as a point at the largest float.
order is refitOrderOf(parents, nodeCount), for a caller that
refits the same tree again and again (it depends on the shape only);
without it, it is worked out here.
The nodes must be 64-byte f32 nodes. Quantized nodes (32 bytes, the
scene default) are refit through an f32 copy: dequantizeNodes, refit,
then quantizeNodeWords back. A node whose child counts or indices can't be
an f32 node's (as quantized words read with the 64-byte stride) throws a
RangeError before anything is written.
Refits the tree in
floats/words(one buffer, two views) in place fromprimitiveBoxes(PRIMITIVE_BOX_FLOATS per primitive), keeping its shape: each leaf slot gets the union of its primitives' boxes, each inner slot the union of its node's two slots. Empty primitive boxes (min > max) stay empty, and an empty slot is stored as a point at the largest float.orderis refitOrderOf(parents, nodeCount), for a caller that refits the same tree again and again (it depends on the shape only); without it, it is worked out here.The nodes must be 64-byte
f32nodes. Quantized nodes (32 bytes, the scene default) are refit through anf32copy:dequantizeNodes, refit, thenquantizeNodeWordsback. A node whose child counts or indices can't be anf32node's (as quantized words read with the 64-byte stride) throws a RangeError before anything is written.