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

◆ init()

void fl::WaveSimulation2D::init ( uint32_t width,
uint32_t height,
SuperSample factor,
float speed,
int dampening )

Definition at line 41 of file wave_simulation.cpp.

42 {
43 mOuterWidth = width;
44 mOuterHeight = height;
45 mMultiplier = static_cast<uint32_t>(factor);
46 mSim.reset(); // clear out memory first.
47 uint32_t w = width * mMultiplier;
48 uint32_t h = height * mMultiplier;
49 mSim.reset(new WaveSimulation2D_Real(w, h, speed, dampening));
50 mChangeGrid.reset(w, h);
51 // Extra frames are needed because the simulation slows down in
52 // proportion to the supersampling factor.
53 mExtraFrames = uint8_t(factor) - 1;
54}
UISlider speed("Speed", 1.0f, -20.0f, 20.0f, 0.01f)
UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
fl::Grid< int16_t > mChangeGrid
fl::scoped_ptr< WaveSimulation2D_Real > mSim

References dampening, mChangeGrid, mExtraFrames, mMultiplier, mOuterHeight, mOuterWidth, mSim, and speed.

Referenced by WaveSimulation2D(), and setSuperSample().

+ Here is the caller graph for this function: