A set of rigid bodies that can be handled by a physics pipeline.

To avoid leaking WASM resources, this MUST be freed manually with colliderSet.free() once you are done using it (and all the rigid-bodies it created).

Constructors

  • Parameters

    • Optional raw: RawColliderSet

    Returns ColliderSet

Properties

map: any
raw: RawColliderSet

Methods

  • Internal

    Type Parameters

    • Res

    Parameters

    • Optional f: ((collider) => Res)

    Returns ((handle) => Res)

      • (handle): Res
      • Parameters

        • handle: number

        Returns Res

  • Does this set contain a collider with the given handle?

    Parameters

    • handle: number

      The collider handle to check.

    Returns boolean

  • Creates a new collider and return its integer handle.

    Parameters

    • bodies: RigidBodySet

      The set of bodies where the collider's parent can be found.

    • desc: ColliderDesc

      The collider's description.

    • parentHandle: number

      The integer handle of the rigid-body this collider is attached to.

    Returns Collider

  • Internal

    Parameters

    Returns void

  • Applies the given closure to each collider contained by this set.

    Parameters

    • f: ((collider) => void)

      The closure to apply.

        • (collider): void
        • Parameters

          Returns void

    Returns void

  • Release the WASM memory occupied by this collider set.

    Returns void

  • Gets the rigid-body with the given handle.

    Parameters

    • handle: number

      The handle of the rigid-body to retrieve.

    Returns Collider

  • Gets all colliders in the list.

    Returns Collider[]

    collider list.

  • The number of colliders on this set.

    Returns number

  • Remove a collider from this set.

    Parameters

    • handle: number

      The integer handle of the collider to remove.

    • islands: IslandManager
    • bodies: RigidBodySet

      The set of rigid-body containing the rigid-body the collider is attached to.

    • wakeUp: boolean

      If true, the rigid-body the removed collider is attached to will be woken-up automatically.

    Returns void

  • Internal function, do not call directly.

    Parameters

    • handle: number

    Returns void