Triangle-precise raycast against the indexed scene.
Uses the SceneCollisionIndex BVH to narrow the candidate set to
the objects whose world AABB the ray hits, then runs a Möller-Trumbore
triangle intersection on each candidate's mesh geometry. Returns the
nearest hit, or null if the ray misses every mesh.
Triangles are tested in mesh-local space (the ray is transformed once
per mesh; vertices are dequantised on the fly). The hit point is
mapped back to world space via the mesh's world matrix, so non-uniform
scales and shears stay correct.
Early-exits as soon as the next AABB-tEnter exceeds the best world-space
tHit found so far — distant candidates can't improve the result.
Triangle, solid, and surface primitives are tested; lines and points are
skipped (use SceneCollisionIndex.intersectRay for those, then
filter by primitive type).
Triangle-precise raycast against the indexed scene.
Uses the SceneCollisionIndex BVH to narrow the candidate set to the objects whose world AABB the ray hits, then runs a Möller-Trumbore triangle intersection on each candidate's mesh geometry. Returns the nearest hit, or
nullif the ray misses every mesh.Triangles are tested in mesh-local space (the ray is transformed once per mesh; vertices are dequantised on the fly). The hit point is mapped back to world space via the mesh's world matrix, so non-uniform scales and shears stay correct.
Early-exits as soon as the next AABB-
tEnterexceeds the best world-spacetHitfound so far — distant candidates can't improve the result.Triangle, solid, and surface primitives are tested; lines and points are skipped (use SceneCollisionIndex.intersectRay for those, then filter by primitive type).