summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2020-06-17 00:57:09 -0400
committerAaron Franke <arnfranke@yahoo.com>2020-06-17 01:00:42 -0400
commit0fa478a050a94da2468f3c3b2216bacd7dedf0ab (patch)
treea44076ca9826ead2aaa55684b9e1b5d839e296cc
parent02f7908d460bea7d580fe7526949be7f294e6783 (diff)
Simplify Transform2D get_rotation
-rw-r--r--core/math/transform_2d.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/core/math/transform_2d.cpp b/core/math/transform_2d.cpp
index dee1b3b23e..180aeaa0af 100644
--- a/core/math/transform_2d.cpp
+++ b/core/math/transform_2d.cpp
@@ -78,12 +78,7 @@ void Transform2D::set_skew(float p_angle) {
}
real_t Transform2D::get_rotation() const {
- real_t det = basis_determinant();
- Transform2D m = orthonormalized();
- if (det < 0) {
- m.scale_basis(Size2(1, -1)); // convention to separate rotation and reflection for 2D is to absorb a flip along y into scaling.
- }
- return Math::atan2(m[0].y, m[0].x);
+ return Math::atan2(elements[0].y, elements[0].x);
}
void Transform2D::set_rotation(real_t p_rot) {