Broadphase Class
Base class for broadphase implementations.
Constructor
Broadphase
()
Methods
boundingRadiusCheck
-
bodyA
-
bodyB
Check whether the bounding radius of two bodies overlap.
Returns:
boundingRadiusCheck
-
bodyA
-
bodyB
Check whether the bounding radius of two bodies overlap.
Returns:
boundingRadiusCheck
-
bodyA
-
bodyB
Check whether the bounding radius of two bodies overlap.
Returns:
canCollide
-
bodyA
-
bodyB
Check whether two bodies are allowed to collide at all.
Returns:
getCollisionPairs
-
world
Get all potential intersecting body pairs.
Parameters:
-
world
WorldThe world to search in.
Returns:
An array of the bodies, ordered in pairs. Example: A result of [a,b,c,d] means that the potential pairs are: (a,b), (c,d).
setWorld
-
world
Set the world that we are searching for collision pairs in.
Parameters:
-
world
World
Properties
AABB
Number
static
Axis aligned bounding box type.
BOUNDING_CIRCLE
Number
static
Bounding circle type.
boundingVolumeType
Number
The bounding volume type to use in the broadphase algorithms. Should be set to Broadphase.AABB or Broadphase.BOUNDING_CIRCLE.
result
Array
The resulting overlapping pairs. Will be filled with results during .getCollisionPairs().