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

    Class LimitSpeedOverLife

    Limits the speed of particles over their life, like Unity's Limit Velocity over Lifetime: a particle faster than speed loses part of the excess each step. As in Unity, the emitter's scale does not change the limit of a world-space system; a local-space system's limit is in the emitter's frame, which the scale scales.

    With a Vector3Function as speed it is Unity's Separate Axes: each component of the velocity, measured along the axes of space, is limited by its own curve and keeps its sign. Applies in every render mode.

    Implements

    Index
    • Parameters

      • speed: ValueGenerator | FunctionValueGenerator | Vector3Function

        The speed limit over the particle's life: one curve for the speed, or a Vector3Function with a limit for each axis (Unity's Separate Axes).

      • dampen: number

        How much of the excess speed goes, from 0 (none) to 1, clamped, as Unity's Dampen: dampen of it in each 1/30 s, compounded over other step lengths so the result does not depend on the frame rate. At 1 the speed is held at the limit.

      • Optionalspace: BehaviorSpace

        The axes per-axis limits are measured along, as Unity's Space setting: the emitter's own ('local', the default), which turn and scale with it, or the world's. A single speed limit has no axes and ignores it.

      Returns LimitSpeedOverLife

    _frame: EmitterFrame

    The emitter's transform this frame, refreshed by frameUpdate for per-axis limits.

    dampen: number

    How much of the excess speed goes, from 0 (none) to 1, clamped, as Unity's Dampen: dampen of it in each 1/30 s, compounded over other step lengths so the result does not depend on the frame rate. At 1 the speed is held at the limit.

    Learned in initialize; its space decides whether per-axis limits are converted.

    The axes per-axis limits are measured along, as Unity's Space setting: the emitter's own ('local', the default), which turn and scale with it, or the world's. A single speed limit has no axes and ignores it.

    The speed limit over the particle's life: one curve for the speed, or a Vector3Function with a limit for each axis (Unity's Separate Axes).

    type: string

    The name the behavior is registered under in BehaviorTypes.

    • A copy with the same settings that shares nothing mutable with this one.

      Returns Behavior

    • The share of the excess speed one step of delta seconds removes; see dampen.

      Parameters

      • delta: number

      Returns number

    • Called once per step before this behavior updates the particles, with the step's length in seconds.

      Parameters

      • delta: number

      Returns void

    • Called once per particle when it is emitted; see the interface's description for when.

      Parameters

      Returns void

    • Called when the system restarts (not when a looping system starts its next loop): forget state accumulated across steps, so the replay starts as the first play did.

      Returns void

    • Called once per live particle per step, with the step's length in seconds.

      Parameters

      Returns void

    • Optional bulk form of update, applied to particles[0..count).

      The per-particle update is reached through one call site shared by every behavior type, which leaves it megamorphic: V8 can neither inline it nor specialise the generator calls inside. A behavior that implements this instead gets one call per frame and a loop it owns, where those calls are monomorphic. Implementations must skip dead particles (age >= life) exactly as the per-particle path does, and must produce identical results.

      Behaviors that do not implement it keep working unchanged. A subclass that overrides update but not updateAll has its update called, not the inherited updateAll.

      Parameters

      • particles: Particle[]
      • count: number
      • delta: number

      Returns void