Class RigidBodySet

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

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

Hierarchy

  • RigidBodySet

Constructors

  • Parameters

    • Optional raw: RawRigidBodySet

    Returns RigidBodySet

Properties

map: any
raw: RawRigidBodySet

Methods

  • Does this set contain a rigid-body with the given handle?

    Parameters

    • handle: number

      The rigid-body handle to check.

    Returns boolean

  • Internal method, do not call this explicitly.

    Parameters

    Returns void

  • Applies the given closure to each rigid-body contained by this set.

    Parameters

    Returns void

  • Applies the given closure to each active rigid-bodies contained by this set.

    A rigid-body is active if it is not sleeping, i.e., if it moved recently.

    Parameters

    Returns void

  • Release the WASM memory occupied by this rigid-body set.

    Returns void

  • Gets the rigid-body with the given handle.

    Parameters

    • handle: number

      The handle of the rigid-body to retrieve.

    Returns RigidBody

  • Gets all rigid-bodies in the list.

    Returns

    rigid-bodies list.

    Returns RigidBody[]

  • The number of rigid-bodies on this set.

    Returns number

  • Removes a rigid-body from this set.

    This will also remove all the colliders and joints attached to the rigid-body.

    Parameters

    • handle: number

      The integer handle of the rigid-body to remove.

    • islands: IslandManager
    • colliders: ColliderSet

      The set of colliders that may contain colliders attached to the removed rigid-body.

    • impulseJoints: ImpulseJointSet

      The set of impulse joints that may contain joints attached to the removed rigid-body.

    • multibodyJoints: MultibodyJointSet

      The set of multibody joints that may contain joints attached to the removed rigid-body.

    Returns void

Generated using TypeDoc