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

◆ triggerWaveRipple()

void triggerWaveRipple ( )

Definition at line 670 of file curr.h.

670 {
671 // Create a ripple at a random position within the central area
672 float perc = 0.15f; // 15% margin from edges
673 int width = corkscrew.cylinderWidth();
674 int height = corkscrew.cylinderHeight();
675
676 int min_x = perc * width;
677 int max_x = (1 - perc) * width;
678 int min_y = perc * height;
679 int max_y = (1 - perc) * height;
680
681 int x = random8(min_x, max_x);
682 int y = random8(min_y, max_y);
683
684 // Trigger a 2x2 wave ripple for more punch (compensates for blur reduction)
685 float ripple_strength = 1.5f; // Higher value for more impact
686 waveFx->setf(x, y, ripple_strength);
687 waveFx->setf(x + 1, y, ripple_strength);
688 waveFx->setf(x, y + 1, ripple_strength);
689 waveFx->setf(x + 1, y + 1, ripple_strength);
690
691 FL_WARN("Wave ripple triggered at (" << x << ", " << y << ") with 2x2 pattern");
692}
int y
Definition simple.h:93
int x
Definition simple.h:92
WaveFxPtr waveFx
Definition curr.h:294
Corkscrew corkscrew(CORKSCREW_TURNS, NUM_LEDS)
LIB8STATIC uint8_t random8()
Generate an 8-bit random number.
Definition random8.h:46
#define FL_WARN
Definition warn.h:12

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: