Options
All
  • Public
  • Public/Protected
  • All
Menu

Class GridBroadphase

Axis aligned uniform grid broadphase.

todo

Needs support for more than just planes and spheres.

Hierarchy

Index

Constructors

constructor

Properties

aabbMax

aabbMax: Vec3

aabbMax

aabbMin

aabbMin: Vec3

aabbMin

binLengths

binLengths: number[]

binLengths

bins

bins: Body[][]

bins

dirty

dirty: boolean

Set to true if the objects in the world moved.

nx

nx: number

Number of boxes along x

ny

ny: number

Number of boxes along y

nz

nz: number

Number of boxes along z

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