Broadphase

Broadphase

This is an abstract class that extended to classes that are used to filter out unnecessary collision checks to boost performance.

Constructor

(abstract) new Broadphase()

Source:
See:
  • QuadtreeBroadphase
  • GridBroadphase
  • AABBBroadphase

Methods

getCollisionPairs(_target) → {Array.<CollisionPair>}

Description:
  • Gets all possibly colliding pairs.
Source:
Parameters:
Name Type Description
_target Array.<CollisionPair> Empty array to store results.
Returns:
Type
Array.<CollisionPair>

query(_bounds, _target) → {Array.<Entity>}

Description:
  • Returns bodies that are within the given bound.
Source:
Parameters:
Name Type Description
_bounds Bounds Region to check in.
_target Array.<Entity> Empty array to store results.
Returns:
Type
Array.<Entity>

update(_bodies, _bounds)

Source:
Parameters:
Name Type Description
_bodies Array.<Array.<Entity>>
_bounds Array.<Array.<BoundingBox>>