From b61462268e9a8a2c86c1abd5bc65cd96659fa979 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9mi=20Verschelde?= Date: Sun, 27 Aug 2017 18:25:12 +0200 Subject: [PATCH] Revert "Display the Y angle properly when rotating from gizmo, partially helps #1479" This reverts commit 641135ba21bc83bd3bf1a6611bd1eb94e0a175d2. --- core/math/matrix3.cpp | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp index 79b6cef123..f8ba3af143 100644 --- a/core/math/matrix3.cpp +++ b/core/math/matrix3.cpp @@ -30,7 +30,7 @@ #include "matrix3.h" #include "math_funcs.h" #include "os/copymem.h" -#include "print_string.h" + #define cofac(row1, col1, row2, col2) \ (elements[row1][col1] * elements[row2][col2] - elements[row1][col2] * elements[row2][col1]) @@ -169,16 +169,8 @@ Vector3 Matrix3::get_euler() const { euler.y = Math::asin(m[0][2]); if (euler.y < Math_PI * 0.5) { if (euler.y > -Math_PI * 0.5) { - //if rotation is Y-only, return a proper -pi,pi range like in x or z for the same case. - if (m[1][0] == 0.0 && m[0][1] == 0.0 && m[0][0] < 0.0) { - if (euler.y > 0.0) - euler.y = Math_PI - euler.y; - else - euler.y = -(Math_PI + euler.y); - } else { - euler.x = Math::atan2(-m[1][2], m[2][2]); - euler.z = Math::atan2(-m[0][1], m[0][0]); - } + euler.x = Math::atan2(-m[1][2], m[2][2]); + euler.z = Math::atan2(-m[0][1], m[0][0]); } else { real_t r = Math::atan2(m[1][0], m[1][1]);