MCPcopy Create free account
hub / github.com/FastLED/FastLED / draw

Method draw

src/fl/fx/2d/flowfield.cpp.hpp:21–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

19 mNoiseBias(xyMap.getWidth(), xyMap.getHeight(), 0.01f, 0.5f) {}
20
21void FlowField::draw(DrawContext context) {
22 u32 t_ms = mTimeWarp.update(context.now);
23 u32 dt_ms = t_ms - mLastWarpedMs;
24 mLastWarpedMs = t_ms;
25 // Cap dt to prevent huge jumps when effect was inactive (mode switch).
26 if (dt_ms > 500) {
27 dt_ms = 0;
28 }
29 mNoiseBias.update(dt_ms * 0.001f);
30 drawImpl(context, dt_ms, t_ms);
31}
32
33void FlowField::noisePunch(float amplitude, BumpShape shape) {
34 float cx = getWidth() * 0.5f;

Callers 1

drawFlowVectorsMethod · 0.45

Calls 1

updateMethod · 0.45

Tested by

no test coverage detected