Documentation
    Preparing search index...

    Class ParticleTrailStore

    Fixed-capacity ring buffers — one history chain per pool slot.

    Storage is allocated once in the constructor; pushSample and copySlot are the only mutators the emitter calls on the hot path.

    Index
    • Parameters

      • capacity: number
      • length: number

      Returns ParticleTrailStore

    count: Uint8Array

    Valid sample count per slot, in [0, length].

    head: Uint16Array

    Next write index per slot, in [0, length).

    length: number

    Samples per slot.

    positions: Float32Array

    capacity × length × 3 world-space centres, xyz stride 3.

    • Clears every slot's history without freeing storage.

      Returns void

    • Copies slot from over slot to — the trail mirror of ParticlePool.kill's swap-remove.

      Parameters

      • from: number
      • to: number

      Returns void

    • Valid sample count for a live slot.

      Parameters

      • index: number

      Returns number

    • Appends (x, y, z) when it is far enough from the newest sample.

      The first sample is always accepted so a freshly spawned particle still produces a degenerate one-point history until it moves.

      Parameters

      • index: number
      • x: number
      • y: number
      • z: number
      • minDistance: number

      Returns void

    • Writes sample sampleIndex (0 = oldest) into out.

      Parameters

      • index: number
      • sampleIndex: number
      • out: { x: number; y: number; z: number }

      Returns void

    • Clears one slot — called from ParticlePool.spawn via the emitter.

      Parameters

      • index: number

      Returns void