From ae6a2f12d431d8b755ba0c9449d5d54771d044c0 Mon Sep 17 00:00:00 2001 From: Noel Berry Date: Tue, 1 Feb 2022 19:48:01 -0800 Subject: [PATCH] fixed Vec3f::normal --- include/blah/numerics/spatial.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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 +}