UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
TMatrix2x2< T > Class Template Reference

#include <TransformCalculus2D.h>

Public Types

using FReal = T
 
using Vector2Type = UE::Math::TVector2< T >
 

Public Member Functions

 TMatrix2x2 ()
 
 TMatrix2x2 (T m00, T m01, T m10, T m11)
 
 TMatrix2x2 (T UniformScale)
 
 TMatrix2x2 (const TScale2< T > &Scale)
 
 TMatrix2x2 (const TShear2< T > &Shear)
 
 TMatrix2x2 (const TQuat2< T > &Rotation)
 
template<typename ArgType >
UE::Math::TVector2< ArgTypeTransformPoint (const UE::Math::TVector2< ArgType > &Point) const
 
template<typename ArgType >
UE::Math::TVector2< ArgTypeTransformVector (const UE::Math::TVector2< ArgType > &Vector) const
 
TMatrix2x2 Concatenate (const TMatrix2x2 &RHS) const
 
TMatrix2x2 Inverse () const
 
bool operator== (const TMatrix2x2 &RHS) const
 
bool operator!= (const TMatrix2x2 &Other) const
 
void GetMatrix (float &A, float &B, float &C, float &D) const
 
void GetMatrix (double &A, double &B, double &C, double &D) const
 
Determinant () const
 
InverseDeterminant () const
 
TScale2< T > GetScaleSquared () const
 
TScale2< T > GetScale () const
 
GetRotationAngle () const
 
bool IsIdentity () const
 
bool IsNearlyIdentity (T ErrorTolerance=UE_KINDA_SMALL_NUMBER) const
 
bool ContainsNaN () const
 
UE_FORCEINLINE_HINT void DiagnosticCheckNaN () const
 

Detailed Description

template<typename T>
class TMatrix2x2< T >

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

Member Typedef Documentation

◆ FReal

template<typename T >
using TMatrix2x2< T >::FReal = T

◆ Vector2Type

template<typename T >
using TMatrix2x2< T >::Vector2Type = UE::Math::TVector2<T>

Constructor & Destructor Documentation

◆ TMatrix2x2() [1/6]

template<typename T >
TMatrix2x2< T >::TMatrix2x2 ( )
inline

Ctor. initialize to an identity.

◆ TMatrix2x2() [2/6]

template<typename T >
TMatrix2x2< T >::TMatrix2x2 ( m00,
m01,
m10,
m11 
)
inline

◆ TMatrix2x2() [3/6]

template<typename T >
TMatrix2x2< T >::TMatrix2x2 ( UniformScale)
inlineexplicit

Ctor. initialize from a scale.

◆ TMatrix2x2() [4/6]

template<typename T >
TMatrix2x2< T >::TMatrix2x2 ( const TScale2< T > &  Scale)
inlineexplicit

Ctor. initialize from a scale.

◆ TMatrix2x2() [5/6]

template<typename T >
TMatrix2x2< T >::TMatrix2x2 ( const TShear2< T > &  Shear)
inlineexplicit

Factory function. initialize from a 2D shear.

◆ TMatrix2x2() [6/6]

template<typename T >
TMatrix2x2< T >::TMatrix2x2 ( const TQuat2< T > &  Rotation)
inlineexplicit

Ctor. initialize from a rotation.

Member Function Documentation

◆ Concatenate()

template<typename T >
TMatrix2x2 TMatrix2x2< T >::Concatenate ( const TMatrix2x2< T > &  RHS) const
inline

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

◆ ContainsNaN()

template<typename T >
bool TMatrix2x2< T >::ContainsNaN ( ) const
inline

◆ Determinant()

template<typename T >
T TMatrix2x2< T >::Determinant ( ) const
inline

◆ DiagnosticCheckNaN()

template<typename T >
UE_FORCEINLINE_HINT void TMatrix2x2< T >::DiagnosticCheckNaN ( ) const
inline

◆ GetMatrix() [1/2]

template<typename T >
void TMatrix2x2< T >::GetMatrix ( double A,
double B,
double C,
double D 
) const
inline

◆ GetMatrix() [2/2]

template<typename T >
void TMatrix2x2< T >::GetMatrix ( float A,
float B,
float C,
float D 
) const
inline

◆ GetRotationAngle()

template<typename T >
T TMatrix2x2< T >::GetRotationAngle ( ) const
inline

Gets the rotation angle of the matrix.

◆ GetScale()

template<typename T >
TScale2< T > TMatrix2x2< T >::GetScale ( ) const
inline

Gets the scale from the matrix.

◆ GetScaleSquared()

template<typename T >
TScale2< T > TMatrix2x2< T >::GetScaleSquared ( ) const
inline

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

◆ Inverse()

template<typename T >
TMatrix2x2 TMatrix2x2< T >::Inverse ( ) const
inline

Invert the transform.

◆ InverseDeterminant()

template<typename T >
T TMatrix2x2< T >::InverseDeterminant ( ) const
inline

◆ IsIdentity()

template<typename T >
bool TMatrix2x2< T >::IsIdentity ( ) const
inline

Determines if the matrix is identity or not. Uses exact float comparison, so rounding error is not considered.

◆ IsNearlyIdentity()

template<typename T >
bool TMatrix2x2< T >::IsNearlyIdentity ( ErrorTolerance = UE_KINDA_SMALL_NUMBER) const
inline

◆ operator!=()

template<typename T >
bool TMatrix2x2< T >::operator!= ( const TMatrix2x2< T > &  Other) const
inline

Inequality.

◆ operator==()

template<typename T >
bool TMatrix2x2< T >::operator== ( const TMatrix2x2< T > &  RHS) const
inline

Equality.

◆ TransformPoint()

template<typename T >
template<typename ArgType >
UE::Math::TVector2< ArgType > TMatrix2x2< T >::TransformPoint ( const UE::Math::TVector2< ArgType > &  Point) const
inline

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

◆ TransformVector()

template<typename T >
template<typename ArgType >
UE::Math::TVector2< ArgType > TMatrix2x2< T >::TransformVector ( const UE::Math::TVector2< ArgType > &  Vector) const
inline

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


The documentation for this class was generated from the following file: