summaryrefslogtreecommitdiffstats
path: root/core/math/basis.cpp
diff options
context:
space:
mode:
authorAaron Franke <arnfranke@yahoo.com>2019-02-12 12:55:46 -0500
committerAaron Franke <arnfranke@yahoo.com>2019-02-12 17:59:29 -0500
commit06df7b0963ffeac31d2a0e4268889f0573edd7ea (patch)
treeffffe10eb6aa479e154506b481731623a0822bfc /core/math/basis.cpp
parentf97eb6d881b59391bb61847ff9d16a5cd72a357f (diff)
downloadredot-engine-06df7b0963ffeac31d2a0e4268889f0573edd7ea.tar.gz
[Core] Transform2D add set_scale and fix set_rotation
Note: These are still not exposed to GDScript
Diffstat (limited to 'core/math/basis.cpp')
-rw-r--r--core/math/basis.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/core/math/basis.cpp b/core/math/basis.cpp
index 8e4eacd9a6..7f60b7962c 100644
--- a/core/math/basis.cpp
+++ b/core/math/basis.cpp
@@ -258,7 +258,7 @@ Vector3 Basis::get_scale_abs() const {
}
Vector3 Basis::get_scale_local() const {
- real_t det_sign = determinant() > 0 ? 1 : -1;
+ real_t det_sign = SGN(determinant());
return det_sign * Vector3(elements[0].length(), elements[1].length(), elements[2].length());
}
@@ -284,7 +284,7 @@ Vector3 Basis::get_scale() const {
// matrix elements.
//
// The rotation part of this decomposition is returned by get_rotation* functions.
- real_t det_sign = determinant() > 0 ? 1 : -1;
+ real_t det_sign = SGN(determinant());
return det_sign * Vector3(
Vector3(elements[0][0], elements[1][0], elements[2][0]).length(),
Vector3(elements[0][1], elements[1][1], elements[2][1]).length(),