# Class ImpulseJointSet

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

- Defined in dynamics/impulse_joint_set.d.ts:11

#####
Index

### Constructors

constructor

### Properties

map
raw

### Methods

contains
createJoint
finalizeDeserialization
forEach
forEachJointHandleAttachedToRigidBody
free
get
getAll
len
remove
unmap

## Constructors

### constructor

- new ImpulseJointSet(raw?): ImpulseJointSet

- #### Parameters

  - `Optional` raw: RawImpulseJointSet

  #### Returns ImpulseJointSet

  - Defined in dynamics/impulse_joint_set.d.ts:18

## Properties

### `Private` map

map: any

- Defined in dynamics/impulse_joint_set.d.ts:13

### raw

raw: RawImpulseJointSet

- Defined in dynamics/impulse_joint_set.d.ts:12

## Methods

### contains

- contains(handle): boolean

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

  #### Parameters

  - handle: number

    The joint handle to check.

  #### Returns boolean

  - Defined in dynamics/impulse_joint_set.d.ts:58

### createJoint

- createJoint(bodies, desc, parent1, parent2, wakeUp): ImpulseJoint

- 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: JointData

    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.

  - wakeUp: boolean

    Should the attached rigid-bodies be awakened?

  #### Returns ImpulseJoint

  - Defined in dynamics/impulse_joint_set.d.ts:30

### finalizeDeserialization

- finalizeDeserialization(bodies): void
- `Internal`

  #### Parameters

  - bodies: RigidBodySet

  #### Returns void

  - Defined in dynamics/impulse_joint_set.d.ts:20

### forEach

- forEach(f): void

- Applies the given closure to each joint contained by this set.

  #### Parameters

  - f: ((joint) => void)

    The closure to apply.

    - - (joint): void

      - #### Parameters

        - joint: ImpulseJoint

        #### Returns void

  - Defined in dynamics/impulse_joint_set.d.ts:72

### forEachJointHandleAttachedToRigidBody

- forEachJointHandleAttachedToRigidBody(handle, f): void

- Calls the given closure with the integer handle of each impulse joint attached to this rigid-body.

  #### Parameters

  - handle: number
  - f: ((handle) => void)

    The closure called with the integer handle of each impulse joint attached to the rigid-body.

    - - (handle): void

      - #### Parameters

        - handle: number

        #### Returns void

  - Defined in dynamics/impulse_joint_set.d.ts:43

### free

- free(): void

- Release the WASM memory occupied by this joint set.

  #### Returns void

  - Defined in dynamics/impulse_joint_set.d.ts:17

### get

- get(handle): ImpulseJoint

- Gets the joint with the given handle.

  Returns `null` if no joint with the specified handle exists.

  #### Parameters

  - handle: number

    The integer handle of the joint to retrieve.

  #### Returns ImpulseJoint

  - Defined in dynamics/impulse_joint_set.d.ts:66

### getAll

- getAll(): ImpulseJoint[]

- Gets all joints in the list.

  #### Returns ImpulseJoint[]

  joint list.

  - Defined in dynamics/impulse_joint_set.d.ts:78

### len

- len(): number

- The number of joints on this set.

  #### Returns number

  - Defined in dynamics/impulse_joint_set.d.ts:52

### remove

- remove(handle, wakeUp): void

- Remove a joint from this set.

  #### Parameters

  - handle: number

    The integer handle of the joint.

  - wakeUp: boolean

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

  #### Returns void

  - Defined in dynamics/impulse_joint_set.d.ts:37

### unmap

- unmap(handle): void

- Internal function, do not call directly.

  #### Parameters

  - handle: number

  #### Returns void

  - Defined in dynamics/impulse_joint_set.d.ts:48