FastLED 3.10.8
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 185 of file wave_simulation_real.cpp.hpp.

187 : width(W), height(H), stride(W + 2),
188 grid1((W + 2) * (H + 2)),
189 grid2((W + 2) * (H + 2)), whichGrid(0),
190 // CFL stability bound for the explicit leapfrog 5-point stencil in 2D
191 // is C^2 <= 1/2. Negative speed has no physical meaning. Clamp at the
192 // boundary to keep the Q15 fixed-point kernel both stable and within
193 // i32 overflow margins (paired with the i64 promote in update()).
195 // Dampening exponent; e.g., 6 means a factor of 2^6 = 64.
196 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 float_to_fixed(float f) FL_NO_EXCEPT
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: