Skip to content

Commit 1f37d35

Browse files
committed
Merge EulerOrder enum with generated one
1 parent 0ac08b1 commit 1f37d35

File tree

4 files changed

+12
-18
lines changed

4 files changed

+12
-18
lines changed

godot-core/src/builtin/basis.rs

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ use crate::builtin::math::{ApproxEq, FloatExt, GlamConv, GlamType};
1212
use crate::builtin::real_consts::FRAC_PI_2;
1313
use crate::builtin::{real, Quaternion, RMat3, RQuat, RVec2, RVec3, Vector3};
1414

15+
use crate::engine::global::EulerOrder;
1516
use std::cmp::Ordering;
1617
use std::fmt::Display;
1718
use std::ops::{Mul, MulAssign};
@@ -322,6 +323,7 @@ impl Basis {
322323
))
323324
}
324325

326+
#[allow(clippy::wrong_self_convention)]
325327
fn to_euler_inner(major: real, pair0: RVec2, pair1: RVec2, pair2: RVec2) -> RVec3 {
326328
match Self::is_between_neg1_1(major) {
327329
// It's -1
@@ -606,19 +608,6 @@ unsafe impl GodotFfi for Basis {
606608

607609
impl_godot_as_self!(Basis);
608610

609-
/// The ordering used to interpret a set of euler angles as extrinsic
610-
/// rotations.
611-
#[derive(Copy, Clone, Eq, PartialEq, Debug)]
612-
#[repr(C)]
613-
pub enum EulerOrder {
614-
XYZ = 0,
615-
XZY = 1,
616-
YXZ = 2,
617-
YZX = 3,
618-
ZXY = 4,
619-
ZYX = 5,
620-
}
621-
622611
#[cfg(test)]
623612
mod test {
624613
use crate::builtin::real_consts::{FRAC_PI_2, PI};

godot-core/src/builtin/mod.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -88,8 +88,6 @@ pub mod strings {
8888
pub use super::string::TransientStringNameOrd;
8989
}
9090

91-
use crate::engine::global::Side;
92-
9391
// ----------------------------------------------------------------------------------------------------------------------------------------------
9492
// Implementation
9593

@@ -154,7 +152,12 @@ pub(crate) fn u8_to_bool(u: u8) -> bool {
154152
///
155153
/// _Godot equivalent: `@GlobalScope.Side`_
156154
#[deprecated(note = "Merged with `godot::global::Side`.")]
157-
pub type RectSide = Side;
155+
pub type RectSide = crate::engine::global::Side;
156+
use crate::engine::global::Side;
157+
158+
/// The ordering used to interpret a set of euler angles as extrinsic rotations.
159+
#[deprecated(note = "Merged with `godot::global::EulerOrder`.")]
160+
pub type EulerOrder = crate::engine::global::EulerOrder;
158161

159162
#[allow(non_upper_case_globals)]
160163
impl Side {

godot-core/src/builtin/quaternion.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ use godot_ffi as sys;
99
use sys::{ffi_methods, GodotFfi};
1010

1111
use crate::builtin::math::{ApproxEq, FloatExt, GlamConv, GlamType};
12-
use crate::builtin::{inner, real, Basis, EulerOrder, RQuat, RealConv, Vector3};
12+
use crate::builtin::{inner, real, Basis, RQuat, RealConv, Vector3};
1313

14+
use crate::engine::global::EulerOrder;
1415
use std::ops::{Add, AddAssign, Div, DivAssign, Mul, MulAssign, Neg, Sub, SubAssign};
1516

1617
use super::meta::impl_godot_as_self;

itest/rust/src/builtin_tests/geometry/basis_test.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
use godot::builtin::inner::InnerBasis;
99
use godot::builtin::math::assert_eq_approx;
1010
use godot::builtin::meta::ToGodot;
11-
use godot::builtin::{real, Basis, EulerOrder, RealConv, VariantOperator, Vector3};
11+
use godot::builtin::{real, Basis, RealConv, VariantOperator, Vector3};
12+
use godot::engine::global::EulerOrder;
1213

1314
use crate::framework::itest;
1415

0 commit comments

Comments
 (0)