Optionalproperties: Record<string, unknown>OptionalhasOptionalindexOptionaltargetAn emitter's parent is the System it was added to (a particle's parent is
its emitter, hence the inherited parent field is narrowed here).
Assigns this node's tree-path id and recurses into its children, so the whole subtree gets stable addresses (e.g. "0", "0/children/1"). Called by System.addEmitter with the emitter's array index as the root path. Enforces the hard depth cap here — the single choke point both the JSON and code paths flow through — throwing on an over-deep tree rather than leaking at runtime.
Cold path: builds a fresh instance of this node. Config (initializers, behaviours, child templates) is shared by reference — it is read-only during simulation — while all mutable runtime state is per-instance. The instance gets its own Rate over the template's immutable Spans so interval counters don't collide across the many instances of one node.
Handles the child instances riding a particle that has just died: each is
either detached (its particles live on, per detach) or killed with it.
Runs before the particle is reset so the mapping key is still valid.
Clears an instance's runtime state so a pooled instance is indistinguishable
from a cold one. Deliberately does NOT touch the shared config arrays (that
would mutate the template every other instance reads) — only per-instance
mutable fields. totalEmitTimes/life are restored from the template since
generate decrements them as the instance runs.
Spawns a child instance of every child node, bound to a just-created parent
particle, and snapshots the parent transform for onCreate inheritance. The
System owns the acquire (cap + accounting); a null return means the cap was
hit and this child is dropped.
Bursts every death-trigger child node at a particle that has just died: the
instance is placed at the death position and released as a free-running,
still-emitting detached instance, so its one-shot burst outlives the parent.
Runs before the particle is reset (its position is still valid).
Advances the child instances riding each still-live particle, after this emitter's own particles have moved this frame (topological order: a parent resolves before its children read its transform). Recurses via inst.update.
Warm-or-cold acquire of an instance of this node bound to parentParticle.
Pops the free-list when possible (no allocation on the warm path), otherwise
builds one. The instance is reseeded from the parent's id so its stream is
deterministic. Call on the template node; the returned instance carries a
_template back-reference for release.
Nests a child emitter template under this one. The child is instanced once per particle this emitter spawns. Node ids are (re)assigned when the root is added to a System, so children may be attached in any order beforehand.
Adds a particle initializer to the emitter.
Adds multiple particle initializers to the emitter.
Adds the event listener for the EMITTER_DEAD event.
Creates a particle by retreiving one from the pool and setting it up with the supplied initializer and behaviour.
Kills the emitter.
Proxy method for the internal event dispatcher's dispatchEvent method.
Sets the total number of times the emitter should emit particles as well as the emitter's life. Also intializes the emitter rate. This enables the emitter to emit particles.
Experimental emit method that is designed to be called from the System.emit method.
Generates new particles.
Gets the particle's current direction.
Runs the integration algorithm on the emitter and all particles.
Returns an instance to this node's free-list for reuse. Callers must ensure the instance has no live particles first (the System's release path only releases once a detached instance has drained).
Removes all behaviours from the emitter.
Removes all behaviours from the emitter.
Removes all initializers.
Kills all of the emitter's particles.
Removes the behaviour from the emitter's behaviours array.
Removes the behaviour from the emitter's behaviours array.
Removes an initializer from the emitter's initializers array.
Re-derives this emitter's seed (and particle stream) from the system seed and its index. Called by System.addEmitter / setSeed so that emitters loaded in the same order produce the same streams across runs.
Derives a child instance's seed from its node's tree-path address and the
parent particle's (stable, deterministic) id, so a given parent always
produces the same child stream. Mirrors reseed but keyed on identity
rather than array index (a child instance has no fixed index).
Resets the particle's default properties and clears its position, velocity, acceleration, color and rotation.
Sets the emitter's particle initializers.
Sets the life of the emitter.
Sets the position of the emitter.
Sets the rotation of the emitter.
Sets the total emit times for the emitter.
Sets up a particle by running all initializers on it and setting its behaviours. Also adds the particle to this.particles.
Optionalindex: numberStops the emitter from emitting particles.
Updates the emitter according to the time passed by calling the generate and integrate methods.
Updates the emitter's emitter behaviours.
Emitters are the System engine's particle factories. They cause particles to be rendered by emitting them, and store all particle initializers and behaviours.