nalgebra/src/geometry/quaternion_coordinates.rs

26 lines
521 B
Rust
Raw Normal View History

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