# Class NarrowPhase

The narrow-phase used for precise collision-detection.

To avoid leaking WASM resources, this MUST be freed manually with `narrowPhase.free()` once you are done using it.

- Defined in geometry/narrow_phase.d.ts:10

#####
Index

### Constructors

constructor

### Properties

raw
tempManifold

### Methods

contactPair
contactPairsWith
free
intersectionPair
intersectionPairsWith

## Constructors

### constructor

- new NarrowPhase(raw?): NarrowPhase

- #### Parameters

  - `Optional` raw: RawNarrowPhase

  #### Returns NarrowPhase

  - Defined in geometry/narrow_phase.d.ts:17

## Properties

### raw

raw: RawNarrowPhase

- Defined in geometry/narrow_phase.d.ts:11

### tempManifold

tempManifold: TempContactManifold

- Defined in geometry/narrow_phase.d.ts:12

## Methods

### contactPair

- contactPair(collider1, collider2, f): void

- Iterates through all the contact manifolds between the given pair of colliders.

  #### Parameters

  - collider1: number

    The first collider involved in the contact.

  - collider2: number

    The second collider involved in the contact.

  - f: ((manifold, flipped) => void)

    Closure that will be called on each contact manifold between the two colliders. If the second argument passed to this closure is `true`, then the contact manifold data is flipped, i.e., methods like `localNormal1` actually apply to the `collider2` and fields like `localNormal2` apply to the `collider1`.

    - - (manifold, flipped): void

      - #### Parameters

        - manifold: TempContactManifold
        - flipped: boolean

        #### Returns void

  - Defined in geometry/narrow_phase.d.ts:39

### contactPairsWith

- contactPairsWith(collider1, f): void

- Enumerates all the colliders potentially in contact with the given collider.

  #### Parameters

  - collider1: number

    The second collider involved in the contact.

  - f: ((collider2) => void)

    Closure that will be called on each collider that is in contact with `collider1`.

    - - (collider2): void

      - #### Parameters

        - collider2: number

        #### Returns void

  - Defined in geometry/narrow_phase.d.ts:24

### free

- free(): void

- Release the WASM memory occupied by this narrow-phase.

  #### Returns void

  - Defined in geometry/narrow_phase.d.ts:16

### intersectionPair

- intersectionPair(collider1, collider2): boolean

- Returns `true` if `collider1` and `collider2` intersect and at least one of them is a sensor.

  #### Parameters

  - collider1: number

    − The first collider involved in the intersection.

  - collider2: number

    − The second collider involved in the intersection.

  #### Returns boolean

  - Defined in geometry/narrow_phase.d.ts:45

### intersectionPairsWith

- intersectionPairsWith(collider1, f): void

- Enumerates all the colliders intersecting the given colliders, assuming one of them is a sensor.

  #### Parameters

  - collider1: number
  - f: ((collider2) => void)
    - - (collider2): void

      - #### Parameters

        - collider2: number

        #### Returns void

  - Defined in geometry/narrow_phase.d.ts:29