13inline float Lerp(
float a,
float b,
float t)
noexcept {
14 return a + t * (b - a);
17inline float Clamp(
float x,
float minVal,
float maxVal)
noexcept {
18 if (x < minVal)
return minVal;
19 if (x > maxVal)
return maxVal;
23inline float EaseIn(
float t)
noexcept {
24 t =
Clamp(t, 0.0f, 1.0f);
28 t =
Clamp(t, 0.0f, 1.0f);
29 return 2.0 * t - t * t;
48template<
int Levels = 10>
50 constexpr float step = 1.0f / (Levels);
51 int bucket = (int)(v / step);
float EaseInOut(float t) noexcept
Definition Smoothing.hpp:32
float InterpolateEaseInOut(float a, float b, float t) noexcept
Definition Smoothing.hpp:36
float EaseIn(float t) noexcept
Definition Smoothing.hpp:23
float EaseOut(float t) noexcept
Definition Smoothing.hpp:27
float Lerp(float a, float b, float t) noexcept
Definition Smoothing.hpp:13
float Quantize(float v)
Quantize a float value into discrete levels, useful for stylized effects.
Definition Smoothing.hpp:49
float Clamp(float x, float minVal, float maxVal) noexcept
Definition Smoothing.hpp:17