diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2017-01-04 01:17:41 -0300 |
|---|---|---|
| committer | Juan Linietsky <reduzio@gmail.com> | 2017-01-04 01:17:41 -0300 |
| commit | 76c2e8583e70e8c976a306e77a40e8e7226aa249 (patch) | |
| tree | fe260ef3c0d00996d537f2fe3b8c78abfb92aa60 /core/math/quat.h | |
| parent | b085c40edfac45ec1c8b866c789f6e9bab7e5e08 (diff) | |
| parent | 3a0c19d3f6ddb26359c95d84c376a8e6b1afd04d (diff) | |
| download | redot-engine-76c2e8583e70e8c976a306e77a40e8e7226aa249.tar.gz | |
Merge branch 'master' of https://github.com/godotengine/godot
Diffstat (limited to 'core/math/quat.h')
| -rw-r--r-- | core/math/quat.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/core/math/quat.h b/core/math/quat.h index 9f4145cddb..40c048006f 100644 --- a/core/math/quat.h +++ b/core/math/quat.h @@ -49,15 +49,16 @@ public: Quat inverse() const; _FORCE_INLINE_ real_t dot(const Quat& q) const; void set_euler(const Vector3& p_euler); + Vector3 get_euler() const; Quat slerp(const Quat& q, const real_t& t) const; Quat slerpni(const Quat& q, const real_t& t) const; Quat cubic_slerp(const Quat& q, const Quat& prep, const Quat& postq,const real_t& t) const; _FORCE_INLINE_ void get_axis_and_angle(Vector3& r_axis, real_t &r_angle) const { r_angle = 2 * Math::acos(w); - r_axis.x = -x / Math::sqrt(1-w*w); - r_axis.y = -y / Math::sqrt(1-w*w); - r_axis.z = -z / Math::sqrt(1-w*w); + r_axis.x = x / Math::sqrt(1-w*w); + r_axis.y = y / Math::sqrt(1-w*w); + r_axis.z = z / Math::sqrt(1-w*w); } void operator*=(const Quat& q); @@ -183,12 +184,10 @@ Quat Quat::operator/(const real_t& s) const { bool Quat::operator==(const Quat& p_quat) const { - return x==p_quat.x && y==p_quat.y && z==p_quat.z && w==p_quat.w; } bool Quat::operator!=(const Quat& p_quat) const { - return x!=p_quat.x || y!=p_quat.y || z!=p_quat.z || w!=p_quat.w; } |
