16 template <Arithmetic T>
19 return std::clamp(
value,
T(0),
T(1));
22 template <std::
floating_po
int T>
31 if (!std::isfinite(
from) || !std::isfinite(
to) ||
50 std::max({std::abs(
from), std::abs(
to), std::abs(
value)});
64 return std::isfinite(
result) ? std::optional<T>(
result) : std::nullopt;
67 template <std::
floating_po
int T>
75 template <std::
floating_po
int T>
80 return t *
t * (
T(3) -
T(2) *
t);
83 template <std::
floating_po
int T>
89 return t *
t *
t * (
t * (
t *
T(6) -
T(15)) +
T(10));
std::optional< T > TryInverseLerp(T from, T to, T value) noexcept
std::optional< T > TryInverseLerpClamped(T from, T to, T value) noexcept
constexpr T SmootherStep(T amount) noexcept
constexpr T SmoothStep(T amount) noexcept
constexpr T Saturate(T value) noexcept