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

◆ emitOrbitalDots()

void fl::FlowFieldFloat::emitOrbitalDots ( float t)
private

Definition at line 257 of file flowfield.cpp.hpp.

257 {
258 int w = (int)getWidth();
259 int h = (int)getHeight();
260 int minDim = fl::min(w, h);
261 int n = mParams.dot_count;
262 float fn = (float)n;
263 float ocx = w * 0.5f - 0.5f;
264 float ocy = h * 0.5f - 0.5f;
265 float orad = minDim * 0.35f;
266 float base = t * 3.0f;
267 float dotDiam = 1.5f;
268 for (int i = 0; i < n; i++) {
269 float a = base + i * (2.0f * FL_PI / fn);
270 float cx = ocx + cosf(a) * orad;
271 float cy = ocy + sinf(a) * orad;
272 CRGB c = rainbow(t, mParams.color_shift, (float)i / fn);
273 drawDot(cx, cy, dotDiam, c.r, c.g, c.b);
274 }
275}
void rainbow()
Params mParams
Definition flowfield.h:286
void drawDot(float cx, float cy, float diam, u8 cr, u8 cg, u8 cb)
u16 getWidth() const
Definition fx2d.h:24
u16 getHeight() const
Definition fx2d.h:23
#define FL_PI
Definition math.h:26
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Definition math.h:71
fl::CRGB CRGB
Definition video.h:15
float sinf(float value) FL_NOEXCEPT
Definition math.h:352
float cosf(float value) FL_NOEXCEPT
Definition math.h:358

References fl::cosf(), drawDot(), FL_PI, fl::Fx2d::getHeight(), fl::Fx2d::getWidth(), fl::min(), fl::FlowField::mParams, rainbow(), fl::sinf(), and fl::t.

Referenced by drawImpl().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: