Detaches a child instance from its (dead or absent) parent: it keeps updating
so its already-emitted particles live out their lives, then is released once
drained (see _updateDetached). Used by the detach orphan policy
(stopEmitting true) and by death-trigger event bursts, which stay
emitting so their one-shot burst fires after detachment (stopEmitting
false — their own totalEmitTimes/life then bounds emission).
Kills a child instance with its parent (the kill policy): recursively kills
its own descendants, expires its particles (dispatching PARTICLE_DEAD so
renderers free them), then releases it immediately.
Advances detached instances (parents already dead) and releases each once it has fully drained. Runs after the emitter walk so freshly-detached instances still tick this frame. Flushes SYSTEM_UPDATE if any still hold particles so renderer buffers pick up their movement.
Adds an emitter to the System instance. Dispatches the EMITTER_ADDED event.
Adds a renderer to the System instance and initializes it.
Destroys all emitters, renderers and the Nebula pool.
Proxy method for the internal event dispatcher's dispatchEvent method.
Wires up life cycle methods and causes a system's emitters to emit particles.
Gets a count of the total number of particles in the system.
Releases a child emitter instance back to its node's free-list and updates the live count. The caller guarantees the instance has drained its particles.
Removes an emitter from the System instance. Dispatches the EMITTER_REMOVED event.
Removes a renderer from the System instance.
Sets the system seed and re-derives every attached emitter's stream, so the whole system becomes reproducible from this seed. Call before emitting for fully deterministic output.
Acquires a child emitter instance of node bound to parentParticle,
honouring the global live-instance cap. On overflow the newest spawn is
dropped (the right default for FX) and a one-time warning is logged so the
cap is never hit silently. Returns the instance, or null when dropped.
Advances the simulation by the real elapsed time realDt (seconds),
consuming it in fixed fixedTimeStep increments (Stage 3 — the fixed-timestep
accumulator). Drive this from a requestAnimationFrame loop for playback that
is independent of the display's refresh rate; calling update() once per
frame instead ties simulation speed to how often it's called (2x on a 120Hz
display). Sub-steps are clamped to maxSubSteps per call so a long stall
(e.g. a backgrounded tab) can't spiral — excess time is dropped.
This is the real-time driver, not a replacement for update: deterministic
stepping (headless render, seek, tests) should keep calling update(), which
remains the single-fixed-step primitive.
Updates the particle system based on the delta passed.
StaticfromCreates a System instance from a JSON object.
StaticfromLoads a System instance from JSON asynchronously. Ensures all textures are fully loaded before resolving with the instantiated System instance.
Optionaloptions: FromJSONAsyncOptions
The core of the three-system particle engine. A System instance can contain multiple emitters, each with their own initializers and behaviours.