Struct oxygen_quark::matrix::matrix4x4::Matrix4x4
source · Fields§
§data: [Fraction; 16]
The matrix data.
Implementations§
source§impl Matrix4x4
impl Matrix4x4
sourcepub fn new_from_value(value: Fraction) -> Matrix4x4
pub fn new_from_value(value: Fraction) -> Matrix4x4
Generates a new Matrix4x4
from the Fraction
specified.
sourcepub fn new_from_values(values: &[Fraction]) -> Matrix4x4
pub fn new_from_values(values: &[Fraction]) -> Matrix4x4
Generates a new Matrix4x4
from a list of Fraction
values.
sourcepub fn scale(&self, scale: Fraction) -> Matrix4x4
pub fn scale(&self, scale: Fraction) -> Matrix4x4
Scales the given Matrix4x4
by the given Fraction
.
sourcepub fn adjugate(&self) -> Matrix4x4
pub fn adjugate(&self) -> Matrix4x4
Returns the adjugate of the Matrix4x4
.
Equal to calling cofactor() and then transpose().
sourcepub fn determinant(&self) -> Fraction
pub fn determinant(&self) -> Fraction
Calculates the determinant of the Matrix4x4
and returns it, a Fraction
.
sourcepub fn inverse(&self) -> Option<Matrix4x4>
pub fn inverse(&self) -> Option<Matrix4x4>
Returns an Option<Matrix4x4>
.
It returns an Option<Matrix4x4>
because there won’t always be an inverse (if the determinant is 0
), hence requires some extra checking.
Panics
Panics when trying to unwrap()
a None
-value.
sourcepub fn transform_vector3d(&self, other: &Vector3D) -> Vector3D
pub fn transform_vector3d(&self, other: &Vector3D) -> Vector3D
Transforms a Vector3D
with the Matrix4x4
and returns the result, a Vector3D
.
Trait Implementations§
source§impl AddAssign<Matrix4x4> for Matrix4x4
impl AddAssign<Matrix4x4> for Matrix4x4
source§fn add_assign(&mut self, other: Matrix4x4)
fn add_assign(&mut self, other: Matrix4x4)
Performs the
+=
operation. Read moresource§impl MulAssign<Matrix4x4> for Matrix4x4
impl MulAssign<Matrix4x4> for Matrix4x4
source§fn mul_assign(&mut self, other: Matrix4x4)
fn mul_assign(&mut self, other: Matrix4x4)
Performs the
*=
operation. Read moresource§impl SubAssign<Matrix4x4> for Matrix4x4
impl SubAssign<Matrix4x4> for Matrix4x4
source§fn sub_assign(&mut self, other: Matrix4x4)
fn sub_assign(&mut self, other: Matrix4x4)
Performs the
-=
operation. Read more