Fix math::smooth(er)step in case the type isn't implicitly constructible from integers

This commit is contained in:
Nikita Lisitsa 2025-08-31 14:45:52 +03:00
parent 905e98070c
commit 2cce0082cf

View file

@ -216,13 +216,13 @@ namespace psemek::math
template <typename T> template <typename T>
T smoothstep(T x) T smoothstep(T x)
{ {
return x * x * (3 - 2 * x); return x * x * (T{3} - T{2} * x);
} }
template <typename T> template <typename T>
T smootherstep(T x) T smootherstep(T x)
{ {
return x * x * x * (10 - x * (15 - 6 * x)); return x * x * x * (T{10} - x * (T{15} - T{6} * x));
} }
template <typename T> template <typename T>