diff --git a/src/geometry/quaternion_conversion.rs b/src/geometry/quaternion_conversion.rs index 9c264180..7f1e2c5e 100644 --- a/src/geometry/quaternion_conversion.rs +++ b/src/geometry/quaternion_conversion.rs @@ -177,8 +177,8 @@ impl From> for QuaternionBase where N: Real, S: OwnedStorage, - S::Alloc: OwnedAllocator, -{ + S::Alloc: OwnedAllocator { + fn from(q: mint::Quaternion) -> Self { QuaternionBase::new(q.s, q.v.x, q.v.y, q.v.z) } diff --git a/src/geometry/rotation_conversion.rs b/src/geometry/rotation_conversion.rs index df839062..07ef9d81 100644 --- a/src/geometry/rotation_conversion.rs +++ b/src/geometry/rotation_conversion.rs @@ -22,7 +22,9 @@ use geometry::{Point, Translation, Rotation, UnitQuaternion, UnitComplex, Isomet * Rotation -> Similarity * Rotation -> Transform * Rotation -> Matrix (homogeneous) - */ + * mint::EulerAngles -> RotationBase + +*/ impl SubsetOf> for Rotation @@ -201,3 +203,14 @@ impl SubsetOf>> for Rotation Self::from_matrix_unchecked(::convert_unchecked(r.into_owned())) } } + +#[cfg(feature = "mint")] +impl From> for RotationBase +where N: Real, + S: OwnedStorage, + S::Alloc: OwnedAllocator { + + fn from(euler: mint::EulerAngles) -> Self { + Self::from_euler_angles(euler.a, euler.b, euler.c) + } +}