nalgebra/src/geometry/quaternion_coordinates.rs

25 lines
496 B
Rust
Raw Normal View History

use std::mem;
2017-02-13 01:17:09 +08:00
use std::ops::{Deref, DerefMut};
2020-03-21 19:16:46 +08:00
use simba::simd::SimdRealField;
2019-03-23 21:29:07 +08:00
use crate::base::coordinates::IJKW;
2019-03-23 21:29:07 +08:00
use crate::geometry::Quaternion;
2020-03-21 19:16:46 +08:00
impl<N: SimdRealField> Deref for Quaternion<N> {
type Target = IJKW<N>;
#[inline]
fn deref(&self) -> &Self::Target {
unsafe { mem::transmute(self) }
}
}
2020-03-21 19:16:46 +08:00
impl<N: SimdRealField> DerefMut for Quaternion<N> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { mem::transmute(self) }
}
}