pub struct Matrix4 {
pub data: [[f64; 4]; 4],
}Expand description
4x4 Matrix (column-major)
Fields§
§data: [[f64; 4]; 4]Column-major data: columns[col][row]
Implementations§
Source§impl Matrix4
impl Matrix4
Sourcepub fn scale_uniform(scale: f64) -> Self
pub fn scale_uniform(scale: f64) -> Self
Create uniform scale matrix
Sourcepub fn perspective(fov_y_rad: f64, aspect: f64, near: f64, far: f64) -> Self
pub fn perspective(fov_y_rad: f64, aspect: f64, near: f64, far: f64) -> Self
Create perspective projection matrix
Sourcepub fn orthographic(
left: f64,
right: f64,
bottom: f64,
top: f64,
near: f64,
far: f64,
) -> Self
pub fn orthographic( left: f64, right: f64, bottom: f64, top: f64, near: f64, far: f64, ) -> Self
Create orthographic projection matrix
Sourcepub fn transform_point(&self, point: Vector3) -> Vector3
pub fn transform_point(&self, point: Vector3) -> Vector3
Transform a point (w=1)
Sourcepub fn transform_direction(&self, dir: Vector3) -> Vector3
pub fn transform_direction(&self, dir: Vector3) -> Vector3
Transform a direction (w=0)
Sourcepub fn transform_vector4(&self, v: Vector4) -> Vector4
pub fn transform_vector4(&self, v: Vector4) -> Vector4
Transform a Vector4
Sourcepub fn determinant(&self) -> f64
pub fn determinant(&self) -> f64
Determinant of matrix
Trait Implementations§
impl Copy for Matrix4
impl StructuralPartialEq for Matrix4
Auto Trait Implementations§
impl Freeze for Matrix4
impl RefUnwindSafe for Matrix4
impl Send for Matrix4
impl Sync for Matrix4
impl Unpin for Matrix4
impl UnwindSafe for Matrix4
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.