Options
All
  • Public
  • Public/Protected
  • All
Menu

Class NaiveBroadphase

Naive broadphase implementation, used in lack of better ones.

The naive broadphase looks at all possible pairs without restriction, therefore it has complexity N^2 (which is bad)

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

  • collisionPairs(world: World, pairs1: Body[], pairs2: Body[]): void

doBoundingBoxBroadphase

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

doBoundingSphereBroadphase

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