Class Broadphase

Base class for broadphase implementations

Author

schteppe

Hierarchy (view full)

Constructors

Properties

dirty: boolean

Set to true if the objects in the world moved.

useBoundingBoxes: boolean

If set to true, the broadphase uses bounding boxes for intersection tests, else it uses bounding spheres.

world: World

The world to search for collisions in.

Methods

  • Returns all the bodies within the AABB.

    Parameters

    Returns Body[]

  • Get the collision pairs from the world

    Parameters

    • world: World

      The world to search in

    • p1: Body[]

      Empty array to be filled with body objects

    • p2: Body[]

      Empty array to be filled with body objects

    Returns void

  • Check if the bounding boxes of two bodies are intersecting.

    Parameters

    Returns void

  • Check if the bounding spheres of two bodies are intersecting.

    Parameters

    • bodyA: Body
    • bodyB: Body
    • pairs1: Body[]

      bodyA is appended to this array if intersection

    • pairs2: Body[]

      bodyB is appended to this array if intersection

    Returns void

  • Check if the bounding volumes of two bodies intersect.

    Parameters

    Returns void

  • Removes duplicate pairs from the pair arrays.

    Parameters

    Returns void

  • Check if a body pair needs to be intersection tested at all.

    Parameters

    Returns boolean

  • To be implemented by subcasses

    Parameters

    Returns void

  • Check if the bounding spheres of two bodies overlap.

    Parameters

    Returns boolean