#

API Docs for: 0.6.1
Show: Inherited Protected Private Deprecated

# Broadphase Class

Defined in: `src/collision/Broadphase.js:9`

Base class for broadphase implementations

## Constructor

### `Broadphase`

()

Defined in `src/collision/Broadphase.js:9`

- Index
- Methods
- Properties

## Item Index

### Methods

- aabbQuery
- boundingSphereCheck
- collisionPairs
- doBoundingBoxBroadphase
- doBoundingSphereBroadphase
- intersectionTest
- makePairsUnique
- needBroadphaseCollision
- setWorld

### Properties

- dirty
- useBoundingBoxes
- world

## Methods

### `aabbQuery`

(

- `world`
- `aabb`
- `result`

)
Array

Defined in `src/collision/Broadphase.js:197`

Returns all the bodies within the AABB.

#### Parameters:

- `world` World
- `aabb` AABB
- `result` Array

  An array to store resulting bodies in.

#### Returns:

Array:

### `boundingSphereCheck`

(

- `bodyA`
- `bodyB`

)
Boolean

Defined in `src/collision/Broadphase.js:183`

Check if the bounding spheres of two bodies overlap.

#### Parameters:

- `bodyA` Body
- `bodyB` Body

#### Returns:

Boolean:

### `collisionPairs`

(

- `world`
- `p1`
- `p2`

)

Defined in `src/collision/Broadphase.js:37`

Get the collision pairs from the world

#### Parameters:

- `world` World

  The world to search in

- `p1` Array

  Empty array to be filled with body objects

- `p2` Array

  Empty array to be filled with body objects

### `doBoundingBoxBroadphase`

(

- `bodyA`
- `bodyB`
- `pairs1`
- `pairs2`

)

Defined in `src/collision/Broadphase.js:112`

Check if the bounding boxes of two bodies are intersecting.

#### Parameters:

- `bodyA` Body
- `bodyB` Body
- `pairs1` Array
- `pairs2` Array

### `doBoundingSphereBroadphase`

(

- `bodyA`
- `bodyB`
- `pairs1`
- `pairs2`

)

Defined in `src/collision/Broadphase.js:89`

Check if the bounding spheres of two bodies are intersecting.

#### Parameters:

- `bodyA` Body
- `bodyB` Body
- `pairs1` Array

  bodyA is appended to this array if intersection

- `pairs2` Array

  bodyB is appended to this array if intersection

### `intersectionTest`

(

- `bodyA`
- `bodyB`
- `pairs1`
- `pairs2`

)

Defined in `src/collision/Broadphase.js:73`

Check if the bounding volumes of two bodies intersect.

#### Parameters:

- `bodyA` Body
- `bodyB` Body
- `pairs1` Array
- `pairs2` Array

### `makePairsUnique`

(

- `pairs1`
- `pairs2`

)

Defined in `src/collision/Broadphase.js:135`

Removes duplicate pairs from the pair arrays.

#### Parameters:

- `pairs1` Array
- `pairs2` Array

### `needBroadphaseCollision`

(

- `bodyA`
- `bodyB`

)
Bool

Defined in `src/collision/Broadphase.js:48`

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

#### Parameters:

- `bodyA` Body
- `bodyB` Body

#### Returns:

Bool:

### `setWorld`

(

- `world`

)

Defined in `src/collision/Broadphase.js:175`

To be implemented by subcasses

#### Parameters:

- `world` World

## Properties

### `dirty`

Boolean

Defined in `src/collision/Broadphase.js:30`

Set to true if the objects in the world moved.

### `useBoundingBoxes`

Boolean

Defined in `src/collision/Broadphase.js:23`

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

### `world`

World

Defined in `src/collision/Broadphase.js:16`

The world to search for collisions in.