FastLED 3.9.15
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 307 of file wave.h.

307 {
308 // Add a value at the given coordinates in the wave simulation.
309 float sum = value + mWaveSim.getf(x, y);
310 mWaveSim.setf(x, y, fl::min(1.0f, sum));
311 }
WaveSimulation2D mWaveSim
Definition wave.h:376
FL_DISABLE_WARNING_PUSH U constexpr common_type_t< T, U > min(T a, U b) FL_NOEXCEPT
Definition math.h:71
constexpr int type_rank< T >::value

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

+ Here is the call graph for this function: