API Docs for: 0.5.0
Show:

GridBroadphase Class

Broadphase that uses axis-aligned bins.

Constructor

GridBroadphase

(
  • [options]
)

Parameters:

  • [options] Object optional
    • [xmin] Number optional

      Lower x bound of the grid

    • [xmax] Number optional

      Upper x bound

    • [ymin] Number optional

      Lower y bound

    • [ymax] Number optional

      Upper y bound

    • [nx] Number optional

      Number of bins along x axis

    • [ny] Number optional

      Number of bins along y axis

Methods

boundingRadiusCheck

(
  • bodyA
  • bodyB
)
Boolean

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

Check whether the bounding radius of two bodies overlap.

Parameters:

Returns:

Boolean:

canCollide

(
  • bodyA
  • bodyB
)
Boolean

Check whether two bodies are allowed to collide at all.

Parameters:

Returns:

Boolean:

getCollisionPairs

(
  • world
)
Array

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

Get collision pairs.

Parameters:

Returns:

Array:

setWorld

(
  • world
)

Set the world that we are searching for collision pairs in

Parameters:

Properties

boundingVolumeType

Number

The bounding volume type to use in the broadphase algorithms.

result

Array

The resulting overlapping pairs. Will be filled with results during .getCollisionPairs().

world

World

The world to search for collision pairs in. To change it, use .setWorld()