29 #ifndef DOXYGEN_SHOULD_SKIP_THIS
37 constexpr float Pi = 3.14159265358979323846f;
55 constexpr float Sqrt2 = 1.41421356237309504880f;
88 using Step = T (*)(T);
122 return (-2 * t + 3) * t * t;
145 return ((6 * t - 15) * t + 10) * t * t * t;
159 return (1 - std::cos(
Pi * t)) * 0.5;
175 template<
typename T,
typename U>
178 return (1 - t) * lhs + t * rhs;
196 return val < lo ? lo : (val > hi ? hi : val);
214 #ifndef DOXYGEN_SHOULD_SKIP_THIS
constexpr float Pi2
The constant.
Definition: Math.h:43
constexpr float InvSqrt2
The constant.
Definition: Math.h:61
T lerp(T lhs, T rhs, U t)
Linear interpolation function.
Definition: Math.h:177
constexpr T square(T val)
Square function.
Definition: Math.h:210
constexpr T clamp(T val, T lo, T hi)
Clamping function.
Definition: Math.h:195
constexpr float Sqrt2
The constant.
Definition: Math.h:55
constexpr T cubicStep(T t)
Cubic step (smoothstep)
Definition: Math.h:121
T cosineStep(T t)
Cosine step.
Definition: Math.h:158
constexpr float Pi
The constant.
Definition: Math.h:37
constexpr T linearStep(T t)
Linear step.
Definition: Math.h:100
constexpr T quinticStep(T t)
Quintic step (smootherstep)
Definition: Math.h:144
constexpr float Pi4
The constant.
Definition: Math.h:49