# Class SerializationPipeline

A pipeline for serializing the physics scene.

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

- Defined in pipeline/serialization_pipeline.d.ts:12

#####
Index

### Constructors

constructor

### Properties

raw

### Methods

deserializeAll
free
serializeAll

## Constructors

### constructor

- new SerializationPipeline(raw?): SerializationPipeline

- #### Parameters

  - `Optional` raw: RawSerializationPipeline

  #### Returns SerializationPipeline

  - Defined in pipeline/serialization_pipeline.d.ts:18

## Properties

### raw

raw: RawSerializationPipeline

- Defined in pipeline/serialization_pipeline.d.ts:13

## Methods

### deserializeAll

- deserializeAll(data): World

- Deserialize the complete physics state from a single byte array.

  #### Parameters

  - data: Uint8Array

    The byte array to deserialize.

  #### Returns World

  - Defined in pipeline/serialization_pipeline.d.ts:36

### free

- free(): void

- Release the WASM memory occupied by this serialization pipeline.

  #### Returns void

  - Defined in pipeline/serialization_pipeline.d.ts:17

### serializeAll

- serializeAll(gravity, integrationParameters, islands, broadPhase, narrowPhase, bodies, colliders, impulseJoints, multibodyJoints): Uint8Array

- Serialize a complete physics state into a single byte array.

  #### Parameters

  - gravity: Vector

    The current gravity affecting the simulation.

  - integrationParameters: IntegrationParameters

    The integration parameters of the simulation.

  - islands: IslandManager
  - broadPhase: BroadPhase

    The broad-phase of the simulation.

  - narrowPhase: NarrowPhase

    The narrow-phase of the simulation.

  - bodies: RigidBodySet

    The rigid-bodies taking part into the simulation.

  - colliders: ColliderSet

    The colliders taking part into the simulation.

  - impulseJoints: ImpulseJointSet

    The impulse joints taking part into the simulation.

  - multibodyJoints: MultibodyJointSet

    The multibody joints taking part into the simulation.

  #### Returns Uint8Array

  - Defined in pipeline/serialization_pipeline.d.ts:30