From 2d30a6e21a0910c675630013ec501cbfbc2553a1 Mon Sep 17 00:00:00 2001 From: Jonathon Racz Date: Mon, 29 Dec 2014 17:58:16 -0500 Subject: [PATCH 1/2] Fixed VS2010 templating issues with decompose function caused by ambiguous type conversions and constants. --- glm/gtx/matrix_decompose.inl | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/glm/gtx/matrix_decompose.inl b/glm/gtx/matrix_decompose.inl index 30b640f9..80250cb0 100644 --- a/glm/gtx/matrix_decompose.inl +++ b/glm/gtx/matrix_decompose.inl @@ -125,31 +125,32 @@ namespace glm // Now get scale and shear. for(length_t i = 0; i < 3; ++i) - Row[i] = LocalMatrix[i]; + for(int j = 0; j < 3; ++j) + Row[i][j] = LocalMatrix[i][j]; // Compute X scale factor and normalize first row. Scale.x = length(Row[0]);// v3Length(Row[0]); - v3Scale(Row[0], 1.0); + v3Scale(Row[0], static_cast(1)); // Compute XY shear factor and make 2nd row orthogonal to 1st. Skew.z = dot(Row[0], Row[1]); - Row[1] = combine(Row[1], Row[0], 1.0, -Skew.z); + Row[1] = combine(Row[1], Row[0], static_cast(1.0), -Skew.z); // Now, compute Y scale and normalize 2nd row. Scale.y = length(Row[1]); - v3Scale(Row[1], 1.0); + v3Scale(Row[1], static_cast(1)); Skew.z /= Scale.y; // Compute XZ and YZ shears, orthogonalize 3rd row. Skew.y = glm::dot(Row[0], Row[2]); - Row[2] = combine(Row[2], Row[0], 1.0, -Skew.y); + Row[2] = combine(Row[2], Row[0], static_cast(1), -Skew.y); Skew.x = glm::dot(Row[1], Row[2]); - Row[2] = combine(Row[2], Row[1], 1.0, -Skew.x); + Row[2] = combine(Row[2], Row[1], static_cast(1), -Skew.x); // Next, get Z scale and normalize 3rd row. Scale.z = length(Row[2]); - v3Scale(Row[2], 1.0); + v3Scale(Row[2], static_cast(1)); Skew.y /= Scale.z; Skew.x /= Scale.z; From dd948d3cc22e1037259fe0d931a0a70ff043de70 Mon Sep 17 00:00:00 2001 From: Jonathon Racz Date: Mon, 29 Dec 2014 22:57:51 -0500 Subject: [PATCH 2/2] Fixed inconsistency in templated value --- glm/gtx/matrix_decompose.inl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/glm/gtx/matrix_decompose.inl b/glm/gtx/matrix_decompose.inl index 80250cb0..ba507d0e 100644 --- a/glm/gtx/matrix_decompose.inl +++ b/glm/gtx/matrix_decompose.inl @@ -135,7 +135,7 @@ namespace glm // Compute XY shear factor and make 2nd row orthogonal to 1st. Skew.z = dot(Row[0], Row[1]); - Row[1] = combine(Row[1], Row[0], static_cast(1.0), -Skew.z); + Row[1] = combine(Row[1], Row[0], static_cast(1), -Skew.z); // Now, compute Y scale and normalize 2nd row. Scale.y = length(Row[1]);