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

◆ WaveSimulation2D_Real()

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:66
static const int H
Definition PerfDisc.ino:20
static const int W
Definition PerfDisc.ino:19
fl::vector_psram< i16 > grid1
fl::vector_psram< i16 > grid2
fl::UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
i16 compute_damp_decay_q15(int damp) FL_NOEXCEPT
constexpr enable_if< is_fixed_point< T >::value, T >::type clamp(T x, T lo, T hi) FL_NOEXCEPT

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

+ Here is the call graph for this function: