diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-18 18:36:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-01-18 18:36:21 +0100 |
commit | cf3d995e8cb477a09dcbcf59c1cc8410b4b071fe (patch) | |
tree | b50d74112a8f01a3a219c1cce3d5345c939ad632 | |
parent | 0dfe0d01669d3f281ec02e136676079016c0424c (diff) | |
parent | dbd43ac107ba5fc931aacf94294f247ba2c724af (diff) | |
download | redot-cpp-cf3d995e8cb477a09dcbcf59c1cc8410b4b071fe.tar.gz |
Merge pull request #997 from asmaloney/fix-shadow-eulerorder
Fix a shadowed enum (EulerOrder)
-rw-r--r-- | include/godot_cpp/variant/basis.hpp | 10 | ||||
-rw-r--r-- | src/variant/quaternion.cpp | 4 |
2 files changed, 3 insertions, 11 deletions
diff --git a/include/godot_cpp/variant/basis.hpp b/include/godot_cpp/variant/basis.hpp index 8b2d8c0..a365b02 100644 --- a/include/godot_cpp/variant/basis.hpp +++ b/include/godot_cpp/variant/basis.hpp @@ -31,6 +31,7 @@ #ifndef GODOT_BASIS_HPP #define GODOT_BASIS_HPP +#include <godot_cpp/classes/global_constants.hpp> #include <godot_cpp/variant/quaternion.hpp> #include <godot_cpp/variant/vector3.hpp> @@ -58,15 +59,6 @@ struct _NO_DISCARD_ Basis { _FORCE_INLINE_ real_t determinant() const; - enum EulerOrder { - EULER_ORDER_XYZ, - EULER_ORDER_XZY, - EULER_ORDER_YXZ, - EULER_ORDER_YZX, - EULER_ORDER_ZXY, - EULER_ORDER_ZYX - }; - void from_z(const Vector3 &p_z); void rotate(const Vector3 &p_axis, real_t p_angle); diff --git a/src/variant/quaternion.cpp b/src/variant/quaternion.cpp index 0376dd8..9d4d838 100644 --- a/src/variant/quaternion.cpp +++ b/src/variant/quaternion.cpp @@ -46,7 +46,7 @@ real_t Quaternion::angle_to(const Quaternion &p_to) const { // This implementation uses XYZ convention (Z is the first rotation). Vector3 Quaternion::get_euler_xyz() const { Basis m(*this); - return m.get_euler(Basis::EULER_ORDER_XYZ); + return m.get_euler(EULER_ORDER_XYZ); } // get_euler_yxz returns a vector containing the Euler angles in the format @@ -58,7 +58,7 @@ Vector3 Quaternion::get_euler_yxz() const { ERR_FAIL_COND_V_MSG(!is_normalized(), Vector3(0, 0, 0), "The quaternion must be normalized."); #endif Basis m(*this); - return m.get_euler(Basis::EULER_ORDER_YXZ); + return m.get_euler(EULER_ORDER_YXZ); } void Quaternion::operator*=(const Quaternion &p_q) { |