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

    Class Noise

    Jitter particles with smooth noise over their life (Unity's Noise module).

    Each particle reads its own one-dimensional simplex curves at its age times frequency; power scales what they return, positionAmount and rotationAmount say how much of it goes into the position and the rotation. The offset applied last step is removed before this step's is added, so the noise rides on top of the other behaviors instead of accumulating. A billboard's angle turns by W noise × π × amount; a mesh particle turns by the same angle around an axis the X, Y and Z noise choose. The generators are picked per particle from the random source, so a seeded system (see the Behavior contract) replays the same noise. Applies in every render mode.

    Each particle jitters on its own here; for a field that pushes nearby particles alike, so the system swirls, use TurbulenceField.

    Implements

    Index

    Reshapes the raw noise (Unity's Remap): the curve is read at the noise value mapped from [-1, 1] to [0, 1], and what it returns is used in its place. Unset, the noise is used as is.

    How fast the noise field moves past the particles (Unity's Scroll Speed), in noise time per second; 0 leaves it still. Sampled once per frame, so a curve is read at t = 0.

    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

    • 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 NoiseJSON

    • 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