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

    Class GravityForce

    Pull particles toward a point with an inverse-square force, F = magnitude / r² (Niagara's Point Attraction Force).

    center is a point in the space the system simulates in: the emitter's own space for a local-space system, the world for a world-space one. A particle exactly on the centre is left alone rather than given an infinite pull. Applies in every render mode.

    Implements

    Index
    • Parameters

      • center: Vector3Like

        The point pulled toward, in the simulation space.

      • magnitude: number

        Strength of the pull at distance 1, in units per second squared.

      Returns GravityForce

    magnitude: number

    Strength of the pull at distance 1, in units per second squared.

    type: string

    The name the behavior is registered under in BehaviorTypes.

    • get center(): Vector3

      The point pulled toward, in the simulation space. Set it from any Vector3Like, such as a Babylon Vector3; the value is copied.

      Returns Vector3

    • set center(value: Vector3Like): void

      The point pulled toward, in the simulation space. 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 GravityForceJSON

    • 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