API Docs for: 0.6.0
Show:

SAPBroadphase Class

Sweep and prune broadphase along one axis.

Constructor

SAPBroadphase

()

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/SAPBroadphase.js:98

Get the colliding pairs

Parameters:

Returns:

Array:

setWorld

(
  • world
)

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

Change the world

Parameters:

sortAxisList

(
  • a
  • axisIndex
)
Array

Sorts bodies along an axis.

Parameters:

  • a Array
  • axisIndex Number

Returns:

Array:

Properties

axisIndex

Number

The axis to sort along.

axisList

Array

List of bodies currently in the broadphase.

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

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

The world to search in.