TMat4x4

Struct TMat4x4 

Source
#[repr(C, align(16))]
pub struct TMat4x4<T: Real> { /* private fields */ }
Expand description

A column major 4x4 floating point matrix

Implementations§

Source§

impl<T: Real> TMat4x4<T>

Source

pub fn new(input: [T; 16]) -> TMat4x4<T>

Construct a new 4x4 matrix from a flat array of 16 elements

Source

pub fn zero() -> TMat4x4<T>

Construct a new 4x4 matrix of entirely zeroes

Source

pub fn identity() -> TMat4x4<T>

Construct a new 4x4 identity matrix

Source

pub fn perspective(aspect: T, fov: T, near: T, far: T) -> TMat4x4<T>

Construct a new Vulkan compatible perspective transform matrix

Source

pub fn translation(translation: TVec3<T>) -> TMat4x4<T>

Construct a new translation matrix with the given translation

Source

pub fn translate(&mut self, translation: TVec3<T>)

Apply a translation to this matrix

Source

pub fn rotation(angle: T, axis: TVec3<T>) -> TMat4x4<T>

Get an angle axis rotation matrix

Source

pub fn rotate(&mut self, angle: T, in_axis: TVec3<T>)

Apply an angle axis rotation to this matrix

Source

pub fn scaling(scale: TVec3<T>) -> TMat4x4<T>

Get a scaling matrix

Source

pub fn scale(&mut self, scale: TVec3<T>)

Apply scaling to the matrix

Source

pub fn from_columns( col0: [T; 4], col1: [T; 4], col2: [T; 4], col3: [T; 4], ) -> Self

Construct a new matrix from the four columns passed into the function

Source

pub fn apply(&self, vec: TVec4<T>) -> TVec4<T>

Apply this matrix to a vector, creating a new one in the process

Source

pub fn apply_to(&self, rhs: &mut TVec4<T>)

Apply a matrix to the given vector

Source

pub fn multiply(&mut self, rhs: &TMat4x4<T>)

Multiply the given matrix onto this matrix

Trait Implementations§

Source§

impl<T: Real> Add for TMat4x4<T>

Source§

type Output = TMat4x4<T>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: TMat4x4<T>) -> Self::Output

Performs the + operation. Read more
Source§

impl<T: Real> AddAssign for TMat4x4<T>

Source§

fn add_assign(&mut self, rhs: TMat4x4<T>)

Performs the += operation. Read more
Source§

impl<T: Clone + Real> Clone for TMat4x4<T>

Source§

fn clone(&self) -> TMat4x4<T>

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<T: Real> Column for TMat4x4<T>

Source§

type Output = TVec4<T>

Source§

fn get_column(&self, col: usize) -> Self::Output

Get a copy of a given column of a matrix
Source§

impl<T: Real> ColumnRef for TMat4x4<T>

Source§

fn get_column_ref(&self, col: usize) -> &Self::Output

Get a reference to a given column of a matrix
Source§

impl<T: Real> ColumnRefMut for TMat4x4<T>

Source§

fn get_column_ref_mut(&mut self, col: usize) -> &mut Self::Output

Get a mutable reference to a given column of a matrix
Source§

impl<T: Debug + Real> Debug for TMat4x4<T>

Source§

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

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

impl<T: Real> Display for TMat4x4<T>

Source§

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

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

impl<T: Real> Div for TMat4x4<T>

Source§

type Output = TMat4x4<T>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: TMat4x4<T>) -> Self::Output

Performs the / operation. Read more
Source§

impl<T: Real> DivAssign for TMat4x4<T>

Source§

fn div_assign(&mut self, rhs: TMat4x4<T>)

Performs the /= operation. Read more
Source§

impl<T: Real> From<&[T; 16]> for TMat4x4<T>

Source§

fn from(other: &[T; 16]) -> Self

Converts to this type from the input type.
Source§

impl<T: Real> From<TMat4x4<T>> for TMat4x4P<T>

Source§

fn from(other: TMat4x4<T>) -> Self

Converts to this type from the input type.
Source§

impl<T: Real> Index<(usize, usize)> for TMat4x4<T>

Source§

fn index(&self, index: (usize, usize)) -> &Self::Output

Index the matrix. (row, column)

Source§

type Output = T

The returned type after indexing.
Source§

impl<T: Real> Index<usize> for TMat4x4<T>

Source§

fn index(&self, index: usize) -> &Self::Output

Index the matrix linearly

Source§

type Output = T

The returned type after indexing.
Source§

impl<T: Real> IndexMut<(usize, usize)> for TMat4x4<T>

Source§

fn index_mut(&mut self, index: (usize, usize)) -> &mut Self::Output

Index the matrix. (row, column)

Source§

impl<T: Real> IndexMut<usize> for TMat4x4<T>

Source§

fn index_mut(&mut self, index: usize) -> &mut Self::Output

Index the matrix linearly

Source§

impl<T: Real> Into<[T; 16]> for TMat4x4<T>

Source§

fn into(self) -> [T; 16]

Converts this type into the (usually inferred) input type.
Source§

impl<T: Real> Into<TMat4x4<T>> for TQuat<T>

Source§

fn into(self) -> TMat4x4<T>

Converts this type into the (usually inferred) input type.
Source§

impl<T: Real> IntoSTD140 for TMat4x4<T>

Source§

impl<T: Real> Inverse for TMat4x4<T>

Source§

fn inverse(self) -> Self

Source§

impl<T: Real> InverseAssign for TMat4x4<T>

Source§

impl<T: Real> Mul<T> for TMat4x4<T>

Source§

type Output = TMat4x4<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: T) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Real> Mul<TVec4<T>> for TMat4x4<T>

Source§

type Output = TVec4<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: TVec4<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Real> Mul for TMat4x4<T>

Source§

type Output = TMat4x4<T>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: TMat4x4<T>) -> Self::Output

Performs the * operation. Read more
Source§

impl<T: Real> MulAssign<T> for TMat4x4<T>

Source§

fn mul_assign(&mut self, rhs: T)

Performs the *= operation. Read more
Source§

impl<T: Real> MulAssign for TMat4x4<T>

Source§

fn mul_assign(&mut self, rhs: TMat4x4<T>)

Performs the *= operation. Read more
Source§

impl<T: Real> PartialEq for TMat4x4<T>

Source§

fn eq(&self, other: &TMat4x4<T>) -> bool

Tests for self and other values to be equal, and is used by ==.
Source§

fn ne(&self, other: &TMat4x4<T>) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Real> Row for TMat4x4<T>

Source§

type Output = TVec4<T>

Source§

fn get_row(&self, row: usize) -> Self::Output

Get a copy of a given row of a matrix
Source§

impl<T: Real> Sub for TMat4x4<T>

Source§

type Output = TMat4x4<T>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: TMat4x4<T>) -> Self::Output

Performs the - operation. Read more
Source§

impl<T: Real> SubAssign for TMat4x4<T>

Source§

fn sub_assign(&mut self, rhs: TMat4x4<T>)

Performs the -= operation. Read more
Source§

impl<T: Real> Transpose for TMat4x4<T>

Source§

fn transpose(self) -> Self

Source§

impl<T: Real> TransposeAssign for TMat4x4<T>

Auto Trait Implementations§

§

impl<T> Freeze for TMat4x4<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for TMat4x4<T>
where T: RefUnwindSafe,

§

impl<T> Send for TMat4x4<T>
where T: Send,

§

impl<T> Sync for TMat4x4<T>
where T: Sync,

§

impl<T> Unpin for TMat4x4<T>
where T: Unpin,

§

impl<T> UnwindSafe for TMat4x4<T>
where T: UnwindSafe,

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.