116 void spawn(u16 numLeds);
126 void update(u32 now, u16 numLeds,
float speedMultiplier,
bool cyclical);
~Particles1d() FL_NOEXCEPT
void setSpeed(float speed)
Set speed multiplier (1.0 = normal, >1.0 = faster, <1.0 = slower)
fl::vector< Particle > mParticles
Particle pool (oldest particle reused when full)
void setCyclical(bool cyclical)
Set cyclical mode (true = wrap around, false = stop at edges)
u8 mFadeRate
Fade amount per frame (0-255, higher = shorter trails)
Particles1d(u16 num_leds, u8 max_particles=10, u8 fade_rate=2)
void setFadeRate(u8 fade_rate)
Set fade rate for trails (0-255, higher = shorter trails)
u8 mOverdrawCount
Number of update/draw cycles per frame (higher = smoother trails, more CPU)
u16 mLifetimeMs
Average particle lifetime in milliseconds.
void setOverdrawCount(u8 count)
Set overdraw count (higher = smoother trails, more CPU)
float mSpeedMultiplier
Global speed multiplier (1.0 = normal, >1.0 = faster, <1.0 = slower)
bool mCyclical
Wrap mode: true = wrap around, false = stop at edges.
void spawnRandomParticle()
Spawn a particle with random position, velocity, color, and lifetime.
fl::string fxName() const override
void draw(DrawContext context) override
Update and render all particles with overdraw technique.
void setLifetime(u16 lifetime_ms)
Set average particle lifetime in milliseconds.
Power-based particle system for 1D LED strips creating organic light effects.
Base definition for an LED controller.
#define FASTLED_SHARED_PTR(type)
Representation of an 8-bit RGB pixel (Red, Green, Blue)
void draw(fl::span< CRGB > leds, u32 now, u16 numLeds)
Render particle with sub-pixel accuracy and power-modulated color.
CHSV baseColor
Base color (HSV) - saturation increases with age.
void update(u32 now, u16 numLeds, float speedMultiplier, bool cyclical)
Update position based on velocity × power.
void spawn(u16 numLeds)
Spawn with random position, velocity, color, and lifetime.
float getPower(u32 now) const
bool active
Active flag (false = available for reuse)
float pos
Position (floating point for sub-pixel rendering)
float baseVel
Base velocity (actual velocity = baseVel × power)
u32 lifetime
Lifespan in milliseconds.
u32 birthTime
Spawn timestamp (ms)
Individual particle with power-based lifecycle.