From 2cace84c901a8ee9302e181d032e67e8f2e7f269 Mon Sep 17 00:00:00 2001 From: Lynix Date: Fri, 15 Jan 2016 01:04:29 +0100 Subject: [PATCH] Math/Matrix4: Fix computations. Sometimes some values can be really small (and very close to zero) without being null. Former-commit-id: 932160043e4eb4094c7234f8cf4eb7c212966678 --- include/Nazara/Math/Matrix4.inl | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/include/Nazara/Math/Matrix4.inl b/include/Nazara/Math/Matrix4.inl index e2f604aed..a5b4fb631 100644 --- a/include/Nazara/Math/Matrix4.inl +++ b/include/Nazara/Math/Matrix4.inl @@ -326,7 +326,7 @@ namespace Nz #endif T det = GetDeterminant(); - if (!NumberEquals(det, F(0.0))) + if (det != T(0.0)) { // http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix T inv[16]; @@ -484,7 +484,7 @@ namespace Nz #endif T det = GetDeterminantAffine(); - if (!NumberEquals(det, F(0.0))) + if (det != F(0.0)) { // http://stackoverflow.com/questions/1148309/inverting-a-4x4-matrix T inv[16]; @@ -790,10 +790,7 @@ namespace Nz template bool Matrix4::IsAffine() const { - return NumberEquals(m14, F(0.0)) && - NumberEquals(m24, F(0.0)) && - NumberEquals(m34, F(0.0)) && - NumberEquals(m44, F(1.0)); + return m14 == F(0.0) && m24 == F(0.0) && m34 == F(0.0) && m44 == F(1.0); } /*!