Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
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 FQuat2D &Rotation)
 
template<typename ArgType >
UE::Math::TVector2< ArgType > TransformPoint (const UE::Math::TVector2< ArgType > &Point) const
 
template<typename ArgType >
UE::Math::TVector2< ArgType > TransformVector (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
 
T Determinant () const
 
T InverseDeterminant () const
 
TScale2< TGetScaleSquared () const
 
TScale2< TGetScale () const
 
T GetRotationAngle () const
 
bool IsIdentity () const
 
bool IsNearlyIdentity (T ErrorTolerance=UE_KINDA_SMALL_NUMBER) const
 

Private Attributes

T M [2][2]
 

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]

Definition at line 395 of file TransformCalculus2D.h.

Member Typedef Documentation

◆ FReal

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

Definition at line 400 of file TransformCalculus2D.h.

◆ Vector2Type

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

Definition at line 401 of file TransformCalculus2D.h.

Constructor & Destructor Documentation

◆ TMatrix2x2() [1/6]

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

Ctor. initialize to an identity.

Definition at line 404 of file TransformCalculus2D.h.

◆ TMatrix2x2() [2/6]

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

Definition at line 410 of file TransformCalculus2D.h.

◆ TMatrix2x2() [3/6]

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

Ctor. initialize from a scale.

Definition at line 418 of file TransformCalculus2D.h.

◆ TMatrix2x2() [4/6]

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

Ctor. initialize from a scale.

Definition at line 425 of file TransformCalculus2D.h.

◆ TMatrix2x2() [5/6]

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

Factory function. initialize from a 2D shear.

Definition at line 434 of file TransformCalculus2D.h.

◆ TMatrix2x2() [6/6]

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

Ctor. initialize from a rotation.

Definition at line 443 of file TransformCalculus2D.h.

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]

Definition at line 476 of file TransformCalculus2D.h.

◆ Determinant()

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

Definition at line 531 of file TransformCalculus2D.h.

◆ GetMatrix() [1/2]

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

Definition at line 525 of file TransformCalculus2D.h.

◆ GetMatrix() [2/2]

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

Definition at line 519 of file TransformCalculus2D.h.

◆ GetRotationAngle()

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

Gets the rotation angle of the matrix.

Definition at line 561 of file TransformCalculus2D.h.

◆ GetScale()

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

Gets the scale from the matrix.

Definition at line 554 of file TransformCalculus2D.h.

◆ GetScaleSquared()

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

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

Definition at line 546 of file TransformCalculus2D.h.

◆ Inverse()

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

Invert the transform.

Definition at line 489 of file TransformCalculus2D.h.

◆ InverseDeterminant()

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

Definition at line 538 of file TransformCalculus2D.h.

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

Definition at line 569 of file TransformCalculus2D.h.

◆ IsNearlyIdentity()

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

Definition at line 575 of file TransformCalculus2D.h.

◆ operator!=()

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

Inequality.

Definition at line 514 of file TransformCalculus2D.h.

◆ operator==()

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

Equality.

Definition at line 500 of file TransformCalculus2D.h.

◆ 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]

Definition at line 457 of file TransformCalculus2D.h.

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

Definition at line 467 of file TransformCalculus2D.h.

Member Data Documentation

◆ M

template<typename T >
T TMatrix2x2< T >::M[2][2]
private

Definition at line 585 of file TransformCalculus2D.h.


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