Options
All
  • Public
  • Public/Protected
  • All
Menu

Class JointSet

A set of joints. A set of joints.

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

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

Hierarchy

  • JointSet

Index

Constructors

constructor

  • new JointSet(raw?: RawJointSet): JointSet
  • new JointSet(raw?: RawJointSet): JointSet
  • Parameters

    • Optional raw: RawJointSet

    Returns JointSet

  • Parameters

    • Optional raw: RawJointSet

    Returns JointSet

Properties

raw

raw: RawJointSet

Methods

contains

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

    Parameters

    Returns boolean

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

    Parameters

    Returns boolean

createJoint

  • Creates a new joint and return its integer handle.

    Parameters

    • bodies: RigidBodySet

      The set of rigid-bodies containing the bodies the joint is attached to.

    • desc: JointParams

      The joint's parameters.

    • parent1: number

      The handle of the first rigid-body this joint is attached to.

    • parent2: number

      The handle of the second rigid-body this joint is attached to.

    Returns number

  • Creates a new joint and return its integer handle.

    Parameters

    • bodies: RigidBodySet

      The set of rigid-bodies containing the bodies the joint is attached to.

    • desc: JointParams

      The joint's parameters.

    • parent1: number

      The handle of the first rigid-body this joint is attached to.

    • parent2: number

      The handle of the second rigid-body this joint is attached to.

    Returns number

forEachJoint

  • forEachJoint(f: (handle: Joint) => void): void
  • forEachJoint(f: (handle: Joint) => void): void
  • Applies the given closure to each joints contained by this set.

    Parameters

    • f: (handle: Joint) => void

      The closure to apply.

        • Parameters

          Returns void

    Returns void

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

    Parameters

    • f: (handle: Joint) => void

      The closure to apply.

        • Parameters

          Returns void

    Returns void

forEachJointHandle

  • forEachJointHandle(f: (handle: JointHandle) => void): void
  • forEachJointHandle(f: (handle: JointHandle) => void): void
  • Applies the given closure to the handle of each joints contained by this set.

    Parameters

    Returns void

  • Applies the given closure to the handle of each joints contained by this set.

    Parameters

    Returns void

free

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

    Returns void

  • Release the WASM memory occupied by this joint set.

    Returns void

get

  • Gets the joint with the given handle.

    Returns null if no joint with the specified handle exists. Note that two distinct calls with the same handle will return two different JavaScript objects that both represent the same joint.

    Parameters

    • handle: JointHandle

      The integer handle of the joint to retrieve.

    Returns Joint

  • Gets the joint with the given handle.

    Returns null if no joint with the specified handle exists. Note that two distinct calls with the same handle will return two different JavaScript objects that both represent the same joint.

    Parameters

    • handle: JointHandle

      The integer handle of the joint to retrieve.

    Returns Joint

len

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

    Returns number

  • The number of joints on this set.

    Returns number

remove

  • Remove a joint from this set.

    Parameters

    • handle: JointHandle

      The integer handle of the joint.

    • islands: IslandManager
    • bodies: RigidBodySet

      The set of rigid-bodies containing the rigid-bodies attached by the removed joint.

    • wake_up: boolean

      If true, the rigid-bodies attached by the removed joint will be woken-up automatically.

    Returns void

  • Remove a joint from this set.

    Parameters

    • handle: JointHandle

      The integer handle of the joint.

    • islands: IslandManager
    • bodies: RigidBodySet

      The set of rigid-bodies containing the rigid-bodies attached by the removed joint.

    • wake_up: boolean

      If true, the rigid-bodies attached by the removed joint will be woken-up automatically.

    Returns void

Generated using TypeDoc