Class ColliderSet

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).

Hierarchy

  • ColliderSet

Constructors

  • Parameters

    • Optional raw: RawColliderSet

    Returns ColliderSet

Properties

map: any
raw: RawColliderSet

Methods

  • Internal

    Type Parameters

    • Res

    Parameters

    Returns ((handle: number) => Res)

      • (handle: number): Res
      • Internal

        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: Collider) => void)

      The closure to apply.

    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 list.

    Returns Collider[]

  • 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

Generated using TypeDoc