Options
All
  • Public
  • Public/Protected
  • All
Menu

Class RigidBodySet

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

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

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

Hierarchy

  • RigidBodySet

Index

Constructors

constructor

  • Parameters

    • Optional raw: RawRigidBodySet

    Returns RigidBodySet

  • Parameters

    • Optional raw: RawRigidBodySet

    Returns RigidBodySet

Properties

raw

raw: RawRigidBodySet

Methods

contains

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

    Parameters

    Returns boolean

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

    Parameters

    Returns boolean

createRigidBody

  • Creates a new rigid-body and return its integer handle.

    Parameters

    • desc: RigidBodyDesc

      The description of the rigid-body to create.

    Returns RigidBodyHandle

  • Creates a new rigid-body and return its integer handle.

    Parameters

    • desc: RigidBodyDesc

      The description of the rigid-body to create.

    Returns RigidBodyHandle

forEachActiveRigidBody

  • 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

  • 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

forEachRigidBody

  • forEachRigidBody(f: (body: RigidBody) => void): void
  • forEachRigidBody(f: (body: RigidBody) => void): void
  • Applies the given closure to each rigid-body contained by this set.

    Parameters

    Returns void

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

    Parameters

    Returns void

forEachRigidBodyHandle

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

    Parameters

    Returns void

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

    Parameters

    Returns void

free

  • free(): void
  • free(): void
  • Release the WASM memory occupied by this rigid-body set.

    Returns void

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

    Returns void

get

  • Gets the rigid-body with the given handle.

    Parameters

    Returns RigidBody

  • Gets the rigid-body with the given handle.

    Parameters

    Returns RigidBody

len

  • len(): number
  • len(): number
  • The number of rigid-bodies on this set.

    Returns number

  • The number of rigid-bodies on this set.

    Returns number

remove

  • Removes a rigid-body from this set.

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

    Parameters

    • handle: RigidBodyHandle

      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.

    • joints: JointSet

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

    Returns void

  • Removes a rigid-body from this set.

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

    Parameters

    • handle: RigidBodyHandle

      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.

    • joints: JointSet

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

    Returns void

Generated using TypeDoc