Fix a shadowed enum (EulerOrder)

Use the global constants.
pull/997/head
Andy Maloney 2023-01-17 18:38:24 -05:00
parent cb15429e4a
commit dbd43ac107
2 changed files with 3 additions and 11 deletions

View File

@ -31,6 +31,7 @@
#ifndef GODOT_BASIS_HPP #ifndef GODOT_BASIS_HPP
#define GODOT_BASIS_HPP #define GODOT_BASIS_HPP
#include <godot_cpp/classes/global_constants.hpp>
#include <godot_cpp/variant/quaternion.hpp> #include <godot_cpp/variant/quaternion.hpp>
#include <godot_cpp/variant/vector3.hpp> #include <godot_cpp/variant/vector3.hpp>
@ -58,15 +59,6 @@ struct _NO_DISCARD_ Basis {
_FORCE_INLINE_ real_t determinant() const; _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 from_z(const Vector3 &p_z);
void rotate(const Vector3 &p_axis, real_t p_angle); void rotate(const Vector3 &p_axis, real_t p_angle);

View File

@ -46,7 +46,7 @@ real_t Quaternion::angle_to(const Quaternion &p_to) const {
// This implementation uses XYZ convention (Z is the first rotation). // This implementation uses XYZ convention (Z is the first rotation).
Vector3 Quaternion::get_euler_xyz() const { Vector3 Quaternion::get_euler_xyz() const {
Basis m(*this); 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 // 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."); ERR_FAIL_COND_V_MSG(!is_normalized(), Vector3(0, 0, 0), "The quaternion must be normalized.");
#endif #endif
Basis m(*this); 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) { void Quaternion::operator*=(const Quaternion &p_q) {