#[repr(C)]pub struct Mat4 {
pub m: [f32; 16],
}Expand description
4x4 Column-Major Matrix for 3D Graphics Pipelines
Fields§
§m: [f32; 16]16 floats stored in column-major order: [0]=m00, [1]=m10, [2]=m20, [3]=m30 (col 0) [4]=m01, [5]=m11, [6]=m21, [7]=m31 (col 1) [8]=m02, [9]=m12, [10]=m22, [11]=m32 (col 2) [12]=m03, [13]=m13, [14]=m23, [15]=m33 (col 3)
Implementations§
Source§impl Mat4
impl Mat4
pub const IDENTITY: Self
pub const fn from_cols(c0: Vec4, c1: Vec4, c2: Vec4, c3: Vec4) -> Self
pub fn from_translation(v: Vec3) -> Self
pub fn from_scale(s: Vec3) -> Self
pub fn from_rotation_x(radians: f32) -> Self
pub fn from_rotation_y(radians: f32) -> Self
pub fn from_rotation_z(radians: f32) -> Self
pub fn from_euler(rx: f32, ry: f32, rz: f32) -> Self
pub fn from_trs(translation: Vec3, rotation: Vec3, scale: Vec3) -> Self
pub fn multiply(&self, rhs: &Self) -> Self
pub fn transform_vec4(&self, v: Vec4) -> Vec4
pub fn transform_point(&self, p: Vec3) -> Vec3
pub fn transform_vector(&self, v: Vec3) -> Vec3
pub fn transpose(&self) -> Self
pub fn determinant(&self) -> f32
pub fn inverse(&self) -> Option<Self>
Sourcepub fn look_at(eye: Vec3, target: Vec3, up: Vec3) -> Self
pub fn look_at(eye: Vec3, target: Vec3, up: Vec3) -> Self
View Matrix from Eye, Target, and Up vectors (Right-Handed, matching Vulkan/OpenGL)
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