diff --git a/include/blah/numerics/spatial.h b/include/blah/numerics/spatial.h index c62073b..1787e73 100644 --- a/include/blah/numerics/spatial.h +++ b/include/blah/numerics/spatial.h @@ -588,7 +588,8 @@ namespace Blah template Vec3 Vec3::normal() const { - return Vec3(x, y, z) / length(); + T len = length(); + return Vec3(x / len, y / len, z / len); } template @@ -1307,4 +1308,4 @@ namespace Blah return m; } -} \ No newline at end of file +}