FastLED 3.10.6
Loading...
Searching...
No Matches

◆ addf()

void fl::WaveFx::addf ( size_t x,
size_t y,
float value )
inline

Add wave amplitude to existing value at a position.

Parameters
xX coordinate in grid space
yY coordinate in grid space
valueWave amplitude to add (clamped to max 1.0)

Adds to existing wave amplitude, useful for creating multiple overlapping disturbances. Result is clamped to maximum of 1.0.

Definition at line 336 of file wave.h.

336 {
337 // Add a value at the given coordinates in the wave simulation.
338 float sum = value + mWaveSim.getf(x, y);
339 mWaveSim.setf(x, y, fl::min(1.0f, sum));
340 }
WaveSimulation2D mWaveSim
Definition wave.h:416
constexpr int type_rank< T >::value
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NO_EXCEPT
Definition math.h:71

References fl::min(), mWaveSim, fl::type_rank< T >::value, fl::x, and fl::y.

+ Here is the call graph for this function: