From 074ad123ef8aed2be9fce9cf87885fc7a6a0fa7b Mon Sep 17 00:00:00 2001 From: Kensuke Matsuzaki Date: Sun, 8 Nov 2015 21:30:39 +0900 Subject: [PATCH] Fix problem that Matrix::decompose rotation contains scaling factor --- gameplay/src/Matrix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gameplay/src/Matrix.cpp b/gameplay/src/Matrix.cpp index fdb96d0151..a22e6ac4ee 100644 --- a/gameplay/src/Matrix.cpp +++ b/gameplay/src/Matrix.cpp @@ -517,7 +517,7 @@ bool Matrix::decompose(Vector3* scale, Quaternion* rotation, Vector3* translatio // Now calculate the rotation from the resulting matrix (axes). float trace = xaxis.x + yaxis.y + zaxis.z + 1.0f; - if (trace > MATH_EPSILON) + if (trace > 1.0f) { float s = 0.5f / sqrt(trace); rotation->w = 0.25f / s;