API Docs for: 0.3.0
Show:

GridBroadphase Class

Broadphase that uses axis-aligned bins.

Constructor

GridBroadphase

(
  • xmin
  • xmax
  • ymin
  • ymax
  • nx
  • ny
)

Parameters:

  • xmin Number

    Lower x bound of the grid

  • xmax Number

    Upper x bound

  • ymin Number

    Lower y bound

  • ymax Number

    Upper y bound

  • nx Number

    Number of bins along x axis

  • ny Number

    Number of bins along y axis

Methods

boundingRadiusCheck

(
  • bodyA
  • bodyB
)
Boolean

Check whether the bounding radius of two bodies overlap.

Parameters:

Returns:

Boolean:

getBinIndex

(
  • x
  • y
)
Number

Get a bin index given a world coordinate

Parameters:

  • x Number
  • y Number

Returns:

Number:

Integer index

getCollisionPairs

(
  • world
)
Array

Inherited from Broadphase but overwritten in src/collision/GridBroadphase.js:59

Get collision pairs.

Parameters:

Returns:

Array: