Kaynağa Gözat

Fix problem that Matrix::decompose rotation contains scaling factor

Kensuke Matsuzaki 10 yıl önce
ebeveyn
işleme
d0d2773651
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      gameplay/src/Matrix.cpp

+ 1 - 1
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;