mirror of
https://github.com/NoelFB/blah.git
synced 2025-02-18 12:48:27 +08:00
fixed Vec3f::normal
This commit is contained in:
parent
09f88d293f
commit
ae6a2f12d4
@ -588,7 +588,8 @@ namespace Blah
|
|||||||
|
|
||||||
template<class T>
|
template<class T>
|
||||||
Vec3<T> Vec3<T>::normal() const {
|
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>
|
template<class T>
|
||||||
@ -1307,4 +1308,4 @@ namespace Blah
|
|||||||
|
|
||||||
return m;
|
return m;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user