FastLED 3.9.15
Loading...
Searching...
No Matches

◆ spawn() [1/2]

void fl::Particles1d::Particle::spawn ( float pos,
float baseVel,
CHSV baseColor,
u32 lifetime )

Spawn with specific parameters.

Parameters
posInitial position
baseVelBase velocity (positive = forward, negative = backward)
baseColorInitial HSV color
lifetimeLifespan in milliseconds

Definition at line 106 of file particles.cpp.hpp.

106 {
107 this->pos = pos;
108 this->baseVel = baseVel;
109 this->baseColor = baseColor;
110 this->lifetime = lifetime;
111 this->birthTime = fl::millis();
112 this->active = true;
113}
fl::u32 millis()
Universal millisecond timer - returns milliseconds since system startup.
CHSV baseColor
Base color (HSV) - saturation increases with age.
Definition particles.h:105
bool active
Active flag (false = available for reuse)
Definition particles.h:108
float pos
Position (floating point for sub-pixel rendering)
Definition particles.h:103
float baseVel
Base velocity (actual velocity = baseVel × power)
Definition particles.h:104
u32 lifetime
Lifespan in milliseconds.
Definition particles.h:107
u32 birthTime
Spawn timestamp (ms)
Definition particles.h:106

References active, baseColor, baseVel, birthTime, lifetime, fl::millis(), and pos.

+ Here is the call graph for this function: