TurbulenceModule class Particles

Advects particles through a curl-noise field, the divergence-free swirl that gives fire, smoke, and drifting embers their turbulent motion.

Each step samples noiseCurl3 at the particle's position (scaled by frequency, with the field scrolled by scroll per second) and adds curl * strength * dt to its velocity. Larger frequency gives smaller, busier eddies; scroll drifts the whole field (an upward scroll makes rising flames lick).

Inheritance

Constructors

TurbulenceModule({double strength = 1.0, double frequency = 1.0, Vector3? scroll, int seed = 1337})
Creates a curl-noise force.

Properties

frequency double
Spatial scale applied to particle positions before sampling.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
scroll → Vector3
How fast the noise field itself drifts, in world units per second (applied in field space after frequency scaling of time).
final
seed int
The curl field's seed; emitters with different seeds swirl differently.
final
strength double
Velocity change per second at unit curl magnitude.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
spawn(ParticleStorage storage, int index) → void
Initializes the freshly spawned particle at index.
inherited
toString() String
A string representation of this object.
inherited
update(ParticleStorage storage, double dt) → void
Advances every live particle by dt seconds.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited