diff --git a/include/assimp/quaternion.inl b/include/assimp/quaternion.inl index b6394b8a3..9113848b8 100644 --- a/include/assimp/quaternion.inl +++ b/include/assimp/quaternion.inl @@ -69,12 +69,12 @@ bool aiQuaterniont::operator!= (const aiQuaterniont& o) const template inline aiQuaterniont::aiQuaterniont( const aiMatrix3x3t &pRotMatrix) { - TReal t = 1 + pRotMatrix.a1 + pRotMatrix.b2 + pRotMatrix.c3; + TReal t = pRotMatrix.a1 + pRotMatrix.b2 + pRotMatrix.c3; // large enough - if( t > static_cast(0.001)) + if( t > static_cast(0)) { - TReal s = sqrt( t) * static_cast(2.0); + TReal s = sqrt(1 + t) * static_cast(2.0); x = (pRotMatrix.c2 - pRotMatrix.b3) / s; y = (pRotMatrix.a3 - pRotMatrix.c1) / s; z = (pRotMatrix.b1 - pRotMatrix.a2) / s;