FastLED 3.10.8
Loading...
Searching...
No Matches
fl::Particles1d::Particle Struct Reference

Detailed Description

Individual particle with power-based lifecycle.

Power level (1.0 → 0.0) controls velocity, saturation, and brightness. Uses floating-point position for sub-pixel rendering smoothness.

Definition at line 102 of file particles.h.

+ Collaboration diagram for fl::Particles1d::Particle:

Public Member Functions

 Particle () FL_NO_EXCEPT
 
void draw (fl::span< CRGB > leds, u32 now, u16 numLeds) FL_NO_EXCEPT
 Render particle with sub-pixel accuracy and power-modulated color.
 
float getPower (u32 now) const FL_NO_EXCEPT
 
void spawn (float pos, float baseVel, CHSV baseColor, u32 lifetime) FL_NO_EXCEPT
 Spawn with specific parameters.
 
void spawn (u16 numLeds) FL_NO_EXCEPT
 Spawn with random position, velocity, color, and lifetime.
 
void update (u32 now, u16 numLeds, float speedMultiplier, bool cyclical) FL_NO_EXCEPT
 Update position based on velocity × power.
 

Public Attributes

bool active
 Active flag (false = available for reuse)
 
CHSV baseColor
 Base color (HSV) - saturation increases with age.
 
float baseVel
 Base velocity (actual velocity = baseVel × power)
 
u32 birthTime
 Spawn timestamp (ms)
 
u32 lifetime
 Lifespan in milliseconds.
 
float pos
 Position (floating point for sub-pixel rendering)
 

The documentation for this struct was generated from the following files: