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

◆ WaveSimulation1D_Real()

fl::WaveSimulation1D_Real::WaveSimulation1D_Real ( u32 length,
float speed = 0.16f,
int dampening = 6 )

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

58 : length(len),
59 grid1(length + 2), // Initialize vector with correct size
60 grid2(length + 2), // Initialize vector with correct size
61 whichGrid(0),
62 // CFL stability bound for the explicit leapfrog 5-point stencil in 1D
63 // is C^2 <= 1. Negative speed has no physical meaning. Clamp at the
64 // boundary to keep the Q15 fixed-point kernel both stable and within
65 // i32 overflow margins (paired with the i64 promote in update()).
66 mCourantSq(wave_detail::float_to_fixed(fl::clamp(courantSq, 0.0f, 1.0f))),
69 // Additional initialization can be added here if needed.
70}
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, length, mCourantSq, mDampDecayQ15, mDampenening, and whichGrid.

+ Here is the call graph for this function: