Broadphase Class
src/collision/Broadphase.js:6
Base class for broadphase implementations.
Constructor
Methods
boundingRadiusCheck
-
bodyA
-
bodyB
Defined in
src/collision/Broadphase.js:70
Check whether the bounding radius of two bodies overlap.
Returns:
boundingRadiusCheck
-
bodyA
-
bodyB
Defined in
src/collision/Broadphase.js:84
Check whether the bounding radius of two bodies overlap.
Returns:
boundingRadiusCheck
-
bodyA
-
bodyB
Defined in
src/collision/Broadphase.js:95
Check whether the bounding radius of two bodies overlap.
Returns:
canCollide
-
bodyA
-
bodyB
Defined in
src/collision/Broadphase.js:118
Check whether two bodies are allowed to collide at all.
Returns:
getCollisionPairs
-
world
Defined in
src/collision/Broadphase.js:60
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
Defined in
src/collision/Broadphase.js:51
Set the world that we are searching for collision pairs in.
Parameters:
-
world
World
Properties
boundingVolumeType
Number
Defined in
src/collision/Broadphase.js:30
The bounding volume type to use in the broadphase algorithms. Should be set to Broadphase.AABB or Broadphase.BOUNDING_CIRCLE.
result
Array
Defined in
src/collision/Broadphase.js:15
The resulting overlapping pairs. Will be filled with results during .getCollisionPairs().
world
World
Defined in
src/collision/Broadphase.js:22
The world to search for collision pairs in. To change it, use .setWorld()