The record of a soft body tearing: the elements it lost, the particles the tear split, the pieces the tear separated into soft bodies of their own, and the clusters and joints that moved with them.

Events drained from an EventQueue are only valid inside the draining closure; events returned by World.tearSoftBody and World.cutSoftBody must be freed with .free().

Constructors

Properties

raw: RawSoftBodyTearEvent

Methods

  • The index of the cluster the i-th split created.

    Parameters

    • i: number

    Returns number

  • Does the cluster the i-th split created keep the source cluster's proxy?

    Parameters

    • i: number

    Returns boolean

  • The proxy rigid body of the cluster the i-th split created.

    Parameters

    • i: number

    Returns number

  • The soft body holding the cluster the i-th split created.

    Parameters

    • i: number

    Returns number

  • The cluster of the torn body the i-th split came from.

    Parameters

    • i: number

    Returns number

  • Returns void

  • The particles the tear inserted.

    Returns Uint32Array

  • The i-th moved impulse joint.

    Parameters

    • i: number

    Returns number

  • The proxy the i-th moved joint was attached to before the tear.

    Parameters

    • i: number

    Returns number

  • The proxy the i-th moved joint is attached to after the tear.

    Parameters

    • i: number

    Returns number

  • The number of clusters the tear split.

    Returns number

  • The number of impulse joints the tear moved to another proxy.

    Returns number

  • The number of pieces the tear split off into soft bodies of their own.

    Returns number

  • Where a particle of the torn body is after the tear: its soft body and index there, or null if the particle was removed.

    Parameters

    • particle: number

    Returns {
        particle: number;
        softBody: number;
    }

    • particle: number
    • softBody: number
  • The clusters that moved into the i-th piece, flattened as (source, destination) index pairs.

    Parameters

    • i: number

    Returns Uint32Array

  • The particles (indices in the torn body) that went into the i-th piece.

    Parameters

    • i: number

    Returns Uint32Array

  • The soft body the i-th piece became.

    Parameters

    • i: number

    Returns number

  • The particle pairs of the edges the tear removed, flattened.

    Returns Uint32Array

  • The particle pairs (flattened) the tear started from.

    Returns Uint32Array

  • The soft body that tore.

    Returns number

  • The particles the tear split, flattened as (original, copy) pairs.

    Returns Uint32Array

  • The particles of the cells that tore, flattened.

    Returns Uint32Array

  • The particle pairs of the edges that tore, flattened.

    Returns Uint32Array