The name the behavior is registered under in BehaviorTypes.
A copy with the same settings that shares nothing mutable with this one.
Called once per step before this behavior updates the particles, with the step's length in seconds.
Called once per particle when it is emitted; see the interface's description for when.
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.
The behavior's settings as plain data, with its type; see the interface's description.
Called once per live particle per step, with the step's length in seconds.
OptionalupdateOptional 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.
A behavior changes particles over time; a particle system runs a list of them every simulation step. Each method is called by the host (the system that owns the behavior), in this order:
particleSystemis the system it belongs to. A behavior that reads a per-particle random sample starts its generators onparticle.memoryhere.ageis the age at the start of the step; the host addsdeltaand integrates the velocity after every behavior has run. Over-life curves are read at the age the step ends at,stepEndAge(orstepEndLifeas a fraction of the life), the age the particle is drawn at, as Unity reads them.Randomness is drawn through
random()fromquarks.core'sutil/random, neverMath.random, so a host that runs its steps insidesetRandomSource(orwithRandomSource) with a seeded generator replays the same effect, as babylon.quarks does for a system with aseed. Any other state a behavior keeps must be derived from its settings, so aclone()or a saved and reloaded copy behaves the same.toJSON writes the behavior's settings as plain data, the
typeand every field (a few leave out a zero or empty value);BehaviorTypes[type].loadJSONreads it back, and reads a missing field as its default. An effect file holds BehaviorToJSON, which leaves out the fields at their defaults. Theparamsof that entry list the fields an editor shows.