FMatrix2x2

2x2 generalized matrix.

Windows
MacOS
Linux

References

Module

Core

Header

/Engine/Source/Runtime/Core/Public/Math/TransformCalculus2D.h

Include

#include "Math/TransformCalculus2D.h"

Syntax

class FMatrix2x2

Remarks

2x2 generalized matrix. As FMatrix, we assume row vectors, row major storage: [X Y] * [m00 m01] [m10 m11]

Constructors

Name Description

Public function

FMatrix2x2()

  1. initialize to an identity.

Public function

FMatrix2x2

(
    float UniformScale
)

  1. initialize from a scale.

Public function

FMatrix2x2

(
    const FScale2D& Scale
)

  1. initialize from a scale.

Public function

FMatrix2x2

(
    const FShear2D& Shear
)

Factory function. initialize from a 2D shear.

Public function

FMatrix2x2

(
    const FQuat2D& Rotation
)

  1. initialize from a rotation.

Public function

FMatrix2x2

(
    float m00,
    float m01,
    float m10,
    float m11
)

Functions

Name Description

Public function Const

FMatrix2x2

 

Concatenate

(
    const FMatrix2x2& RHS
)

Concatenate 2 matrices: [A B] * [E F] == [AE+BG AF+BH] [C D] [G H] [CE+DG CF+DH]

Public function Const

float

 

Determinant()

Public function Const

void

 

GetMatrix

(
    float& A,
    float& B,
    float& C,
    float& D
)

Public function Const

float

 

GetRotationAngle()

Gets the rotation angle of the matrix.

Public function Const

FScale2D

 

GetScale()

Gets the scale from the matrix.

Public function Const

FScale2D

 

GetScaleSquared()

Extracts the squared scale from the matrix (avoids sqrt).

Public function Const

FMatrix2x2

 

Inverse()

Invert the transform.

Public function Const

float

 

InverseDeterminant()

Public function Const

bool

 

IsIdentity()

Determines if the matrix is identity or not.

Public function Const

bool

 

IsNearlyIdentity

(
    float ErrorTolerance
)

Public function Const

FVector2D

 

TransformPoint

(
    const FVector2D& Point
)

Transform a 2D point [X Y] * [m00 m01] [m10 m11]

Public function Const

FVector2D

 

TransformVector

(
    const FVector2D& Vector
)

Vector transformation is equivalent to point transformation as our matrix is not homogeneous.

Operators

Name Description

Public function Const

bool

 

operator!=

(
    const FMatrix2x2& Other
)

Inequality.

Public function Const

bool

 

operator==

(
    const FMatrix2x2& RHS
)

Equality.

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss