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

Constructors

Properties

Methods

Constructors

Properties

raw: RawSerializationPipeline

Methods

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

    Parameters

    • data: Uint8Array

      The byte array to deserialize.

    Returns World

  • Release the WASM memory occupied by this serialization pipeline.

    Returns void

  • 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