pub fn rotate(r: Quaternion) -> Self {
        let mut res = Self::identity();

        let right = r.right();
        let up = r.up();
        let fwd = r.forward();

        res.values[cr(0, 0)] = right.x;
        res.values[cr(0, 1)] = right.y;
        res.values[cr(0, 2)] = right.z;

        res.values[cr(1, 0)] = up.x;
        res.values[cr(1, 1)] = up.y;
        res.values[cr(1, 2)] = up.z;

        res.values[cr(2, 0)] = fwd.x;
        res.values[cr(2, 1)] = fwd.y;
        res.values[cr(2, 2)] = fwd.z;

        res
    }
/// Creates a 3D rotation matrix.
Creates a 3D rotation matrix.
Creates a 3D rotation matrix .
pub fn rotate(r: Quaternion) -> Self {
        let mut res = Self::identity();
        let right = r.right();
        let up = r.up();
        let fwd = r.forward();
        res.values[cr(0, 0)] = right.x;
        res.values[cr(0, 1)] = right.y;
        res.values[cr(0, 2)] = right.z;
        res.values[cr(1, 0)] = up.x;
        res.values[cr(1, 1)] = up.y;
        res.values[cr(1, 2)] = up.z;
        res.values[cr(2, 0)] = fwd.x;
        res.values[cr(2, 1)] = fwd.y;
        res.values[cr(2, 2)] = fwd.z;
        res
    }
pub fn rotate ( r : Quaternion ) -> Self { let mut res = Self :: identity ( ) ; let right = r . right ( ) ; let up = r . up ( ) ; let fwd = r . forward ( ) ; res . values [ cr ( 0 , 0 ) ] = right . x ; res . values [ cr ( 0 , 1 ) ] = right . y ; res . values [ cr ( 0 , 2 ) ] = right . z ; res . values [ cr ( 1 , 0 ) ] = up . x ; res . values [ cr ( 1 , 1 ) ] = up . y ; res . values [ cr ( 1 , 2 ) ] = up . z ; res . values [ cr ( 2 , 0 ) ] = fwd . x ; res . values [ cr ( 2 , 1 ) ] = fwd . y ; res . values [ cr ( 2 , 2 ) ] = fwd . z ; res }
Creates a 3D rotation matrix.
Creates a 3D rotation matrix .
r
Quaternion
r
Quaternion