babylon.quarks - v1.0.0
    Preparing search index...

    Interface Particle

    A particle the simulation core spawns and updates: an IParticle that can be reset for reuse.

    interface Particle {
        age: number;
        angularVelocity?: number | Quaternion;
        animatedVelocity?: Vector3;
        color: Vector4;
        emissionState?: EmissionState;
        life: number;
        memory: GeneratorMemory;
        parentMatrix?: Matrix4;
        position: Vector3;
        previousPosition?: Vector3;
        previousVelocity?: Vector3;
        rotation?: number | Quaternion;
        rotationAxis?: Vector3 | null;
        serial?: number;
        size: Vector3;
        speedModifier: number;
        startColor: Vector4;
        startSize: Vector3;
        startSpeed: number;
        uvTile: number;
        velocity: Vector3;
        get died(): boolean;
        reset(): void;
    }

    Hierarchy (View Summary)

    Index
    age: number

    Age of the particle.

    angularVelocity?: number | Quaternion

    How fast the particle is turning, as the behavior that turns it last left it: a rate in radians per second for a particle that rotates by an angle, or one simulation step's turn for one that rotates by quaternion.

    Written by the turning behaviors and read by the renderer, which draws between simulation steps and has no other way to continue the turn.

    animatedVelocity?: Vector3

    The velocity of the motion a behavior gave the particle this step by moving its position directly (Unity's animatedVelocity, which Velocity over Lifetime writes), when the implementation keeps it: only while a renderer draws from it. A behavior that moves the position adds the velocity of that move here; a stretched billboard is drawn along the velocity plus this.

    color: Vector4

    Color of the particle.

    emissionState?: EmissionState

    Emission state of the particle.

    life: number

    Life duration of the particle.

    the memory of the particle.

    parentMatrix?: Matrix4

    Parent matrix for transformation.

    position: Vector3

    Position of the particle.

    previousPosition?: Vector3

    Where the particle was when the current simulation step began, when the implementation keeps it. A renderer draws between fixed steps and uses this to continue the motion the last step produced, whatever produced it.

    previousVelocity?: Vector3

    Velocity at the start of the current step, when the implementation keeps it. A stretched billboard is drawn from its velocity, so a renderer needs this to keep the sprite's shape moving between steps as its position does.

    rotation?: number | Quaternion

    Rotation of the particle.

    rotationAxis?: Vector3 | null

    The axis, in the particle's own axes, that a number rotation turns a mesh particle about: its start rotation and RotationOverLife's turn (Unity's axisOfRotation). Unset or null is +Z. A unit vector; the spawner sets it per particle when the system asks for it.

    serial?: number

    Counts the particles this object has held, when the implementation reuses particle objects: the system bumps it at every spawn. Something that keeps a reference to a particle, such as a sub emission following its parent, compares it to tell the particle it saw from a later one that took over the same object.

    size: Vector3

    Size of the particle.

    speedModifier: number

    Speed modifier of the particle.

    startColor: Vector4

    Initial color of the particle.

    startSize: Vector3

    Initial size of the particle.

    startSpeed: number

    Initial speed of the particle.

    uvTile: number

    UV tile index.

    velocity: Vector3

    Velocity of the particle.

    • get died(): boolean

      Indicates if the particle has died.

      Returns boolean

    • Clears the per-particle state (generator memory, a trail's history) before the particle is reused.

      Returns void