mirror of
https://github.com/NoelFB/blah.git
synced 2026-10-18 18:59:23 +08:00
fixed Vec3f::normal
This commit is contained in:
1 parent
09f88d293f
commit
ae6a2f12d4
1 file changed
+3
-2
@@ -588,7 +588,8 @@ namespace Blah
|
||||
|
||||
template<class T>
|
||||
Vec3<T> Vec3<T>::normal() const {
|
||||
return Vec3(x, y, z) / length();
|
||||
T len = length();
|
||||
return Vec3(x / len, y / len, z / len);
|
||||
}
|
||||
|
||||
template<class T>
|
||||
@@ -1307,4 +1308,4 @@ namespace Blah
|
||||
|
||||
return m;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user