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

◆ init()

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

Definition at line 42 of file wave_simulation.cpp.

43 {
44 mOuterWidth = width;
45 mOuterHeight = height;
46 mMultiplier = static_cast<u32>(factor);
47 mSim.reset(); // clear out memory first.
48 u32 w = width * mMultiplier;
49 u32 h = height * mMultiplier;
50 mSim.reset(new WaveSimulation2D_Real(w, h, speed, dampening));
51 mChangeGrid.reset(w, h);
52 // Extra frames are needed because the simulation slows down in
53 // proportion to the supersampling factor.
54 mExtraFrames = u8(factor) - 1;
55}
uint16_t speed
Definition Noise.ino:63
fl::Grid< i16 > mChangeGrid
fl::unique_ptr< WaveSimulation2D_Real > mSim
UISlider dampening("Dampening", 6.0f, 0.0f, 10.0f, 0.1f)
unsigned char u8
Definition int.h:17

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

Referenced by WaveSimulation2D(), and setSuperSample().

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