pub struct Mat4 {
pub v: [f32; 16],
}
Expand description
4x4 matrix; very common in graphics programming.
Fieldsยง
ยงv: [f32; 16]
Implementationsยง
Sourceยงimpl Mat4
impl Mat4
pub fn identity() -> Mat4
pub fn txyz_s_ry_rx_txyz(t1: Vec3, s: f32, ry: f32, rx: f32, t2: Vec3) -> Mat4
pub fn perspective(fov_y: f32, aspect: f32, near: f32, far: f32) -> Mat4
pub fn translation(x: f32, y: f32, z: f32) -> Mat4
pub fn scaled_translation(s: f32, x: f32, y: f32, z: f32) -> Mat4
pub fn rotation(rx: f32, ry: f32, rz: f32) -> Mat4
pub fn ortho( left: f32, right: f32, top: f32, bottom: f32, near: f32, far: f32, scalex: f32, scaley: f32, ) -> Mat4
pub fn transform_vec4(&self, v: Vec4) -> Vec4
pub fn mul(a: &Mat4, b: &Mat4) -> Mat4
pub fn invert(&self) -> Mat4
Sourcepub fn as_rotation(&self) -> Mat4
pub fn as_rotation(&self) -> Mat4
Extracts just the rotation values from a transformation matrix.
Trait Implementationsยง
impl Copy for Mat4
impl StructuralPartialEq for Mat4
Auto Trait Implementationsยง
impl Freeze for Mat4
impl RefUnwindSafe for Mat4
impl Send for Mat4
impl Sync for Mat4
impl Unpin for Mat4
impl UnwindSafe for Mat4
Blanket Implementationsยง
Sourceยงimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Sourceยงfn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more