#[repr(C, align(16))]pub struct Mat4 {
pub x_axis: Vec4,
pub y_axis: Vec4,
pub z_axis: Vec4,
pub w_axis: Vec4,
}Expand description
A SIMD-aligned column-major 4×4 matrix.
Fields§
§x_axis: Vec4First column.
y_axis: Vec4Second column.
z_axis: Vec4Third column.
w_axis: Vec4Fourth column.
Implementations§
Source§impl Mat4
impl Mat4
Sourcepub const fn from_cols(
x_axis: Vec4,
y_axis: Vec4,
z_axis: Vec4,
w_axis: Vec4,
) -> Self
pub const fn from_cols( x_axis: Vec4, y_axis: Vec4, z_axis: Vec4, w_axis: Vec4, ) -> Self
Builds from columns.
Sourcepub fn from_cols_array(value: &[f32; 16]) -> Self
pub fn from_cols_array(value: &[f32; 16]) -> Self
Builds from column-major elements.
Sourcepub fn to_cols_array(self) -> [f32; 16]
pub fn to_cols_array(self) -> [f32; 16]
Returns column-major elements.
Sourcepub fn to_cols_array_2d(self) -> [[f32; 4]; 4]
pub fn to_cols_array_2d(self) -> [[f32; 4]; 4]
Returns a column-major nested array.
Sourcepub fn from_translation(value: Vec3) -> Self
pub fn from_translation(value: Vec3) -> Self
Translation matrix.
Sourcepub fn from_rotation_y(angle: f32) -> Self
pub fn from_rotation_y(angle: f32) -> Self
Rotation around Y.
Sourcepub fn from_scale_rotation_translation(
scale: Vec3,
rotation: Quat,
translation: Vec3,
) -> Self
pub fn from_scale_rotation_translation( scale: Vec3, rotation: Quat, translation: Vec3, ) -> Self
Scale, rotation and translation matrix.
Sourcepub fn transform_point3(self, point: Vec3) -> Vec3
pub fn transform_point3(self, point: Vec3) -> Vec3
Transforms a point.
Sourcepub fn transform_vector3(self, vector: Vec3) -> Vec3
pub fn transform_vector3(self, vector: Vec3) -> Vec3
Transforms a direction.
Sourcepub fn determinant(self) -> f32
pub fn determinant(self) -> f32
Determinant.
Trait Implementations§
impl Copy for Mat4
Source§impl<'de> Deserialize<'de> for Mat4
impl<'de> Deserialize<'de> for Mat4
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
impl Pod for Mat4
impl StructuralPartialEq for Mat4
Auto Trait Implementations§
impl Freeze for Mat4
impl RefUnwindSafe for Mat4
impl Send for Mat4
impl Sync for Mat4
impl Unpin for Mat4
impl UnsafeUnpin for Mat4
impl UnwindSafe for Mat4
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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.Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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