15#include "../../Utils/Math/Mathematics.h"
16#include "../../Utils/Filter/RunningAverageFilter.h"
46 float Calculate(
float velocity,
unsigned long currentMillis);
54 float Calculate(
float velocity,
float dT);
Simulates bouncing physics with gravity and velocity damping.
float velocityRatio
Ratio to control velocity damping.
float currentVelocity
Current velocity of the object.
float Calculate(float velocity, unsigned long currentMillis)
Calculates the new position and velocity based on the current velocity and time.
RunningAverageFilter< 10 > velocityFilter
Filter to smooth out velocity fluctuations.
float gravity
Gravity constant affecting the motion.
float currentPosition
Current position of the object.
unsigned long previousMillis
Stores the last timestamp for time-based calculations.
float previousVelocity
Tracks the velocity from the previous update.
Smooths data values using a weighted running average.