#

API Docs for: 0.6.1
Show: Inherited Protected Private Deprecated

# Narrowphase Class

Defined in: `src/world/Narrowphase.js:15`

Helper class for the World. Generates ContactEquations.

## Constructor

### `Narrowphase`

()

Defined in `src/world/Narrowphase.js:15`

- Index
- Methods
- Properties

## Item Index

### Methods

- convexConvex
- convexHeightfield
- convexParticle
- convexTrimesh
- createContactEquation
- getContacts
- particlePlane
- particleSphere
- planeBox
- planeConvex
- planeTrimesh
- sphereBox
- sphereConvex
- sphereHeightfield
- spherePlane
- sphereSphere
- sphereTrimesh

### Properties

- contactPointPool
- enableFrictionReduction
- v3pool

## Methods

### `convexConvex`

(

- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:1252`

#### Parameters:

- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `convexHeightfield`

()

Defined in `src/world/Narrowphase.js:1573`

### `convexParticle`

(

- `result`
- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:1475`

#### Parameters:

- `result` Array
- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `convexTrimesh`

(

- `result`
- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:1309`

#### Parameters:

- `result` Array
- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `createContactEquation`

() ContactEquation

Defined in `src/world/Narrowphase.js:51`

Make a contact object, by using the internal pool or creating a new one.

#### Returns:

ContactEquation:

### `getContacts`

(

- `p1`
- `p2`
- `world`
- `result`
- `oldcontacts`

)

Defined in `src/world/Narrowphase.js:199`

Generate all contacts between a list of body pairs

#### Parameters:

- `p1` Array

  Array of body indices

- `p2` Array

  Array of body indices

- `world` World
- `result` Array

  Array to store generated contacts

- `oldcontacts` Array

  Optional. Array of reusable contact objects

### `particlePlane`

(

- `result`
- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:1393`

#### Parameters:

- `result` Array
- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `particleSphere`

(

- `result`
- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:1434`

#### Parameters:

- `result` Array
- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `planeBox`

(

- `result`
- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:1152`

#### Parameters:

- `result` Array
- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `planeConvex`

(

- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:1176`

#### Parameters:

- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `planeTrimesh`

(

- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:345`

#### Parameters:

- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `sphereBox`

(

- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:708`

#### Parameters:

- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `sphereConvex`

(

- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:929`

#### Parameters:

- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `sphereHeightfield`

()

Defined in `src/world/Narrowphase.js:1651`

### `spherePlane`

(

- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:612`

#### Parameters:

- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `sphereSphere`

(

- `si`
- `sj`
- `xi`
- `xj`
- `qi`
- `qj`
- `bi`
- `bj`

)

Defined in `src/world/Narrowphase.js:308`

#### Parameters:

- `si` Shape
- `sj` Shape
- `xi` Vec3
- `xj` Vec3
- `qi` Quaternion
- `qj` Quaternion
- `bi` Body
- `bj` Body

### `sphereTrimesh`

(

- `sphereShape`
- `trimeshShape`
- `spherePos`
- `trimeshPos`
- `sphereQuat`
- `trimeshQuat`
- `sphereBody`
- `trimeshBody`

)

Defined in `src/world/Narrowphase.js:416`

#### Parameters:

- `sphereShape` Shape
- `trimeshShape` Shape
- `spherePos` Vec3
- `trimeshPos` Vec3
- `sphereQuat` Quaternion
- `trimeshQuat` Quaternion
- `sphereBody` Body
- `trimeshBody` Body

## Properties

### `contactPointPool`

Array

Defined in `src/world/Narrowphase.js:25`

Internal storage of pooled contact points.

### `enableFrictionReduction`

Boolean

Defined in `src/world/Narrowphase.js:45`

### `v3pool`

Vec3Pool

Defined in `src/world/Narrowphase.js:36`

Pooled vectors.