#[repr(C)]pub struct Mat4<T: Float = f32> {
pub m: [[T; 4]; 4],
}Expand description
A packed 4×4 row-major matrix.
Fields§
§m: [[T; 4]; 4]Implementations§
Source§impl<T: Float> Mat4<T>
impl<T: Float> Mat4<T>
pub fn is_identity(self, tolerance: T) -> bool
pub fn try_view_from_pose( position: Vec3<T>, rotation: Quat<T>, tolerance: T, ) -> Option<Self>
pub fn try_look_at( eye: Vec3<T>, target: Vec3<T>, world_up: Vec3<T>, tolerance: T, ) -> Option<Self>
pub fn compose_affine(decomposition: AffineDecomposition<T>) -> Option<Self>
pub fn try_decompose_affine( self, tolerance: T, ) -> Option<AffineDecomposition<T>>
pub fn try_decompose_trs(self, tolerance: T) -> Option<TrsDecomposition<T>>
Source§impl<T: Float> Mat4<T>
impl<T: Float> Mat4<T>
pub fn identity() -> Self
pub fn is_finite(self) -> bool
pub fn transpose(self) -> Self
pub fn determinant(self) -> T
pub fn try_inverse(self, tolerance: T) -> Option<Self>
pub fn linear_part(self) -> Mat3<T>
pub fn translation_part(self) -> Vec3<T>
pub fn new_from_affine(linear: Mat3<T>, translation: Vec3<T>) -> Self
pub fn is_affine(self, tolerance: T) -> bool
pub fn try_affine_inverse(self, tolerance: T) -> Option<Self>
pub fn try_normal_matrix(self, tolerance: T) -> Option<Mat3<T>>
pub fn transform(self, value: Vec4<T>) -> Vec4<T>
pub fn transform_point(self, point: Vec3<T>) -> Vec3<T>
pub fn transform_direction(self, direction: Vec3<T>) -> Vec3<T>
pub fn try_project_point(self, point: Vec3<T>, tolerance: T) -> Option<Vec3<T>>
pub fn try_transform_normal( self, normal: Vec3<T>, tolerance: T, ) -> Option<Vec3<T>>
pub fn translation(value: Vec3<T>) -> Self
pub fn scaling(value: Vec3<T>) -> Self
pub fn try_from_quaternion(rotation: Quat<T>) -> Option<Self>
pub fn try_compose_trs( translation: Vec3<T>, rotation: Quat<T>, scale: Vec3<T>, ) -> Option<Self>
pub fn approximately_equal(self, other: Self, absolute: T, relative: T) -> bool
Source§impl<T: Float> Mat4<T>
impl<T: Float> Mat4<T>
pub fn try_perspective_off_center( left: T, right: T, bottom: T, top: T, near: T, far: T, ) -> Option<Self>
pub fn try_perspective( fov_y_degrees: T, aspect: T, near: T, far: T, ) -> Option<Self>
pub fn try_perspective_shifted( fov_y_degrees: T, aspect: T, near: T, far: T, ndc_offset: Vec2<T>, ) -> Option<Self>
pub fn try_orthographic_off_center( left: T, right: T, bottom: T, top: T, near: T, far: T, ) -> Option<Self>
pub fn try_orthographic( width: T, height: T, near: T, far: T, zoom: T, ) -> Option<Self>
pub fn try_orthographic_shifted( width: T, height: T, near: T, far: T, zoom: T, ndc_offset: Vec2<T>, ) -> Option<Self>
pub fn try_perspective_reverse_z( fov_y_degrees: T, aspect: T, near: T, far: T, ) -> Option<Self>
pub fn try_perspective_reverse_z_infinite( fov_y_degrees: T, aspect: T, near: T, ) -> Option<Self>
Trait Implementations§
Source§impl<T: Float> AddAssign for Mat4<T>
impl<T: Float> AddAssign for Mat4<T>
Source§fn add_assign(&mut self, other: Self)
fn add_assign(&mut self, other: Self)
Performs the
+= operation. Read moreimpl<T: Copy + Float> Copy for Mat4<T>
Source§impl<T: Float> DivAssign<T> for Mat4<T>
impl<T: Float> DivAssign<T> for Mat4<T>
Source§fn div_assign(&mut self, scalar: T)
fn div_assign(&mut self, scalar: T)
Performs the
/= operation. Read moreSource§impl<T: Float> MulAssign for Mat4<T>
impl<T: Float> MulAssign for Mat4<T>
Source§fn mul_assign(&mut self, other: Self)
fn mul_assign(&mut self, other: Self)
Performs the
*= operation. Read moreSource§impl<T: Float> MulAssign<T> for Mat4<T>
impl<T: Float> MulAssign<T> for Mat4<T>
Source§fn mul_assign(&mut self, scalar: T)
fn mul_assign(&mut self, scalar: T)
Performs the
*= operation. Read moreimpl<T: PartialEq + Float> StructuralPartialEq for Mat4<T>
Auto Trait Implementations§
impl<T> Forget for Mat4<T>
impl<T> Freeze for Mat4<T>where
T: Freeze,
impl<T> Move for Mat4<T>
impl<T> RefUnwindSafe for Mat4<T>where
T: RefUnwindSafe,
impl<T> Send for Mat4<T>where
T: Send,
impl<T> Sync for Mat4<T>where
T: Sync,
impl<T> Unpin for Mat4<T>where
T: Unpin,
impl<T> UnsafeUnpin for Mat4<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Mat4<T>where
T: UnwindSafe,
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