Skip to content

Commit

Permalink
Fix problem that Matrix::decompose rotation contains scaling factor
Browse files Browse the repository at this point in the history
  • Loading branch information
zakki committed Nov 8, 2015
1 parent e389e7d commit 074ad12
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion gameplay/src/Matrix.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 074ad12

Please sign in to comment.