babylon.quarks - v0.19.0
    Preparing search index...

    Class TrailParticle

    Particle implementation for trail-based particles.

    Implements

    Index

    Constructors

    • Parameters

      • Optionalstore: ParticleStore

        Column storage to bind to. A private single-row store is created when omitted, so a standalone new TrailParticle() still works.

      • OptionalstoreIndex: number

        Row this particle owns.

      Returns TrailParticle

    Properties

    color: Vector4

    Color of the particle.

    historyCapacity: number

    Number of samples the ring buffers can hold.

    historyColors: Float32Array

    Ring buffer of recorded colors, 4 floats per sample.

    historyCount: number

    Number of valid samples currently held.

    historyHead: number

    Slot the next sample is written to.

    historyPositions: Float32Array

    Ring buffer of recorded positions, 3 floats per sample.

    historySizes: Float32Array

    Ring buffer of recorded widths, 1 float per sample.

    length: number

    Length of the trail.

    localPosition?: Vector3

    Local position of the particle.

    memory: never[]

    the memory of the particle.

    parentMatrix?: Matrix4

    Parent matrix for transformation.

    position: Vector3

    Position of the particle.

    previous: LinkedList<RecordState>

    Previous states of the particle.

    The trail history now lives in the flat ring buffer below (historyPositions / historySizes / historyColors), which records a sample without allocating. This list is no longer populated or rendered.

    previousPosition: Vector3

    Where this particle was when the current simulation step began; see Particle.previousPosition.

    previousVelocity: Vector3

    Velocity at the start of the current step; see Particle.previousVelocity.

    scalarOffset: number
    scalars: Float64Array

    Row of the store's interleaved scalars this particle owns.

    size: Vector3

    Size of the particle.

    startColor: Vector4

    Initial color of the particle.

    startSize: Vector3

    Initial size of the particle.

    startSpeed: number

    Initial speed of the particle.

    Column storage backing this particle's vector attributes.

    storeIndex: number

    Row this particle occupies in store.

    uvTile: number

    UV tile index.

    velocity: Vector3

    Velocity of the particle.

    Accessors

    • get age(): number

      Age of the particle.

      Returns number

    • set age(value: number): void

      Age of the particle.

      Parameters

      • value: number

      Returns void

    • get died(): boolean

      Indicates if the particle has died.

      Returns boolean

    • get life(): number

      Life duration of the particle.

      Returns number

    • set life(value: number): void

      Life duration of the particle.

      Parameters

      • value: number

      Returns void

    • get speedModifier(): number

      Speed modifier of the particle.

      Returns number

    • set speedModifier(value: number): void

      Speed modifier of the particle.

      Parameters

      • value: number

      Returns void

    Methods

    • Allocates the trail ring buffers, reusing them when the capacity is unchanged.

      Parameters

      • capacity: number

        Number of samples to hold.

      Returns void

    • Ring buffer slot of the i-th sample counting from the oldest one.

      Parameters

      • i: number

        Sample offset, 0 being the oldest live sample.

      Returns number

    • Re-points the vector views after the store grew its arrays.

      Returns void

    • Resets the particle properties and clears the previous states.

      Returns void

    • Drops every recorded sample without releasing the buffers.

      Returns void

    • Moves this particle onto a different store row. The caller is responsible for having moved the row contents too.

      Parameters

      • index: number

      Returns void

    • Records the current state into the trail ring buffer, or retires the oldest sample once the particle is dead. Allocation free.

      Returns void