pub fn extract_matrix(&self) -> Mat4 {
        let mut result = Mat4::identity();
        let x = self.x;
        let y = self.y;
        let z = self.z;
        let w = self.w;
        let x2 = x + x;
        let y2 = y + y;
        let z2 = z + z;
        let xx = x * x2;
        let yx = y * x2;
        let yy = y * y2;
        let zx = z * x2;
        let zy = z * y2;
        let zz = z * z2;
        let wx = w * x2;
        let wy = w * y2;
        let wz = w * z2;

        result[0][0] = 1.0 - yy - zz;
        result[0][1] = yx + wz;
        result[0][2] = zx - wy;
        result[1][0] = yx - wz;
        result[1][1] = 1.0 - xx - zz;
        result[1][2] = zy + wx;
        result[2][0] = zx + wy;
        result[2][1] = zy - wx;
        result[2][2] = 1.0 - xx - yy;

        result
    }
/// Calculates and returns a `Mat4` object representing the rotation of the calling `Quat`
/// object.
///
/// # Examples
///
/// ```
/// use gamemath::{Vec3, Mat4, Quat};
///
/// let q = Quat::rotation(1.0, Vec3::new(1.0, 2.0, 3.0));
///
/// assert_eq!(q.extract_matrix(), (( 0.5731379,  0.74034876, -0.35127854, 0.0),
///                                 (-0.6090066,  0.67164457,  0.42190588, 0.0),
///                                 ( 0.5482918, -0.027879298, 0.8358222,  0.0),
///                                 ( 0.0,        0.0,         0.0,        1.0)).into());
/// ```
Calculates and returns a `Mat4` object representing the rotation of the calling `Quat`
object.
Calculates and returns a ` Mat4 ` object representing the rotation of the calling ` Quat ` object .
pub fn extract_matrix(&self) -> Mat4 {
        let mut result = Mat4::identity();
        let x = self.x;
        let y = self.y;
        let z = self.z;
        let w = self.w;
        let x2 = x + x;
        let y2 = y + y;
        let z2 = z + z;
        let xx = x * x2;
        let yx = y * x2;
        let yy = y * y2;
        let zx = z * x2;
        let zy = z * y2;
        let zz = z * z2;
        let wx = w * x2;
        let wy = w * y2;
        let wz = w * z2;
        result[0][0] = 1.0 - yy - zz;
        result[0][1] = yx + wz;
        result[0][2] = zx - wy;
        result[1][0] = yx - wz;
        result[1][1] = 1.0 - xx - zz;
        result[1][2] = zy + wx;
        result[2][0] = zx + wy;
        result[2][1] = zy - wx;
        result[2][2] = 1.0 - xx - yy;
        result
    }
pub fn extract_matrix ( & self ) -> Mat4 { let mut result = Mat4 :: identity ( ) ; let x = self . x ; let y = self . y ; let z = self . z ; let w = self . w ; let x2 = x + x ; let y2 = y + y ; let z2 = z + z ; let xx = x * x2 ; let yx = y * x2 ; let yy = y * y2 ; let zx = z * x2 ; let zy = z * y2 ; let zz = z * z2 ; let wx = w * x2 ; let wy = w * y2 ; let wz = w * z2 ; result [ 0 ] [ 0 ] = 1.0 - yy - zz ; result [ 0 ] [ 1 ] = yx + wz ; result [ 0 ] [ 2 ] = zx - wy ; result [ 1 ] [ 0 ] = yx - wz ; result [ 1 ] [ 1 ] = 1.0 - xx - zz ; result [ 1 ] [ 2 ] = zy + wx ; result [ 2 ] [ 0 ] = zx + wy ; result [ 2 ] [ 1 ] = zy - wx ; result [ 2 ] [ 2 ] = 1.0 - xx - yy ; result }
Calculates and returns a `Mat4` object representing the rotation of the calling `Quat`
object.
Calculates and returns a ` Mat4 ` object representing the rotation of the calling ` Quat ` object .
&self
&self
examples
None