Broadphase Class
Base class for broadphase implementations
Constructor
Broadphase
()
Item Index
Methods
Properties
Methods
aabbQuery
(
Array
-
world
-
aabb
-
result
Returns all the bodies within the AABB.
Returns:
Array:
boundingSphereCheck
(
Boolean
-
bodyA
-
bodyB
Check if the bounding spheres of two bodies overlap.
Returns:
Boolean:
collisionPairs
(
-
world
-
p1
-
p2
Get the collision pairs from the world
Parameters:
-
world
WorldThe world to search in
-
p1
ArrayEmpty array to be filled with body objects
-
p2
ArrayEmpty array to be filled with body objects
doBoundingBoxBroadphase
(
-
bodyA
-
bodyB
-
pairs1
-
pairs2
Check if the bounding boxes of two bodies are intersecting.
doBoundingSphereBroadphase
(
-
bodyA
-
bodyB
-
pairs1
-
pairs2
Check if the bounding spheres of two bodies are intersecting.
intersectionTest
(
-
bodyA
-
bodyB
-
pairs1
-
pairs2
Check if the bounding volumes of two bodies intersect.
makePairsUnique
(
-
pairs1
-
pairs2
Removes duplicate pairs from the pair arrays.
Parameters:
-
pairs1
Array -
pairs2
Array
needBroadphaseCollision
(
Bool
-
bodyA
-
bodyB
Check if a body pair needs to be intersection tested at all.
Returns:
Bool:
Properties
dirty
Boolean
Set to true if the objects in the world moved.
useBoundingBoxes
Boolean
If set to true, the broadphase uses bounding boxes for intersection test, else it uses bounding spheres.