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

◆ init()

void fl::WaveSimulation1D::init ( uint32_t length,
SuperSample factor,
float speed,
int dampening )

Definition at line 227 of file wave_simulation.cpp.

228 {
230 mMultiplier = static_cast<uint32_t>(factor);
231 mSim.reset(); // clear out memory first.
232 mSim.reset(
233 new WaveSimulation1D_Real(length * mMultiplier, speed, dampening));
234 // Extra updates (frames) are applied because the simulation slows down in
235 // proportion to the supersampling factor.
236 mExtraFrames = static_cast<uint8_t>(factor) - 1;
237}
UISlider speed("Speed", 1.0f, -20.0f, 20.0f, 0.01f)
UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
fl::scoped_ptr< WaveSimulation1D_Real > mSim
UISlider length("Length", 1.0f, 0.0f, 1.0f, 0.01f)

References dampening, length(), mExtraFrames, mMultiplier, mOuterLength, mSim, and speed.

Referenced by WaveSimulation1D(), and setSuperSample().

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