pub struct Mat4(pub [f32; 16]);Expand description
Row-major 4x4 matrix; vectors are columns (m * v).
Tuple Fields§
§0: [f32; 16]Implementations§
Source§impl Mat4
impl Mat4
pub const IDENTITY: Mat4
pub fn mul(&self, o: &Mat4) -> Mat4
pub fn translate(x: f32, y: f32, z: f32) -> Mat4
pub fn scale(x: f32, y: f32, z: f32) -> Mat4
Sourcepub fn rotate_xyz(deg: [f32; 3]) -> Mat4
pub fn rotate_xyz(deg: [f32; 3]) -> Mat4
Rotation from Euler angles in degrees, applied X, then Y, then Z.
Sourcepub fn perspective(fov_y_deg: f32, aspect: f32, near: f32, far: f32) -> Mat4
pub fn perspective(fov_y_deg: f32, aspect: f32, near: f32, far: f32) -> Mat4
Right-handed perspective projection with depth in [0, 1].
pub fn look_at(eye: [f32; 3], target: [f32; 3], up: [f32; 3]) -> Mat4
pub fn transpose(&self) -> Mat4
Sourcepub fn inverse_affine(&self) -> Mat4
pub fn inverse_affine(&self) -> Mat4
Inverse of an affine matrix (rotation/scale/translation).
Trait Implementations§
impl Copy for Mat4
impl StructuralPartialEq for Mat4
Auto Trait Implementations§
impl Forget for Mat4
impl Freeze for Mat4
impl Move for Mat4
impl RefUnwindSafe for Mat4
impl Send for Mat4
impl Sync for Mat4
impl Unpin for Mat4
impl UnsafeUnpin 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