Merge branch 'master' into develop

This commit is contained in:
Daniel Chappuis 2020-06-15 22:11:42 +02:00
commit 22f9e5fc05

View File

@ -307,8 +307,9 @@ inline bool Quaternion::isFinite() const {
// Return true if it is a unit quaternion // Return true if it is a unit quaternion
inline bool Quaternion::isUnit() const { inline bool Quaternion::isUnit() const {
decimal length = std::sqrt(x*x + y*y + z*z + w*w); const decimal length = std::sqrt(x*x + y*y + z*z + w*w);
return std::abs(length - decimal(1.0)) < MACHINE_EPSILON; const decimal tolerance = 1e-5f;
return std::abs(length - decimal(1.0)) < tolerance;
} }
// Return true if it is a valid quaternion // Return true if it is a valid quaternion