Class NaiveBroadphase

Naive broadphase implementation. Does N^2 tests.

Hierarchy

Constructors

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

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

      An array to store resulting bodies in.

    Returns Body[]

  • Check whether the bounding volumes of two bodies overlap.

    Parameters

    Returns boolean

  • 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