Class BroadphaseAbstract

Base class for broadphase implementations. Don't use this class directly.

Hierarchy

Constructors

  • Parameters

    • type: 2 | 1

    Returns Broadphase

Properties

boundingVolumeType: 2 | 1

The bounding volume type to use in the broadphase algorithms. Should be set to Broadphase.AABB or Broadphase.BOUNDING_CIRCLE.

result: Body[]

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

type: 2 | 1
world?: World

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

AABB: 1 = 1

Axis aligned bounding box type.

BOUNDING_CIRCLE: 2 = 2

Bounding circle type.

NAIVE: 1 = 1

Naive Broadphase

SAP: 2 = 2

SAP Broadphase

Methods

  • Returns all the bodies within an AABB.

    Parameters

    • Optional world: World
    • Optional aabb: AABB
    • Optional result: Body[]

    Returns Body[]

  • Check whether the bounding volumes of two bodies overlap.

    Parameters

    Returns boolean

  • Get all potential intersecting body pairs.

    Parameters

    • world: World

      The world to search in.

    Returns Body[]

    An array of the bodies, ordered in pairs. Example: A result of [a,b,c,d] means that the potential pairs are: (a,b), (c,d).

  • Set the world that we are searching for collision pairs in.

    Parameters

    Returns void

  • Check whether the AABB of two bodies overlap.

    Parameters

    Returns boolean

  • Check whether the bounding radius of two bodies overlap.

    Parameters

    Returns boolean

  • Check whether two bodies are allowed to collide at all.

    Parameters

    Returns boolean