The viewer is using three-mesh-bvh as the backbone for it’s BVH implementation.
raycast
but stops at first intersection found. Queries the top-level BVH first, then if it finds intersections, it goes down to the bottom-level BVHs and raycasts against them.
Parameters
refit
is called automatically whenever any of the comprising BatchObjects update their transformation.