Options
All
  • Public
  • Public/Protected
  • All
Menu

Class ColliderSet

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 colliderSet.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 colliderSet.free() once you are done using it (and all the rigid-bodies it created).

Hierarchy

  • ColliderSet

Index

Constructors

constructor

  • Parameters

    • Optional raw: RawColliderSet

    Returns ColliderSet

  • Parameters

    • Optional raw: RawColliderSet

    Returns ColliderSet

Properties

raw

raw: RawColliderSet

Methods

contains

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

    Parameters

    Returns boolean

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

    Parameters

    Returns boolean

createCollider

  • 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: RigidBodyHandle

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

    Returns ColliderHandle

  • 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: RigidBodyHandle

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

    Returns ColliderHandle

forEachCollider

  • forEachCollider(f: (collider: Collider) => void): void
  • forEachCollider(f: (collider: Collider) => void): void
  • Applies the given closure to each collider contained by this set.

    Parameters

    • f: (collider: Collider) => void

      The closure to apply.

    Returns void

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

    Parameters

    • f: (collider: Collider) => void

      The closure to apply.

    Returns void

forEachColliderHandle

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

    Parameters

    Returns void

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

    Parameters

    Returns void

free

  • free(): void
  • free(): void
  • Release the WASM memory occupied by this collider set.

    Returns void

  • Release the WASM memory occupied by this collider set.

    Returns void

get

  • Gets the rigid-body with the given handle.

    Parameters

    Returns Collider

  • Gets the rigid-body with the given handle.

    Parameters

    Returns Collider

len

  • len(): number
  • len(): number
  • The number of colliders on this set.

    Returns number

  • The number of colliders on this set.

    Returns number

remove

  • Remove a collider from this set.

    Parameters

    • handle: ColliderHandle

      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

  • Remove a collider from this set.

    Parameters

    • handle: ColliderHandle

      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

Generated using TypeDoc