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.

Hierarchy

  • NarrowPhase

Constructors

  • Parameters

    • Optional raw: RawNarrowPhase

    Returns NarrowPhase

Properties

raw: RawNarrowPhase
tempManifold: TempContactManifold

Methods

  • 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: TempContactManifold, flipped: boolean) => 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.

    Returns void

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

    Parameters

    • collider1: number

      The second collider involved in the contact.

    • f: ((collider2: number) => void)

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

        • (collider2: number): void
        • Parameters

          • collider2: number

          Returns void

    Returns void

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

    Returns void

  • 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

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

    Parameters

    • collider1: number
    • f: ((collider2: number) => void)
        • (collider2: number): void
        • Parameters

          • collider2: number

          Returns void

    Returns void

Generated using TypeDoc