Matter.Query
The Matter.Query
module contains methods for performing collision queries.
See the included usage examples.
Methods
Matter.Query.collides
(body, bodies)
Returns a list of collisions between body
and bodies
.
Returns
Collision[]
Collisions
Matter.Query.point
(bodies, point)
Returns all bodies whose vertices contain the given point, from the given set of bodies.
Returns
Body[]
The bodies matching the query
Matter.Query.ray
(bodies, startPoint, endPoint, [rayWidth])
Casts a ray segment against a set of bodies and returns all collisions, ray width is optional. Intersection points are not provided.
Returns
Collision[]
Collisions