#[repr(C)]pub struct Mat4<T> {
pub x_axis: Vec4<T>,
pub y_axis: Vec4<T>,
pub z_axis: Vec4<T>,
pub w_axis: Vec4<T>,
}Expand description
A 4x4 column major matrix.
Fields§
§x_axis: Vec4<T>§y_axis: Vec4<T>§z_axis: Vec4<T>§w_axis: Vec4<T>Implementations§
Source§impl<T: Copy + AbsDiffEq<Epsilon = T>> Mat4<T>
impl<T: Copy + AbsDiffEq<Epsilon = T>> Mat4<T>
Sourcepub fn abs_diff_eq(&self, other: &Self) -> bool
pub fn abs_diff_eq(&self, other: &Self) -> bool
Returns true if the two values are approximately equal according to the absolute difference between their components.
Source§impl<T: Copy + RelativeEq<Epsilon = T>> Mat4<T>
impl<T: Copy + RelativeEq<Epsilon = T>> Mat4<T>
Sourcepub fn relative_eq(&self, other: &Self) -> bool
pub fn relative_eq(&self, other: &Self) -> bool
Returns true if the two values are approximately equal according to the absolute difference between their components, as well as relative-based comparisons.
Source§impl<T: Float> Mat4<T>
impl<T: Float> Mat4<T>
Sourcepub fn axis_angle(axis: impl Into<Vec3<T>>, angle: impl Angle<T>) -> Self
pub fn axis_angle(axis: impl Into<Vec3<T>>, angle: impl Angle<T>) -> Self
Create a matrix representing a rotation around an axis.
Sourcepub fn rotation_x(angle: impl Angle<T>) -> Self
pub fn rotation_x(angle: impl Angle<T>) -> Self
Create a matrix rotating around the x-axis.
Sourcepub fn rotation_y(angle: impl Angle<T>) -> Self
pub fn rotation_y(angle: impl Angle<T>) -> Self
Create a matrix rotation around the y-axis.
Sourcepub fn rotation_z(angle: impl Angle<T>) -> Self
pub fn rotation_z(angle: impl Angle<T>) -> Self
Create a matrix rotating around the z-axis.
Sourcepub fn determinant(&self) -> T
pub fn determinant(&self) -> T
Returns the determinant.
Sourcepub fn ortho(left: T, right: T, bottom: T, top: T, z_near: T, z_far: T) -> Self
pub fn ortho(left: T, right: T, bottom: T, top: T, z_near: T, z_far: T) -> Self
Creates an orthographic perspective matrix.
Sourcepub fn ortho_size(size: impl Into<Vec2<T>>) -> Self
pub fn ortho_size(size: impl Into<Vec2<T>>) -> Self
Creates an orthographic perspective matrix with the size.
Sourcepub fn transform_pos2(&self, rhs: Vec2<T>) -> Vec2<T>
pub fn transform_pos2(&self, rhs: Vec2<T>) -> Vec2<T>
Transforms a 2D point.
Sourcepub fn transform_vec2(&self, rhs: Vec2<T>) -> Vec2<T>
pub fn transform_vec2(&self, rhs: Vec2<T>) -> Vec2<T>
Transforms a 2D vector.
Sourcepub fn transform_vec3(&self, rhs: Vec3<T>) -> Vec3<T>
pub fn transform_vec3(&self, rhs: Vec3<T>) -> Vec3<T>
Transforms a 3D vector.
Sourcepub fn transform_pos3(&self, rhs: Vec3<T>) -> Vec3<T>
pub fn transform_pos3(&self, rhs: Vec3<T>) -> Vec3<T>
Transforms a 3D point.
Sourcepub fn transform_vec4(&self, rhs: Vec4<T>) -> Vec4<T>
pub fn transform_vec4(&self, rhs: Vec4<T>) -> Vec4<T>
Transforms a 4D vector.
Trait Implementations§
Source§impl<T> AbsDiffEq for Mat4<T>
impl<T> AbsDiffEq for Mat4<T>
Source§fn default_epsilon() -> Self::Epsilon
fn default_epsilon() -> Self::Epsilon
The default tolerance to use when testing values that are close together. Read more
Source§fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
fn abs_diff_eq(&self, other: &Self, epsilon: Self::Epsilon) -> bool
A test for equality that uses the absolute difference to compute the approximate
equality of two numbers.
Source§fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
fn abs_diff_ne(&self, other: &Rhs, epsilon: Self::Epsilon) -> bool
The inverse of
AbsDiffEq::abs_diff_eq.Source§impl<'de, T: Deserialize<'de>> Deserialize<'de> for Mat4<T>
impl<'de, T: Deserialize<'de>> Deserialize<'de> for Mat4<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Copy + DivAssign<T>> DivAssign<&T> for Mat4<T>
impl<T: Copy + DivAssign<T>> DivAssign<&T> for Mat4<T>
Source§fn div_assign(&mut self, rhs: &T)
fn div_assign(&mut self, rhs: &T)
Performs the
/= operation. Read moreSource§impl<T: Copy + DivAssign<T>> DivAssign<T> for Mat4<T>
impl<T: Copy + DivAssign<T>> DivAssign<T> for Mat4<T>
Source§fn div_assign(&mut self, rhs: T)
fn div_assign(&mut self, rhs: T)
Performs the
/= operation. Read moreSource§impl<T: Copy + MulAssign<T>> MulAssign<&T> for Mat4<T>
impl<T: Copy + MulAssign<T>> MulAssign<&T> for Mat4<T>
Source§fn mul_assign(&mut self, rhs: &T)
fn mul_assign(&mut self, rhs: &T)
Performs the
*= operation. Read moreSource§impl<T: Copy + MulAssign<T>> MulAssign<T> for Mat4<T>
impl<T: Copy + MulAssign<T>> MulAssign<T> for Mat4<T>
Source§fn mul_assign(&mut self, rhs: T)
fn mul_assign(&mut self, rhs: T)
Performs the
*= operation. Read moreSource§impl<T: Numeric<AsU8 = u8, AsU16 = u16, AsU32 = u32, AsU64 = u64, AsU128 = u128, AsUSize = usize, AsI8 = i8, AsI16 = i16, AsI32 = i32, AsI64 = i64, AsI128 = i128, AsISize = isize, AsF32 = f32, AsF64 = f64>> Numeric for Mat4<T>
impl<T: Numeric<AsU8 = u8, AsU16 = u16, AsU32 = u32, AsU64 = u64, AsU128 = u128, AsUSize = usize, AsI8 = i8, AsI16 = i16, AsI32 = i32, AsI64 = i64, AsI128 = i128, AsISize = isize, AsF32 = f32, AsF64 = f64>> Numeric for Mat4<T>
type AsU8 = Mat4<u8>
type AsU16 = Mat4<u16>
type AsU32 = Mat4<u32>
type AsU64 = Mat4<u64>
type AsU128 = Mat4<u128>
type AsUSize = Mat4<usize>
type AsI8 = Mat4<i8>
type AsI16 = Mat4<i16>
type AsI32 = Mat4<i32>
type AsI64 = Mat4<i64>
type AsI128 = Mat4<i128>
type AsISize = Mat4<isize>
type AsF32 = Mat4<f32>
type AsF64 = Mat4<f64>
fn to_u8(self) -> Mat4<u8>
fn to_u16(self) -> Mat4<u16>
fn to_u32(self) -> Mat4<u32>
fn to_u64(self) -> Mat4<u64>
fn to_u128(self) -> Mat4<u128>
fn to_usize(self) -> Mat4<usize>
fn to_i8(self) -> Mat4<i8>
fn to_i16(self) -> Mat4<i16>
fn to_i32(self) -> Mat4<i32>
fn to_i64(self) -> Mat4<i64>
fn to_i128(self) -> Mat4<i128>
fn to_isize(self) -> Mat4<isize>
fn to_f32(self) -> Mat4<f32>
fn to_f64(self) -> Mat4<f64>
Source§impl<T: Ord> Ord for Mat4<T>
impl<T: Ord> Ord for Mat4<T>
Source§impl<T: PartialOrd> PartialOrd for Mat4<T>
impl<T: PartialOrd> PartialOrd for Mat4<T>
Source§impl<T> RelativeEq for Mat4<T>
impl<T> RelativeEq for Mat4<T>
Source§fn default_max_relative() -> Self::Epsilon
fn default_max_relative() -> Self::Epsilon
The default relative tolerance for testing values that are far-apart. Read more
Source§fn relative_eq(
&self,
other: &Self,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_eq( &self, other: &Self, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
A test for equality that uses a relative comparison if the values are far apart.
Source§fn relative_ne(
&self,
other: &Rhs,
epsilon: Self::Epsilon,
max_relative: Self::Epsilon,
) -> bool
fn relative_ne( &self, other: &Rhs, epsilon: Self::Epsilon, max_relative: Self::Epsilon, ) -> bool
The inverse of
RelativeEq::relative_eq.Source§impl<T: Copy + RemAssign<T>> RemAssign<&T> for Mat4<T>
impl<T: Copy + RemAssign<T>> RemAssign<&T> for Mat4<T>
Source§fn rem_assign(&mut self, rhs: &T)
fn rem_assign(&mut self, rhs: &T)
Performs the
%= operation. Read moreSource§impl<T: Copy + RemAssign<T>> RemAssign<T> for Mat4<T>
impl<T: Copy + RemAssign<T>> RemAssign<T> for Mat4<T>
Source§fn rem_assign(&mut self, rhs: T)
fn rem_assign(&mut self, rhs: T)
Performs the
%= operation. Read moreSource§impl<T> UlpsEq for Mat4<T>
impl<T> UlpsEq for Mat4<T>
impl<T: Copy> Copy for Mat4<T>
impl<T: Eq> Eq for Mat4<T>
impl<T: Pod> Pod for Mat4<T>
impl<T> StructuralPartialEq for Mat4<T>
Auto Trait Implementations§
impl<T> Freeze for Mat4<T>where
T: Freeze,
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> 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
Source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.