summaryrefslogtreecommitdiff
path: root/core/math/matrix3.cpp
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2017-10-21 23:51:07 +0200
committerGitHub <noreply@github.com>2017-10-21 23:51:07 +0200
commit50306041e5be9859bd448fe80a52be45694b6688 (patch)
tree6e57fdc9c9286be522bf7e15af5b0ccd8248a22b /core/math/matrix3.cpp
parent01a5a8b86c400a8e90f07f82411debf75b771633 (diff)
parent8861cc40fa79acd131875a556a8cf528384858ee (diff)
Merge pull request #11982 from tagcup/get_quat
Added Basis::get_quat().
Diffstat (limited to 'core/math/matrix3.cpp')
-rw-r--r--core/math/matrix3.cpp13
1 files changed, 2 insertions, 11 deletions
diff --git a/core/math/matrix3.cpp b/core/math/matrix3.cpp
index 4051de7afb..85421c074b 100644
--- a/core/math/matrix3.cpp
+++ b/core/math/matrix3.cpp
@@ -538,7 +538,7 @@ Basis::operator String() const {
return mtx;
}
-Basis::operator Quat() const {
+Quat Basis::get_quat() const {
//commenting this check because precision issues cause it to fail when it shouldn't
//#ifdef MATH_CHECKS
//ERR_FAIL_COND_V(is_rotation() == false, Quat());
@@ -710,12 +710,7 @@ void Basis::get_axis_angle(Vector3 &r_axis, real_t &r_angle) const {
r_angle = angle;
}
-Basis::Basis(const Vector3 &p_euler) {
-
- set_euler(p_euler);
-}
-
-Basis::Basis(const Quat &p_quat) {
+void Basis::set_quat(const Quat &p_quat) {
real_t d = p_quat.length_squared();
real_t s = 2.0 / d;
@@ -750,7 +745,3 @@ void Basis::set_axis_angle(const Vector3 &p_axis, real_t p_phi) {
elements[2][1] = p_axis.y * p_axis.z * (1.0 - cosine) + p_axis.x * sine;
elements[2][2] = axis_sq.z + cosine * (1.0 - axis_sq.z);
}
-
-Basis::Basis(const Vector3 &p_axis, real_t p_phi) {
- set_axis_angle(p_axis, p_phi);
-}