SAP1DBroadphase Class
Sweep and prune broadphase along one axis.
Constructor
Item Index
Methods
Methods
boundingRadiusCheck
(
Boolean
-
bodyA
-
bodyB
Check whether the bounding radius of two bodies overlap.
Returns:
Boolean:
checkBounds
(
Boolean
static
-
bi
-
bj
-
axisIndex
Check if the bounds of two bodies overlap, along the given SAP axis.
Returns:
Boolean:
sortAxisListX
(
Number
-
bodyA
-
bodyB
Function for sorting bodies along the X axis. To be passed to array.sort()
Returns:
Number:
Properties
axisIndex
Number
Axis to sort the bodies along. Set to 0 for x axis, and 1 for y axis. For best performance, choose an axis that the bodies are spread out more on.
axisList
Array
List of bodies currently in the broadphase.
result
Array
The resulting overlapping pairs. Will be filled with results during .getCollisionPairs().