From 7c1cc68d6f06bfdd05719a589952dba8ddd2c81c Mon Sep 17 00:00:00 2001 From: ptitSeb Date: Sat, 16 Apr 2016 11:32:57 +0200 Subject: [PATCH] Lower Epsilonon Pandora --- Sources/Engine/Math/Quaternion.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Sources/Engine/Math/Quaternion.h b/Sources/Engine/Math/Quaternion.h index b46c078..d9d51e4 100755 --- a/Sources/Engine/Math/Quaternion.h +++ b/Sources/Engine/Math/Quaternion.h @@ -370,7 +370,7 @@ void Quaternion::FromEuler(const Vector &a) template Type Quaternion::EPS(Type orig) const { - if ((orig <= 10e-6f) && (orig >= -10e-6f)) + if ((orig <= 1e-4f) && (orig >= -1e-4f)) return(0.0f); return(orig); @@ -384,9 +384,9 @@ void Quaternion::ToMatrix(Matrix &m) const Type yy = 2*q_y*q_y; Type yz = 2*q_y*q_z; Type zz = 2*q_z*q_z; Type wx = 2*q_w*q_x; Type wy = 2*q_w*q_y; Type wz = 2*q_w*q_z; - m(1,1) = EPS(1.0f-(yy+zz));m(1,2) = EPS(xy-wz); m(1,3) = EPS(xz+wy); - m(2,1) = EPS(xy+wz); m(2,2) = EPS(1.0f-(xx+zz));m(2,3) = EPS(yz-wx); - m(3,1) = EPS(xz-wy); m(3,2) = EPS(yz+wx); m(3,3) = EPS(1.0f-(xx+yy)); + m(1,1) = 1.0f-EPS(yy+zz); m(1,2) = EPS(xy-wz); m(1,3) = EPS(xz+wy); + m(2,1) = EPS(xy+wz); m(2,2) = 1.0f-EPS(xx+zz); m(2,3) = EPS(yz-wx); + m(3,1) = EPS(xz-wy); m(3,2) = EPS(yz+wx); m(3,3) = 1.0f-EPS(xx+yy); } // conversion from matrix