Struct slender_math::Matrix2x3
source · #[repr(C, align(8))]pub struct Matrix2x3(_);Expand description
Column-major 2x3 matrix, indexed as [row, column]
Implementations§
source§impl Matrix2x3
impl Matrix2x3
sourcepub const fn new(e00: f32, e10: f32, e01: f32, e11: f32, e02: f32, e12: f32) -> Self
pub const fn new(e00: f32, e10: f32, e01: f32, e11: f32, e02: f32, e12: f32) -> Self
Creates a new matrix from individual elements
sourcepub const fn from_array(array: [[f32; 2]; 3]) -> Self
pub const fn from_array(array: [[f32; 2]; 3]) -> Self
Creates a new matrix from the given array
sourcepub fn is_identity(&self, epsilon: f32) -> bool
pub fn is_identity(&self, epsilon: f32) -> bool
Checks whether this matrix is the identity matrix, up to a certain error
sourcepub fn translation_x(translation: f32) -> Self
pub fn translation_x(translation: f32) -> Self
Creates a matrix representing a translation along the X axis
sourcepub fn translation_y(translation: f32) -> Self
pub fn translation_y(translation: f32) -> Self
Creates a matrix representing a translation along the Y axis
sourcepub fn translation(translation: Vector2f) -> Self
pub fn translation(translation: Vector2f) -> Self
Creates a matrix representing a translation
sourcepub fn from_scale_rotation_translation(
scale: Vector2f,
rotation: f32,
translation: Vector2f
) -> Self
pub fn from_scale_rotation_translation( scale: Vector2f, rotation: f32, translation: Vector2f ) -> Self
Creates a matrix representing a transformation specified by scale, rotation and translation, applied in that order
sourcepub fn determinant(&self) -> f32
pub fn determinant(&self) -> f32
Calculates the determinant of this matrix
sourcepub fn lerp(lhs: &Self, rhs: &Self, t: f32) -> Self
pub fn lerp(lhs: &Self, rhs: &Self, t: f32) -> Self
Linearily interpolates between this matrix and rhs
sourcepub fn mul_no_translate(&self, rhs: Vector2f) -> Vector2f
pub fn mul_no_translate(&self, rhs: Vector2f) -> Vector2f
Multiples the matrix with a vector while not applying translation
sourcepub fn to_matrix4x4(&self) -> Matrix4x4
pub fn to_matrix4x4(&self) -> Matrix4x4
Converts the matrix into a 4x4 matrix
Trait Implementations§
source§impl PartialEq<Matrix2x3> for Matrix2x3
impl PartialEq<Matrix2x3> for Matrix2x3
impl Copy for Matrix2x3
impl Pod for Matrix2x3
impl StructuralPartialEq for Matrix2x3
Auto Trait Implementations§
impl RefUnwindSafe for Matrix2x3
impl Send for Matrix2x3
impl Sync for Matrix2x3
impl Unpin for Matrix2x3
impl UnwindSafe for Matrix2x3
Blanket Implementations§
source§impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere T: AnyBitPattern,
§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.