Matrix3x2
struct · ferroui-base · v0.5.0
struct Matrix3x2
A 3x2 matrix (a two-dimensional affine transform).
Members
m11m12m21m22m31m32IDENTITYnewis_identitytranslationset_translationcreate_rotationcreate_rotation_atcreate_scalecreate_scale_xycreate_scale_uniformcreate_scale_atcreate_skewcreate_skew_atcreate_translationcreate_translation_xyget_determinantinvertinvert_or_nanlerp
m11
m11: f32
The first element of the first row.
m12
m12: f32
The second element of the first row.
m21
m21: f32
The first element of the second row.
m22
m22: f32
The second element of the second row.
m31
m31: f32
The first element of the third row.
m32
m32: f32
The second element of the third row.
IDENTITY
const IDENTITY: Matrix3x2
The multiplicative identity matrix.
new
const fn new(m11: f32, m12: f32, m21: f32, m22: f32, m31: f32, m32: f32) -> Self
Creates a 3x2 matrix from the specified components.
is_identity
fn is_identity(self: &Self) -> bool
Gets a value that indicates whether the current matrix is the identity matrix.
translation
fn translation(self: &Self) -> Vector2
Gets the translation component of this matrix.
set_translation
fn set_translation(self: &mut Self, value: Vector2)
Sets the translation component of this matrix.
create_rotation
fn create_rotation(radians: f32) -> Matrix3x2
Creates a rotation matrix using the given rotation in radians.
create_rotation_at
fn create_rotation_at(radians: f32, center_point: Vector2) -> Matrix3x2
Creates a rotation matrix using the specified rotation in radians and a center point.
create_scale
fn create_scale(scales: Vector2) -> Matrix3x2
Creates a scaling matrix from the specified vector scale.
create_scale_xy
fn create_scale_xy(x_scale: f32, y_scale: f32) -> Matrix3x2
Creates a scaling matrix from the specified X and Y components.
create_scale_uniform
fn create_scale_uniform(scale: f32) -> Matrix3x2
Creates a scaling matrix that scales uniformly with the given scale.
create_scale_at
fn create_scale_at(scales: Vector2, center_point: Vector2) -> Matrix3x2
Creates a scaling matrix from the specified vector scale with an offset from the specified center point.
create_skew
fn create_skew(radians_x: f32, radians_y: f32) -> Matrix3x2
Creates a skew matrix from the specified angles in radians.
create_skew_at
fn create_skew_at(radians_x: f32, radians_y: f32, center_point: Vector2) -> Matrix3x2
Creates a skew matrix from the specified angles in radians and a center point.
create_translation
fn create_translation(position: Vector2) -> Matrix3x2
Creates a translation matrix from the specified 2-dimensional vector.
create_translation_xy
fn create_translation_xy(x_position: f32, y_position: f32) -> Matrix3x2
Creates a translation matrix from the specified X and Y components.
get_determinant
fn get_determinant(self: &Self) -> f32
Calculates the determinant for this matrix.
invert
fn invert(matrix: Matrix3x2) -> Option<Matrix3x2>
Tries to invert the specified matrix. Returns None when the matrix is
singular; see Matrix3x2::invert_or_nan for the value the reference
runtime stores in that case.
invert_or_nan
fn invert_or_nan(matrix: Matrix3x2) -> Matrix3x2
Inverts the specified matrix; a singular matrix gives a matrix whose
components are all NaN (the out value of the reference runtime).
lerp
fn lerp(matrix1: Matrix3x2, matrix2: Matrix3x2, amount: f32) -> Matrix3x2
Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafePropertyValueAnyValueClassDefaultsBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>AnyToOwnedToStringErasedDestructorIntoEitherCloneCopyDebugStructuralPartialEqPartialEqDefaultAddSubNegMulMul<f32>DisplayFrom<Matrix3x2>ExpressionVariantValueBatchValue
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.