Class: MeshRaycast
Defined in: src/io/raycast/MeshRaycast.ts:54
World-space ray queries against one geometry under a transform. Shared by Raycaster and MeshColliderShape, so both report the same hit data.
Constructors
Constructor
new MeshRaycast():
MeshRaycast
Returns
MeshRaycast
Methods
intersect()
staticintersect(geometry,worldMatrix,ray,options,out):number
Defined in: src/io/raycast/MeshRaycast.ts:67
Intersect ray (world space) with geometry placed by worldMatrix and append the hits to out (closest only unless options.all). Hits are not sorted across calls; the ones added by one call are.
Parameters
geometry
worldMatrix
ray
options
out
Returns
number
number of hits appended
intersectRenderer()
staticintersectRenderer(renderer,ray,options,out):number
Defined in: src/io/raycast/MeshRaycast.ts:123
Intersect a renderer's mesh as it is drawn. Skinned and morph-target meshes are deformed on the CPU first (see MeshDeformer) unless options.deformation says otherwise; a deformed mesh is always queried through a (refit) BVH unless useBVH is 'never'. For skinned meshes localPoint is the hit expressed in the renderer's local space (the deformed surface, not the bind pose).
Parameters
renderer
ray
options
out
Returns
number
number of hits appended
transformNormal()
statictransformNormal(invMatrix,n,out):Vector3
Defined in: src/io/raycast/MeshRaycast.ts:203
Transform a local-space normal to world space with the inverse transpose of the local → world matrix (normals stay perpendicular under non-uniform scale), then normalize.
Parameters
invMatrix
inverse of the local → world matrix
n
local-space normal
out
result (may alias n)

