13#include "../Math/Mathematics.h"
A class to generate various waveform functions with customizable parameters.
float SquareWave(float ratio)
Generates a square wave value.
void SetPeriod(float period)
Sets the period of the waveform.
float SawtoothWave(float ratio)
Generates a sawtooth wave value.
float minimum
Minimum value of the waveform.
float maximum
Maximum value of the waveform.
Function
Enumerates the supported wave functions.
@ Gravity
Gravity-like function.
@ Sawtooth
Sawtooth waveform.
@ Triangle
Triangle waveform.
float GravityFunction(float ratio)
Generates a gravity-like function value.
float Update()
Updates and calculates the next value of the waveform.
Function function
Current waveform function.
float SineWave(float ratio)
Generates a sine wave value.
void SetFunction(Function function)
Sets the waveform function.
float TriangleWave(float ratio)
Generates a triangle wave value.
float period
Period of the waveform.