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

◆ WaveSimulation2D_Real() [1/2]

fl::WaveSimulation2D_Real::WaveSimulation2D_Real ( u32 W,
u32 H,
float speed = 0.16f,
float dampening = 6.0f )

Definition at line 182 of file wave_simulation_real.cpp.hpp.

184 : width(W), height(H), stride(W + 2),
185 grid1((W + 2) * (H + 2)),
186 grid2((W + 2) * (H + 2)), whichGrid(0),
187 // CFL stability bound for the explicit leapfrog 5-point stencil in 2D
188 // is C^2 <= 1/2. Negative speed has no physical meaning. Clamp at the
189 // boundary to keep the Q15 fixed-point kernel both stable and within
190 // i32 overflow margins (paired with the i64 promote in update()).
192 // Dampening exponent; e.g., 6 means a factor of 2^6 = 64.
193 mDampening(static_cast<int>(dampening)),
uint16_t speed
Definition Noise.ino:72
static const int H
Definition PerfDisc.ino:21
static const int W
Definition PerfDisc.ino:20
fl::UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
i16 compute_damp_decay_q15(int damp) FL_NO_EXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NO_EXCEPT

References fl::clamp(), fl::wave_detail::compute_damp_decay_q15(), dampening(), fl::FL_NO_EXCEPT, fl::wave_detail::float_to_fixed(), grid1, grid2, H, mCourantSq, mDampDecayQ15, mDampening, speed, stride, W, and whichGrid.

Referenced by ~WaveSimulation2D_Real().

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