- Parameters
-
| now | The current time in milliseconds. Fx writers are encouraged to use this instead of millis() directly as this will more deterministic behavior. |
Implements fl::Fx.
Definition at line 97 of file luminova.cpp.hpp.
97 {
98
102
103
105 size_t idx =
static_cast<size_t>(
mTick %
static_cast<fl::u32
>(
mParticles.size()));
107 }
108
109
110 for (
size_t i = 0; i <
mParticles.size(); ++i) {
112 if (!p.alive) {
113 continue;
114 }
115
116
117 p.s *= 0.997f;
118 if (p.s < 0.5f) {
119 p.alive = false;
120 continue;
121 }
122
123
124 float tOver99 =
static_cast<float>(
mTick) / 99.0f;
125 u8 n2 =
inoise8(
static_cast<u16
>(tOver99 * 4096.0f),
static_cast<u16
>(p.g * 37));
126 float n2c = (static_cast<int>(n2) - 128) / 255.0f;
127 p.a += (n2c) / 9.0f;
128
129 float aa = p.a * static_cast<float>(p.f);
132
134 }
135
137}
u16 getWidth() const FL_NO_EXCEPT
u16 getHeight() const FL_NO_EXCEPT
void resetParticle(Particle &p, fl::u32 tick) FL_NO_EXCEPT
void plotSoftDot(fl::span< CRGB > leds, float fx, float fy, float s) const FL_NO_EXCEPT
fl::vector< Particle > mParticles
fl::u8 inoise8(fl::u16 x, fl::u16 y, fl::u16 z) FL_NO_EXCEPT
void blur2d(fl::span< CRGB > leds, u8 width, u8 height, fract8 blur_amount, const XYMap &xymap) FL_NO_EXCEPT
float sinf(float value) FL_NO_EXCEPT
void fadeToBlackBy(CRGB *leds, fl::u16 num_leds, fl::u8 fadeBy) FL_NO_EXCEPT
float cosf(float value) FL_NO_EXCEPT
References fl::Luminova::Particle::a, fl::Luminova::Particle::alive, fl::blur2d(), fl::cosf(), fl::Luminova::Particle::f, fl::fadeToBlackBy(), fl::FL_NO_EXCEPT, fl::Luminova::Particle::g, fl::Fx2d::getHeight(), fl::Fx2d::getWidth(), inoise8(), mParams, mParticles, mTick, fl::Fx2d::mXyMap, plotSoftDot(), resetParticle(), fl::Luminova::Particle::s, fl::sinf(), fl::Luminova::Particle::x, and fl::Luminova::Particle::y.