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

◆ triggerWaveRipple()

void triggerWaveRipple ( )

Definition at line 658 of file curr.h.

658 {
659 // Create a ripple at a random position within the central area
660 float perc = 0.15f; // 15% margin from edges
661 int width = corkscrew.cylinderWidth();
662 int height = corkscrew.cylinderHeight();
663
664 int min_x = perc * width;
665 int max_x = (1 - perc) * width;
666 int min_y = perc * height;
667 int max_y = (1 - perc) * height;
668
669 int x = random8(min_x, max_x);
670 int y = random8(min_y, max_y);
671
672 // Trigger a 2x2 wave ripple for more punch (compensates for blur reduction)
673 float ripple_strength = 1.5f; // Higher value for more impact
674 waveFx->setf(x, y, ripple_strength);
675 waveFx->setf(x + 1, y, ripple_strength);
676 waveFx->setf(x, y + 1, ripple_strength);
677 waveFx->setf(x + 1, y + 1, ripple_strength);
678
679 FL_WARN("Wave ripple triggered at (" << x << ", " << y << ") with 2x2 pattern");
680}
int y
Definition simple.h:93
int x
Definition simple.h:92
fl::WaveFxPtr waveFx
Definition curr.h:282
fl::Corkscrew corkscrew(CORKSCREW_TURNS, NUM_LEDS)
LIB8STATIC fl::u8 random8() FL_NOEXCEPT
Generate an 8-bit random number.
Definition random8.h:53
#define FL_WARN(X)
Definition log.h:276
u8 u8 height
Definition blur.h:186
u8 width
Definition blur.h:186

References corkscrew(), FL_WARN, random8(), waveFx, x, and y.

Referenced by drawWave(), and processWaveAutoTrigger().

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