re_types/components/
rotation_quat_ext.rs

1use super::RotationQuat;
2
3impl RotationQuat {
4    /// The identity rotation, representing no rotation.
5    ///
6    /// Keep in mind that logging an identity rotation is different from logging no rotation at all
7    /// in thus far that it will write data to the store.
8    pub const IDENTITY: Self = Self(crate::datatypes::Quaternion::IDENTITY);
9
10    /// A rotation that represents an invalid transform.
11    pub const INVALID: Self = Self(crate::datatypes::Quaternion::INVALID);
12}
13
14#[cfg(feature = "glam")]
15impl TryFrom<RotationQuat> for glam::Affine3A {
16    type Error = ();
17
18    #[inline]
19    fn try_from(val: RotationQuat) -> Result<Self, Self::Error> {
20        Ok(Self::from_quat(glam::Quat::try_from(val.0)?))
21    }
22}