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

◆ setDrag()

void fl::PerlinParticlePunch::setDrag ( float drag)

Set per-frame drag for ambient particles (0.0 = instant stop, 1.0 = no drag).

Meteor drag is derived from this at a heavier ratio.

Definition at line 109 of file perlin_particle_punch.cpp.hpp.

109 {
110 mDrag = drag;
111 // Meteor drag is slightly heavier than ambient.
112 // Scale the difference from 1.0, not the value itself.
113 // drag=0.99 → meteorDrag=0.985, drag=0.80 → meteorDrag=0.74
114 float diff = 1.0f - drag;
115 mMeteorDrag = 1.0f - diff * 1.5f;
116 if (mMeteorDrag < 0.0f)
117 mMeteorDrag = 0.0f;
118}

References mDrag, and mMeteorDrag.

Referenced by ~PerlinParticlePunch().

+ Here is the caller graph for this function: