Struct Matrix4

Source
pub struct Matrix4 {
Show 16 fields pub xx: f64, pub xy: f64, pub xz: f64, pub xw: f64, pub yx: f64, pub yy: f64, pub yz: f64, pub yw: f64, pub zx: f64, pub zy: f64, pub zz: f64, pub zw: f64, pub wx: f64, pub wy: f64, pub wz: f64, pub ww: f64,
}
Expand description

4x4 matrix

Fields§

§xx: f64§xy: f64§xz: f64§xw: f64§yx: f64§yy: f64§yz: f64§yw: f64§zx: f64§zy: f64§zz: f64§zw: f64§wx: f64§wy: f64§wz: f64§ww: f64

Implementations§

Source§

impl Matrix4

Source

pub const fn new( xx: f64, xy: f64, xz: f64, xw: f64, yx: f64, yy: f64, yz: f64, yw: f64, zx: f64, zy: f64, zz: f64, zw: f64, wx: f64, wy: f64, wz: f64, ww: f64, ) -> Self

Trait Implementations§

Source§

impl Add for Matrix4

Source§

type Output = Matrix4

The resulting type after applying the + operator.
Source§

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

Performs the + operation. Read more
Source§

impl AddAssign for Matrix4

Source§

fn add_assign(&mut self, rhs: Matrix4)

Performs the += operation. Read more
Source§

impl Algebra<Matrix4> for Matrix4

Source§

fn determinant(&self) -> f64

Get the determinant of the matrix
Source§

fn set_inverse(&mut self) -> &mut Self

Set inverse matrix
Source§

fn set_transposed(&mut self) -> &mut Self

Set transposed matrix
Source§

fn set_adjugate(&mut self) -> &mut Self

Set adjugate matrix
Source§

fn inverse(&self) -> Self

Get the inverse matrix
Source§

fn transposed(&self) -> Self

Get the transposed matrix
Source§

fn adjugate(&self) -> Self

Get the adjugate matrix
Source§

impl BitOr for Matrix4

Source§

type Output = f64

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Matrix4) -> Self::Output

Performs the | operation. Read more
Source§

impl Clone for Matrix4

Source§

fn clone(&self) -> Matrix4

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 Debug for Matrix4

Source§

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

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

impl Div<f64> for Matrix4

Source§

type Output = Matrix4

The resulting type after applying the / operator.
Source§

fn div(self, rhs: f64) -> Self::Output

Performs the / operation. Read more
Source§

impl DivAssign<f64> for Matrix4

Source§

fn div_assign(&mut self, rhs: f64)

Performs the /= operation. Read more
Source§

impl From<f64> for Matrix4

Source§

fn from(s: f64) -> Self

Converts to this type from the input type.
Source§

impl Initializer for Matrix4

Source§

fn zeros() -> Self

Object filled with zeros
Source§

fn ones() -> Self

Object filled with ones
Source§

impl Interpolation for Matrix4

Source§

fn set_lerp(&mut self, other: &Self, s: f64) -> &mut Self

Set the linear interpolation
Source§

fn set_herp( &mut self, other: &Self, other1: &Self, other2: &Self, s: f64, ) -> &mut Self

Set the Hermite’s interpolation
Source§

fn set_berp( &mut self, other: &Self, other1: &Self, other2: &Self, s: f64, ) -> &mut Self

Set the Bezier’s interpolation
Source§

fn lerp(&self, other: &Self, s: f64) -> Self
where Self: Copy + Clone,

Get linear interpolation
Source§

fn herp(&mut self, other: &Self, other1: &Self, other2: &Self, s: f64) -> Self
where Self: Copy + Clone,

Get cubic Hermite’s interpolation, ie. with two tangent values
Source§

fn berp(&mut self, other: &Self, other1: &Self, other2: &Self, s: f64) -> Self
where Self: Copy + Clone,

Get cubic Bezier’s interpolation, ie. with two control points
Source§

impl Metric for Matrix4

Source§

fn dot(&self, rhs: &Self) -> f64

Dot product of the two objects
Source§

fn magnitude2(&self) -> f64

Squared magnitude of an object
Source§

fn magnitude(&self) -> f64

Magnitude of an object
Source§

fn distance2(&self, rhs: &Self) -> f64

Squared distance between the two objects
Source§

fn distance(&self, rhs: &Self) -> f64

Distance between the two objects
Source§

fn set_normalized(&mut self) -> &mut Self

Normalizes the vector, ie. sets magnitude to 1 without changing direction
Source§

fn normalized(&self) -> Self

Get the normalized vector, ie. vector with same direction and magnitude 1
Source§

impl Mul<Vector3> for Matrix4

Source§

type Output = Vector3

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<Vector4> for Matrix4

Source§

type Output = Vector4

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul<f64> for Matrix4

Source§

type Output = Matrix4

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl Mul for Matrix4

Source§

type Output = Matrix4

The resulting type after applying the * operator.
Source§

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

Performs the * operation. Read more
Source§

impl MulAssign<Matrix4> for Vector3

Source§

fn mul_assign(&mut self, rhs: Matrix4)

Performs the *= operation. Read more
Source§

impl MulAssign<Matrix4> for Vector4

Source§

fn mul_assign(&mut self, rhs: Matrix4)

Performs the *= operation. Read more
Source§

impl MulAssign<f64> for Matrix4

Source§

fn mul_assign(&mut self, rhs: f64)

Performs the *= operation. Read more
Source§

impl MulAssign for Matrix4

Source§

fn mul_assign(&mut self, rhs: Matrix4)

Performs the *= operation. Read more
Source§

impl Neg for Matrix4

Source§

type Output = Matrix4

The resulting type after applying the - operator.
Source§

fn neg(self) -> Self::Output

Performs the unary - operation. Read more
Source§

impl Not for Matrix4

Source§

type Output = f64

The resulting type after applying the ! operator.
Source§

fn not(self) -> Self::Output

Performs the unary ! operation. Read more
Source§

impl PartialEq for Matrix4

Source§

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

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

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

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

impl Rem for Matrix4

Source§

type Output = f64

The resulting type after applying the % operator.
Source§

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

Performs the % operation. Read more
Source§

impl Reset<Matrix4> for Matrix4

Source§

fn reset0(&mut self) -> &mut Self

Fills an object with zeros
Source§

fn reset1(&mut self) -> &mut Self

Fills a object with ones
Source§

fn reset(&mut self, val: &Matrix4) -> &mut Self

Fills a object with a given value
Source§

impl Rigid<Matrix3, Vector3> for Matrix4

Source§

fn set_rigid(&mut self, rotation: &Matrix3, vector: &Vector3) -> &mut Self

Set a rigid body matrix from the given rotation matrix and translation vector
Source§

fn from_rigid(rotation: &U, vector: &T) -> Self

Get a rigid body matrix from rotation matrix and translation vector
Source§

impl Rows<[Vector4; 4]> for Matrix4

Source§

fn rows(&self) -> [Vector4; 4]

Get the rows of a matrix
Source§

fn set_rows(&mut self, rows: &[Vector4; 4]) -> &mut Self

Set the rows of a matrix
Source§

fn from_rows(rows: &T) -> Self

Get a matrix from rows array
Source§

impl Similarity<Matrix3, Vector3> for Matrix4

Source§

fn set_similarity( &mut self, scale: f64, rotation: &Matrix3, vector: &Vector3, ) -> &mut Self

Set a similarity matrix from scale factor, rotation matrix and translation vector
Source§

fn from_similarity(scale: f64, rotation: &U, vector: &T) -> Self

Get a similarity matrix from scale factor, rotation matrix and translation vector
Source§

impl Sub for Matrix4

Source§

type Output = Matrix4

The resulting type after applying the - operator.
Source§

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

Performs the - operation. Read more
Source§

impl SubAssign for Matrix4

Source§

fn sub_assign(&mut self, rhs: Matrix4)

Performs the -= operation. Read more
Source§

impl Translation<Vector3> for Matrix4

Source§

fn set_translation(&mut self, vector: &Vector3) -> &mut Self

Set a translation matrix from translation vector
Source§

fn from_translation(vector: &T) -> Self

Get a translation matrix from translation vector
Source§

impl Copy for Matrix4

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.