Skip to main content

Matrix44f

Struct Matrix44f 

Source
#[repr(C)]
pub struct Matrix44f { pub data: [[f32; 4]; 4], }
Expand description

Row-major, matching the C++ MatrixMethods storage order.

Fields§

§data: [[f32; 4]; 4]

Implementations§

Source§

impl Matrix44f

Source

pub const DIM: usize = 4

Source

pub const fn from_rows(data: [[f32; 4]; 4]) -> Self

Source§

impl Matrix44f

Source

pub fn identity() -> Matrix44f

Source

pub fn zero() -> Matrix44f

Source

pub fn translation(t: Vector3f) -> Matrix44f

Source

pub fn rotation(q: Quaternion) -> Matrix44f

Source

pub fn scaling(s: Vector3f) -> Matrix44f

Source

pub fn compose( translation: Vector3f, rotation: Quaternion, scale: Vector3f, ) -> Matrix44f

Source

pub fn inverse(m: Matrix44f) -> Matrix44f

Source

pub fn rotation_x(angle: f32) -> Matrix44f

Source

pub fn rotation_y(angle: f32) -> Matrix44f

Source

pub fn rotation_z(angle: f32) -> Matrix44f

Source

pub fn look_at_rh(eye: Vector3f, target: Vector3f, up: Vector3f) -> Matrix44f

Source

pub fn look_at_lh(eye: Vector3f, target: Vector3f, up: Vector3f) -> Matrix44f

Source

pub fn look_at_lh_sgcompat( eye: Vector3f, target: Vector3f, up: Vector3f, ) -> Matrix44f

Source

pub fn perspective_fov_rh( fov_y: f32, aspect: f32, near_z: f32, far_z: f32, ) -> Matrix44f

Source

pub fn perspective_fov_lh( fov_y: f32, aspect: f32, near_z: f32, far_z: f32, ) -> Matrix44f

Source

pub fn perspective_diag_sgcompat( fov_diagonal: f32, aspect: f32, near_z: f32, far_z: f32, ) -> Matrix44f

Source

pub fn orthographic_rh( width: f32, height: f32, near_z: f32, far_z: f32, ) -> Matrix44f

Source

pub fn transpose(self) -> Matrix44f

Source

pub fn extract_translation(self) -> Vector3f

Source

pub fn extract_rotation(self) -> Quaternion

Source

pub fn extract_scale(self) -> Vector3f

Trait Implementations§

Source§

impl Add for Matrix44f

Source§

type Output = Matrix44f

The resulting type after applying the + operator.
Source§

fn add(self, other: Matrix44f) -> Matrix44f

Performs the + operation. Read more
Source§

impl Clone for Matrix44f

Source§

fn clone(&self) -> Matrix44f

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Matrix44f

Source§

impl Debug for Matrix44f

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Matrix44f

Source§

fn default() -> Matrix44f

Returns the “default value” for a type. Read more
Source§

impl Index<(usize, usize)> for Matrix44f

Source§

type Output = f32

The returned type after indexing.
Source§

fn index(&self, (row, col): (usize, usize)) -> &f32

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<(usize, usize)> for Matrix44f

Source§

fn index_mut(&mut self, (row, col): (usize, usize)) -> &mut f32

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl Mul for Matrix44f

Source§

type Output = Matrix44f

The resulting type after applying the * operator.
Source§

fn mul(self, other: Matrix44f) -> Matrix44f

Performs the * operation. Read more
Source§

impl Mul<f32> for Matrix44f

Source§

type Output = Matrix44f

The resulting type after applying the * operator.
Source§

fn mul(self, scalar: f32) -> Matrix44f

Performs the * operation. Read more
Source§

impl PartialEq for Matrix44f

Source§

fn eq(&self, other: &Matrix44f) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Matrix44f

Source§

impl Sub for Matrix44f

Source§

type Output = Matrix44f

The resulting type after applying the - operator.
Source§

fn sub(self, other: Matrix44f) -> Matrix44f

Performs the - operation. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.