pub fn query_closest(
nodes: &[BvhNode],
primitives: &[Aabb],
prim_indices: &[u32],
root: usize,
node_count: usize,
point: Point3,
stack: &mut [u32],
) -> Result<Option<(u32, f64)>, BvhError>Expand description
Query the BVH for the closest primitive to a point.
Uses distance pruning. Returns the primitive index and squared distance,
or None if the tree is empty.
stack needs MAX_BVH_DEPTH * 2 entries.