diff --git a/math/vec.hpp b/math/vec.hpp index 930fe10..279f454 100644 --- a/math/vec.hpp +++ b/math/vec.hpp @@ -18,7 +18,8 @@ inline constexpr T magnitude_squared(vec const& v) template inline constexpr vec<3, T> normalize(vec const& v) { - return v / magnitude(v); + T d = 1.0f / magnitude(v); + return v * d; } template