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

◆ emitLissajousLine()

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

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

235 {
236 int w = (int)getWidth();
237 int h = (int)getHeight();
238 float cx = (w - 1) * 0.5f;
239 float cy = (h - 1) * 0.5f;
240 float s = mParams.endpoint_speed;
241
242 // Radii scaled from original 32x32 prototype ratios.
243 float x1 = cx + cx * 0.742f * sinf(t * s * 1.13f + 0.20f);
244 float y1 = cy + cy * 0.677f * sinf(t * s * 1.71f + 1.30f);
245 float x2 = cx + cx * 0.774f * sinf(t * s * 1.89f + 2.20f);
246 float y2 = cy + cy * 0.710f * sinf(t * s * 1.37f + 0.70f);
247
248 drawAALine(x1, y1, x2, y2, t, mParams.color_shift);
249
250 CRGB endA = rainbow(t, mParams.color_shift, 0.0f);
251 CRGB endB = rainbow(t, mParams.color_shift, 0.5f);
252 float discDiam = 1.7f;
253 drawDot(x1, y1, discDiam, endA.r, endA.g, endA.b);
254 drawDot(x2, y2, discDiam, endB.r, endB.g, endB.b);
255}
void rainbow()
Params mParams
Definition flowfield.h:286
void drawAALine(float x0, float y0, float x1, float y1, float t, float colorShift)
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
fl::CRGB CRGB
Definition video.h:15
float sinf(float value) FL_NOEXCEPT
Definition math.h:352

References drawAALine(), drawDot(), fl::Fx2d::getHeight(), fl::Fx2d::getWidth(), 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: