From 2cce0082cf45259d9144d5951e1e9bf9b1f840b8 Mon Sep 17 00:00:00 2001 From: lisyarus Date: Sun, 31 Aug 2025 14:45:52 +0300 Subject: [PATCH] Fix math::smooth(er)step in case the type isn't implicitly constructible from integers --- libs/math/include/psemek/math/math.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/math/include/psemek/math/math.hpp b/libs/math/include/psemek/math/math.hpp index f3e598ea..19e11e24 100644 --- a/libs/math/include/psemek/math/math.hpp +++ b/libs/math/include/psemek/math/math.hpp @@ -216,13 +216,13 @@ namespace psemek::math template T smoothstep(T x) { - return x * x * (3 - 2 * x); + return x * x * (T{3} - T{2} * x); } template 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