Matter.Detector module contains methods for efficiently detecting collisions between a list of bodies using a broadphase algorithm.
The comparison function used in the broadphase algorithm. Returns the signed delta of the bodies bounds on the x-axis.
The signed delta used for sorting
true if both supplied collision filters will allow a collision to occur.
body.collisionFilter for more information.
true if collision can occur
Clears the detector including its list of bodies.
Efficiently finds all collisions among all the bodies in
detector.bodies using a broadphase algorithm.
Note: The specific ordering of collisions returned is not guaranteed between releases and may change for performance reasons. If a specific ordering is required then apply a sort to the resulting array.
Creates a new collision detector.
A new collision detector
Properties / Options
The following properties are specified for objects created by
Matter.Detector.create and may be passed to it as
The array of
Matter.Body between which the detector finds collisions.
Note: The order of bodies in this array is not fixed and will be continually managed by the detector.