Skip to main content

Mat4x4

Struct Mat4x4 

Source
#[repr(C)]
pub struct Mat4x4<T> { pub x: Vec4<T>, pub y: Vec4<T>, pub z: Vec4<T>, pub w: Vec4<T>, }
Expand description

Matrix with 4 columns and 4 rows.

The matrix is stored column-major; that is, each field is a whole column of the matrix.

Fields§

§x: Vec4<T>§y: Vec4<T>§z: Vec4<T>§w: Vec4<T>

Implementations§

Source§

impl<T> Mat4x4<T>

Source

pub fn new( x_column: Vec4<T>, y_column: Vec4<T>, z_column: Vec4<T>, w_column: Vec4<T>, ) -> Self

Source

pub fn transpose(self) -> Mat4x4<T>

Trait Implementations§

Source§

impl<T> Add for Mat4x4<T>
where Vec4<T>: Add<Output = Vec4<T>>,

Source§

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

Performs component-wise addition.

Source§

type Output = Mat4x4<T>

The resulting type after applying the + operator.
Source§

impl<T: Clone> Clone for Mat4x4<T>

Source§

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

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<T: Debug> Debug for Mat4x4<T>

Source§

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

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

impl<T: Default> Default for Mat4x4<T>

Source§

fn default() -> Mat4x4<T>

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

impl<T: Hash> Hash for Mat4x4<T>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<T> Index<i32> for Mat4x4<T>

Source§

type Output = Vec4<T>

The returned type after indexing.
Source§

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

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

impl<T> Index<u32> for Mat4x4<T>

Source§

type Output = Vec4<T>

The returned type after indexing.
Source§

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

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

impl<T> Index<usize> for Mat4x4<T>

Source§

type Output = Vec4<T>

The returned type after indexing.
Source§

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

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

impl<T> IndexMut<i32> for Mat4x4<T>

Source§

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

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

impl<T> IndexMut<u32> for Mat4x4<T>

Source§

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

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

impl<T> IndexMut<usize> for Mat4x4<T>

Source§

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

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

impl Mul<Mat2x4<f32>> for Mat4x4<f32>

Source§

fn mul(self, rhs: Mat2x4<f32>) -> Self::Output

Performs matrix multiplication.

Source§

type Output = Mat2x4<f32>

The resulting type after applying the * operator.
Source§

impl Mul<Mat3x4<f32>> for Mat4x4<f32>

Source§

fn mul(self, rhs: Mat3x4<f32>) -> Self::Output

Performs matrix multiplication.

Source§

type Output = Mat3x4<f32>

The resulting type after applying the * operator.
Source§

impl<T> Mul<Mat4x4<T>> for Scalar<T>
where Scalar<T>: Mul<Vec4<T>, Output = Vec4<T>>, T: Copy,

Source§

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

Performs component-wise multiplication by a scalar.

Source§

type Output = Mat4x4<T>

The resulting type after applying the * operator.
Source§

impl<T> Mul<Mat4x4<T>> for Vec4<T>
where Scalar<T>: Mul<Output = Scalar<T>> + ConstZero, T: Copy,

Source§

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

Multiplication with vector on the left and matrix on the right.

Source§

type Output = Vec4<T>

The resulting type after applying the * operator.
Source§

impl Mul<Mat4x4<f32>> for Mat4x2<f32>

Source§

fn mul(self, rhs: Mat4x4<f32>) -> Self::Output

Performs matrix multiplication.

Source§

type Output = Mat4x2<f32>

The resulting type after applying the * operator.
Source§

impl Mul<Mat4x4<f32>> for Mat4x3<f32>

Source§

fn mul(self, rhs: Mat4x4<f32>) -> Self::Output

Performs matrix multiplication.

Source§

type Output = Mat4x3<f32>

The resulting type after applying the * operator.
Source§

impl<T> Mul<Scalar<T>> for Mat4x4<T>
where Vec4<T>: Mul<Scalar<T>, Output = Vec4<T>>, T: Copy,

Source§

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

Performs component-wise multiplication by a scalar.

Source§

type Output = Mat4x4<T>

The resulting type after applying the * operator.
Source§

impl<T> Mul<Vec4<T>> for Mat4x4<T>
where Scalar<T>: Mul<Output = Scalar<T>> + ConstZero, T: Copy,

Source§

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

Multiplication with matrix on the left and vector on the right.

Source§

type Output = Vec4<T>

The resulting type after applying the * operator.
Source§

impl Mul for Mat4x4<f32>

Source§

fn mul(self, rhs: Mat4x4<f32>) -> Self::Output

Performs matrix multiplication.

Source§

type Output = Mat4x4<f32>

The resulting type after applying the * operator.
Source§

impl<T: PartialEq> PartialEq for Mat4x4<T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

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

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

impl<T> Sub for Mat4x4<T>
where Vec4<T>: Sub<Output = Vec4<T>>,

Source§

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

Performs component-wise subtraction.

Source§

type Output = Mat4x4<T>

The resulting type after applying the - operator.
Source§

impl<T: Copy> Copy for Mat4x4<T>

Source§

impl<T: Eq> Eq for Mat4x4<T>

Source§

impl<T> StructuralPartialEq for Mat4x4<T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

impl<T> UnsafeUnpin for Mat4x4<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for Mat4x4<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, 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.