pub struct Matrix4 {
pub data: [[f64; 4]; 4],
}
Expand description
Matrix4, a matrix with 4 rows and columns
Fields§
§data: [[f64; 4]; 4]
Implementations§
Source§impl Matrix4
impl Matrix4
Sourcepub fn translation(x: f64, y: f64, z: f64) -> Matrix4
pub fn translation(x: f64, y: f64, z: f64) -> Matrix4
Creates a new matrix which applies translation
Sourcepub fn rotation_axis<N>(axis: &N, r: Rad) -> Matrix4where
N: IsNormalized3D,
pub fn rotation_axis<N>(axis: &N, r: Rad) -> Matrix4where
N: IsNormalized3D,
Creates a new matrix which applies rotation around an axis
Sourcepub fn perspective(close: f64, away: f64, fov: Rad) -> Matrix4
pub fn perspective(close: f64, away: f64, fov: Rad) -> Matrix4
Creates a new matrix which applies perspective transformation
Sourcepub fn look_at<P, N>(target: &P, up: &N) -> Result<Matrix4>where
P: IsBuildable3D,
N: IsNormalized3D,
pub fn look_at<P, N>(target: &P, up: &N) -> Result<Matrix4>where
P: IsBuildable3D,
N: IsNormalized3D,
Creates a new matrix which applies a look at transformation
Trait Implementations§
Source§impl PartialOrd for Matrix4
impl PartialOrd 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 more