#[repr(C)]pub struct Matrix {}
Fields§
§m0: f32
§m4: f32
§m8: f32
§m12: f32
§m1: f32
§m5: f32
§m9: f32
§m13: f32
§m2: f32
§m6: f32
§m10: f32
§m14: f32
§m3: f32
§m7: f32
§m11: f32
§m15: f32
Implementations§
source§impl Matrix
impl Matrix
sourcepub fn rotate_xyz(ang: Vector3) -> Self
pub fn rotate_xyz(ang: Vector3) -> Self
Returns xyz-rotation matrix (angles in radians)
sourcepub fn frustum(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> Matrix
pub fn frustum( left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32 ) -> Matrix
Returns perspective projection matrix based on frustum parameters.
sourcepub fn perspective(fovy: f32, aspect: f32, near: f32, far: f32) -> Matrix
pub fn perspective(fovy: f32, aspect: f32, near: f32, far: f32) -> Matrix
Returns perspective projection matrix.
sourcepub fn ortho(
left: f32,
right: f32,
bottom: f32,
top: f32,
near: f32,
far: f32
) -> Matrix
pub fn ortho( left: f32, right: f32, bottom: f32, top: f32, near: f32, far: f32 ) -> Matrix
Returns orthographic projection matrix.
sourcepub fn look_at(eye: Vector3, target: Vector3, up: Vector3) -> Matrix
pub fn look_at(eye: Vector3, target: Vector3, up: Vector3) -> Matrix
Returns camera look-at matrix (view matrix).
sourcepub fn determinant(&self) -> f32
pub fn determinant(&self) -> f32
Calculates the determinant of the current matrix.
sourcepub fn trace(&self) -> f32
pub fn trace(&self) -> f32
Calculates the trace of the matrix (sum of the values along the diagonal).
sourcepub fn transposed(&self) -> Matrix
pub fn transposed(&self) -> Matrix
Returns a new Matrix
transposed from the current one.
sourcepub fn normalized(&self) -> Matrix
pub fn normalized(&self) -> Matrix
Returns a new Matrix
normalized from the current one.
Trait Implementations§
source§impl AddAssign for Matrix
impl AddAssign for Matrix
source§fn add_assign(&mut self, mat: Matrix)
fn add_assign(&mut self, mat: Matrix)
Performs the
+=
operation. Read moresource§impl MulAssign for Matrix
impl MulAssign for Matrix
source§fn mul_assign(&mut self, mat: Matrix)
fn mul_assign(&mut self, mat: Matrix)
Performs the
*=
operation. Read moresource§impl PartialEq for Matrix
impl PartialEq for Matrix
source§impl SubAssign for Matrix
impl SubAssign for Matrix
source§fn sub_assign(&mut self, mat: Matrix)
fn sub_assign(&mut self, mat: Matrix)
Performs the
-=
operation. Read moreimpl Copy for Matrix
impl StructuralPartialEq for Matrix
Auto Trait Implementations§
impl Freeze for Matrix
impl RefUnwindSafe for Matrix
impl Send for Matrix
impl Sync for Matrix
impl Unpin for Matrix
impl UnwindSafe for Matrix
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