Add read-only access to a Rotmat subcomponents.

This commit is contained in:
Sébastien Crozet 2013-06-29 18:37:01 +00:00
parent 364c16ca19
commit 50293ca417
1 changed files with 6 additions and 0 deletions

View File

@ -19,6 +19,12 @@ use vec::Vec3;
pub struct Rotmat<M> pub struct Rotmat<M>
{ priv submat: M } { priv submat: M }
impl<M: Copy> Rotmat<M>
{
pub fn submat(&self) -> M
{ copy self.submat }
}
pub fn rotmat2<N: Copy + Trigonometric + Neg<N>>(angle: N) -> Rotmat<Mat2<N>> pub fn rotmat2<N: Copy + Trigonometric + Neg<N>>(angle: N) -> Rotmat<Mat2<N>>
{ {
let coa = angle.cos(); let coa = angle.cos();