GridBroadphase Class
Broadphase that uses axis-aligned bins.
Constructor
GridBroadphase
(
-
xmin
-
xmax
-
ymin
-
ymax
-
nx
-
ny
Parameters:
-
xmin
NumberLower x bound of the grid
-
xmax
NumberUpper x bound
-
ymin
NumberLower y bound
-
ymax
NumberUpper y bound
-
nx
NumberNumber of bins along x axis
-
ny
NumberNumber of bins along y axis
Methods
boundingRadiusCheck
(
Boolean
-
bodyA
-
bodyB
Check whether the bounding radius of two bodies overlap.
Returns:
Boolean:
getBinIndex
(
Number
-
x
-
y
Get a bin index given a world coordinate
Parameters:
-
x
Number -
y
Number
Returns:
Number:
Integer index
Properties
result
Array
The resulting overlapping pairs. Will be filled with results during .getCollisionPairs().