nalgebra/src/geometry/quaternion_coordinates.rs

25 lines
457 B
Rust
Raw Normal View History

use std::mem;
2017-02-13 01:17:09 +08:00
use std::ops::{Deref, DerefMut};
use alga::general::Real;
use base::coordinates::IJKW;
use geometry::Quaternion;
impl<N: Real> Deref for Quaternion<N> {
type Target = IJKW<N>;
#[inline]
fn deref(&self) -> &Self::Target {
unsafe { mem::transmute(self) }
}
}
impl<N: Real> DerefMut for Quaternion<N> {
#[inline]
fn deref_mut(&mut self) -> &mut Self::Target {
unsafe { mem::transmute(self) }
}
}