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

    Class OrbitOverLife

    Turn particles around an axis over their life, like Unity's Orbital velocity: each particle keeps its distance from the axis and sweeps around it at orbitSpeed radians per second.

    The axis and the pivot are authored in space. 'local', the default, is the emitter's: the axis is in the emitter's axes and the pivot is the emitter's origin, so in a world-space system the orbit follows the emitter and the effect looks the same whichever space the system simulates in. 'world' orbits the world origin about a world axis wherever the emitter goes (Niagara's Vortex Force with a fixed origin). The axis need not be a unit vector; only its direction matters, and a zero axis orbits nothing. Applies in every render mode. The velocity of the turn is added to the particle's animatedVelocity when it keeps one, as Unity's orbital velocity is part of its animated velocity, so a stretched billboard is drawn along it.

    For an orbit around three axes at once, with a radial speed or an offset pivot, see VelocityOverLife.

    Implements

    Index
    _axis: Vector3

    Unit axis in the simulation space, or zero for a zero axis; refreshed by frameUpdate.

    _center: Vector3

    The pivot in the simulation space; refreshed by frameUpdate.

    _frame: EmitterFrame

    The emitter's transform this frame, refreshed by frameUpdate.

    Angular speed around the axis over the particle's life, in radians per second.

    Learned in initialize, so undefined until this behavior sees a particle.

    The space the axis and the pivot are authored in; 'local' (the emitter's) by default.

    type: string

    The name the behavior is registered under in BehaviorTypes.

    • get axis(): Vector3

      The axis orbited, in space; its length is ignored. Set it from any Vector3Like, such as a Babylon Vector3; the value is copied.

      Returns Vector3

    • set axis(value: Vector3Like): void

      The axis orbited, in space; its length is ignored. Set it from any Vector3Like, such as a Babylon Vector3; the value is copied.

      Parameters

      Returns void

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

      Returns Behavior

    • 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

    • The behavior's settings as plain data, with its type; see the interface's description.

      Returns OrbitOverLifeJSON

    • 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