FastLED 3.10.8
Loading...
Searching...
No Matches

◆ calculate_oscillators()

void fl::calculate_oscillators ( oscillators & timings,
modulators & move,
fl::u32 current_time,
float speed_factor )
inline

Definition at line 47 of file engine_core.h.

48 {
49 double runtime = current_time * timings.master_speed * speed_factor;
50
51 for (int i = 0; i < num_oscillators; i++) {
52 move.linear[i] = (runtime + timings.offset[i]) * timings.ratio[i];
53 move.radial[i] = fl::fmodf(move.linear[i], 2.0f * static_cast<float>(PI));
54 move.directional[i] = FL_SIN_F(move.radial[i]);
55 move.noise_angle[i] = PI * (1 + pnoise(move.linear[i], 0, 0));
56 }
57}
#define PI
#define num_oscillators
Definition core_types.h:9
#define FL_SIN_F(x)
Definition engine_core.h:18
constexpr remove_reference< T >::type && move(T &&t) FL_NO_EXCEPT
Definition move.h:30
FASTLED_FORCE_INLINE float pnoise(float x, float y, float z) FL_NO_EXCEPT
float fmodf(float x, float y) FL_NO_EXCEPT
Definition math.h:344
float offset[num_oscillators]
Definition core_types.h:32
float ratio[num_oscillators]
Definition core_types.h:33

References FL_NO_EXCEPT, FL_SIN_F, fmodf(), fl::adl_barrier::move(), num_oscillators, PI, and pnoise().

Referenced by fl::Engine::calculate_oscillators(), and run_default_oscillators().

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