Navigation
API > API/Runtime > API/Runtime/Core
Transform calculus for 2D types. UE4 already has a 2D Vector class that we will adapt to be interpreted as a translate transform. The rest we create new classes for.
The following types are supported
- float/double -> represents a uniform scale.
- FScale2D -> represents a 2D non-uniform scale.
- FVector2D -> represents a 2D translation.
- FShear2D -> represents a "2D shear", interpreted as a shear parallel to the X axis followed by a shear parallel to the Y axis.
- FQuat2D -> represents a pure 2D rotation.
- FMatrix2x2 -> represents a general 2D transform.
2x2 generalized matrix. As FMatrix, we assume row vectors, row major storage: [X Y] * [m00 m01] [m10 m11]
| Name | TMatrix2x2 |
| Type | class |
| Header File | /Engine/Source/Runtime/Core/Public/Math/TransformCalculus2D.h |
| Include Path | #include "Math/TransformCalculus2D.h" |
Syntax
template<typename T>
class TMatrix2x2
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TMatrix2x2
(
const TQuat2< T >& Rotation |
Ctor. initialize from a rotation. | Math/TransformCalculus2D.h | |
TMatrix2x2 () |
Ctor. initialize to an identity. | Math/TransformCalculus2D.h | |
TMatrix2x2
(
T UniformScale |
Ctor. initialize from a scale. | Math/TransformCalculus2D.h | |
TMatrix2x2
(
const TScale2< T >& Scale |
Ctor. initialize from a scale. | Math/TransformCalculus2D.h | |
TMatrix2x2
(
const TShear2< T >& Shear |
Factory function. initialize from a 2D shear. | Math/TransformCalculus2D.h | |
TMatrix2x2
(
T m00, |
Math/TransformCalculus2D.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FReal | T | Math/TransformCalculus2D.h | |
| Vector2Type | UE::Math::TVector2< T > | Math/TransformCalculus2D.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| M | T | Math/TransformCalculus2D.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TMatrix2x2 Concatenate
(
const TMatrix2x2& RHS |
Concatenate 2 matrices: [A B] * [E F] == [AE+BG AF+BH] [C D] [G H] [CE+DG CF+DH] | Math/TransformCalculus2D.h | |
bool ContainsNaN() |
Math/TransformCalculus2D.h | ||
T Determinant() |
Math/TransformCalculus2D.h | ||
void DiagnosticCheckNaN() |
Math/TransformCalculus2D.h | ||
void GetMatrix
(
double& A, |
Math/TransformCalculus2D.h | ||
void GetMatrix
(
float& A, |
Math/TransformCalculus2D.h | ||
T GetRotationAngle() |
Gets the rotation angle of the matrix. | Math/TransformCalculus2D.h | |
TScale2< T > GetScale() |
Gets the scale from the matrix. | Math/TransformCalculus2D.h | |
TScale2< T > GetScaleSquared() |
Extracts the squared scale from the matrix (avoids sqrt). | Math/TransformCalculus2D.h | |
TMatrix2x2 Inverse() |
Invert the transform. | Math/TransformCalculus2D.h | |
T InverseDeterminant() |
Math/TransformCalculus2D.h | ||
bool IsIdentity () |
Determines if the matrix is identity or not. | Math/TransformCalculus2D.h | |
bool IsNearlyIdentity
(
T ErrorTolerance |
Math/TransformCalculus2D.h | ||
UE::Math::TVector2< ArgType > TransformPoint
(
const UE::Math::TVector2< ArgType >& Point |
Transform a 2D point [X Y] * [m00 m01] [m10 m11] | Math/TransformCalculus2D.h | |
UE::Math::TVector2< ArgType > TransformVector
(
const UE::Math::TVector2< ArgType >& Vector |
Vector transformation is equivalent to point transformation as our matrix is not homogeneous. | Math/TransformCalculus2D.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
bool operator!=
(
const TMatrix2x2& Other |
Inequality. | Math/TransformCalculus2D.h | |
bool operator==
(
const TMatrix2x2& RHS |
Equality. | Math/TransformCalculus2D.h |