From 73084883565ab68ad16db548119350a9a71b39e5 Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Fri, 29 Sep 2023 15:00:07 +0100 Subject: [PATCH] Fixed bug in vsg::decompose(...) --- src/vsg/maths/maths_transform.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vsg/maths/maths_transform.cpp b/src/vsg/maths/maths_transform.cpp index cbd955668..ab543c45a 100644 --- a/src/vsg/maths/maths_transform.cpp +++ b/src/vsg/maths/maths_transform.cpp @@ -278,7 +278,7 @@ bool t_decompose(const t_mat4& m, t_vec3& translation, t_quat& rotation auto root = sqrt(rm[i][i] - rm[j][j] - rm[k][k] + static_cast(1.0)); auto half_inv_root = static_cast(0.5) / root; - rotation[i] = static_cast(0.5) / root; + rotation[i] = static_cast(0.5) * root; rotation[j] = half_inv_root * (rm[i][j] + rm[j][i]); rotation[k] = half_inv_root * (rm[i][k] + rm[k][i]); rotation[3] = half_inv_root * (rm[j][k] - rm[k][j]);