FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    Matrix3x2

    struct · ferroui-base · v0.5.0

    struct Matrix3x2
    

    A 3x2 matrix (a two-dimensional affine transform).

    View source

    Members

    m11

    m11: f32
    

    The first element of the first row.

    Source

    m12

    m12: f32
    

    The second element of the first row.

    Source

    m21

    m21: f32
    

    The first element of the second row.

    Source

    m22

    m22: f32
    

    The second element of the second row.

    Source

    m31

    m31: f32
    

    The first element of the third row.

    Source

    m32

    m32: f32
    

    The second element of the third row.

    Source

    IDENTITY

    const IDENTITY: Matrix3x2
    

    The multiplicative identity matrix.

    Source

    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.

    Source

    is_identity

    fn is_identity(self: &Self) -> bool
    

    Gets a value that indicates whether the current matrix is the identity matrix.

    Source

    translation

    fn translation(self: &Self) -> Vector2
    

    Gets the translation component of this matrix.

    Source

    set_translation

    fn set_translation(self: &mut Self, value: Vector2)
    

    Sets the translation component of this matrix.

    Source

    create_rotation

    fn create_rotation(radians: f32) -> Matrix3x2
    

    Creates a rotation matrix using the given rotation in radians.

    Source

    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.

    Source

    create_scale

    fn create_scale(scales: Vector2) -> Matrix3x2
    

    Creates a scaling matrix from the specified vector scale.

    Source

    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.

    Source

    create_scale_uniform

    fn create_scale_uniform(scale: f32) -> Matrix3x2
    

    Creates a scaling matrix that scales uniformly with the given scale.

    Source

    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.

    Source

    create_skew

    fn create_skew(radians_x: f32, radians_y: f32) -> Matrix3x2
    

    Creates a skew matrix from the specified angles in radians.

    Source

    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.

    Source

    create_translation

    fn create_translation(position: Vector2) -> Matrix3x2
    

    Creates a translation matrix from the specified 2-dimensional vector.

    Source

    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.

    Source

    get_determinant

    fn get_determinant(self: &Self) -> f32
    

    Calculates the determinant for this matrix.

    Source

    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.

    Source

    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).

    Source

    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.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Default
    • Add
    • Sub
    • Neg
    • Mul
    • Mul<f32>
    • Display
    • From<Matrix3x2>
    • ExpressionVariantValue
    • BatchValue

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.