Spawner class Particles
Decides how many particles to emit on each simulation step from a steady rate plus any bursts.
The rate is accumulated fractionally across steps (so a rate that emits less than one particle per step still emits on the right cadence rather than truncating to zero), and bursts fire when their scheduled time falls in the step's half-open time window.
Constructors
-
Spawner({double rate = 0.0, List<
ParticleBurst> bursts = const []}) -
Creates a spawner emitting
rateparticles per second plusbursts.
Properties
-
bursts
→ List<
ParticleBurst> -
Scheduled bursts, fired by system time.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- rate ↔ double
-
Steady emission rate in particles per second.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
emit(
double dt, double time) → int -
Returns the number of particles to emit over a step of length
dtthat starts at system timetime. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void - Clears the fractional rate accumulator (used when restarting a system).
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited