summaryrefslogtreecommitdiffstats
path: root/core/math/quat.cpp
diff options
context:
space:
mode:
authorFerenc Arn <tagcup@yahoo.com>2017-04-05 17:47:13 -0500
committerFerenc Arn <tagcup@yahoo.com>2017-04-06 13:03:56 -0500
commit9a37ff1e34fe445a9168a7d91ae1df7d9928eb25 (patch)
treef524cd3d1fd4c31e7e1fe868eea45d3d3086c2f6 /core/math/quat.cpp
parent454f53c77659721a529c48fd4be6bf80d33c0082 (diff)
downloadredot-engine-9a37ff1e34fe445a9168a7d91ae1df7d9928eb25.tar.gz
Added various functions basic math classes. Also enabled math checks only for debug builds.
Added set_scale, set_rotation_euler, set_rotation_axis_angle. Addresses #2565 directly. Added an euler angle constructor for Basis in GDScript and also exposed is_normalized for vectors and quaternions. Various other changes mostly cosmetic in nature.
Diffstat (limited to 'core/math/quat.cpp')
-rw-r--r--core/math/quat.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/quat.cpp b/core/math/quat.cpp
index b990e9184f..6c06317cf1 100644
--- a/core/math/quat.cpp
+++ b/core/math/quat.cpp
@@ -91,6 +91,10 @@ Quat Quat::normalized() const {
return *this / length();
}
+bool Quat::is_normalized() const {
+ return Math::is_equal_approx(length(), 1.0);
+}
+
Quat Quat::inverse() const {
return Quat(-x, -y, -z, w);
}