Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Broadphase

Base class for broadphase implementations

author

schteppe

Hierarchy

Index

Constructors

constructor

Properties

dirty

dirty: boolean

Set to true if the objects in the world moved.

useBoundingBoxes

useBoundingBoxes: boolean

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

world

world: null | World

The world to search for collisions in.

Methods

aabbQuery

collisionPairs

  • 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

doBoundingBoxBroadphase

  • doBoundingBoxBroadphase(bodyA: Body, bodyB: Body, pairs1: Body[], pairs2: Body[]): void

doBoundingSphereBroadphase

  • doBoundingSphereBroadphase(bodyA: Body, bodyB: Body, pairs1: Body[], pairs2: Body[]): 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

intersectionTest

  • intersectionTest(bodyA: Body, bodyB: Body, pairs1: Body[], pairs2: Body[]): void

makePairsUnique

  • makePairsUnique(pairs1: Body[], pairs2: Body[]): void

needBroadphaseCollision

  • needBroadphaseCollision(bodyA: Body, bodyB: Body): boolean

setWorld

  • setWorld(world: World): void

Static boundingSphereCheck

  • boundingSphereCheck(bodyA: Body, bodyB: Body): boolean