浏览代码

Fix quaternion orientation in `glm::decompose`

Craig Bosma 5 年之前
父节点
当前提交
f8bf087caa
共有 1 个文件被更改,包括 3 次插入3 次删除
  1. 3 3
      glm/gtx/matrix_decompose.inl

+ 3 - 3
glm/gtx/matrix_decompose.inl

@@ -159,9 +159,9 @@ namespace detail
 			root = sqrt(trace + static_cast<T>(1.0));
 			Orientation.w = static_cast<T>(0.5) * root;
 			root = static_cast<T>(0.5) / root;
-			Orientation.x = root * (Row[1].z - Row[2].y);
-			Orientation.y = root * (Row[2].x - Row[0].z);
-			Orientation.z = root * (Row[0].y - Row[1].x);
+			Orientation.x = root * (Row[2].y - Row[1].z);
+			Orientation.y = root * (Row[0].z - Row[2].x);
+			Orientation.z = root * (Row[1].x - Row[0].y);
 		} // End if > 0
 		else
 		{