Function: raycast()
raycast(
bodies
,start
,end
,sort
):RaycastCollision
[]
Defined in: physics/raycast.ts:18
Raycast function that returns an array of RaycastCollision objects that represent the intersections between a ray and the bodies in the world.
Parameters
bodies
Body
[]
The array of Matter.Body objects to check for intersections
start
The starting point of the ray
end
The ending point of the ray
sort
boolean
= true
Whether to sort the results by distance from the start point
Returns
An array of RaycastCollision objects