|
| template<typename VType = float> |
| | TTransform2 (const UE::Math::TVector2< VType > &Translation=UE::Math::TVector2< VType >(0.f, 0.f)) |
| |
| template<typename VType = float> |
| | TTransform2 (T UniformScale, const UE::Math::TVector2< VType > &Translation=UE::Math::TVector2< VType >(0.f, 0.f)) |
| |
| template<typename VType = float> |
| | TTransform2 (const TScale2< T > &Scale, const UE::Math::TVector2< VType > &Translation=UE::Math::TVector2< VType >(0.f, 0.f)) |
| |
| template<typename VType = float> |
| | TTransform2 (const TShear2< T > &Shear, const UE::Math::TVector2< VType > &Translation=UE::Math::TVector2< VType >(0.f, 0.f)) |
| |
| template<typename VType = float> |
| | TTransform2 (const TQuat2< T > &Rot, const UE::Math::TVector2< VType > &Translation=UE::Math::TVector2< VType >(0.f, 0.f)) |
| |
| template<typename VType = float> |
| | TTransform2 (const TMatrix2x2< T > &Transform, const UE::Math::TVector2< VType > &Translation=UE::Math::TVector2< VType >(0.f, 0.f)) |
| |
| template<typename VType > |
| UE::Math::TVector2< VType > | TransformPoint (const UE::Math::TVector2< VType > &Point) const |
| |
| template<typename VType > |
| UE::Math::TVector2< VType > | TransformVector (const UE::Math::TVector2< VType > &Vector) const |
| |
| TTransform2 | Concatenate (const TTransform2 &RHS) const |
| |
| TTransform2 | Inverse () const |
| |
| bool | operator== (const TTransform2 &Other) const |
| |
| bool | operator!= (const TTransform2 &Other) const |
| |
| const Matrix2Type & | GetMatrix () const |
| |
| const FVector2D | GetTranslation () const |
| |
| template<typename VType > |
| void | SetTranslation (const UE::Math::TVector2< VType > &InTrans) |
| |
| bool | IsIdentity () const |
| |
| UE::Math::TMatrix< T > | To3DMatrix () const |
| |
| bool | ContainsNaN () const |
| |
template<
typename T>
class TTransform2< T >
Support for generalized 2D affine transforms. Implemented as a 2x2 transform followed by translation. In matrix form: [A B 0] [C D 0] [X Y 1]
Inverts a transform. So a transform from space A to space B results in a transform from space B to space A. Since this class applies the 2x2 transform followed by translation, our inversion logic needs to be able to recast the result as a M * T. It does it using the following identity: (M * T)^-1 == T^-1 * M^-1
In homogeneous form, we represent our affine transform like so: M * T [A B 0] [1 0 0] [A B 0] [C D 0] * [0 1 0] = [C D 0]. This class simply decomposes the 2x2 transform and translation. [0 0 1] [X Y 1] [X Y 1]
But if we were applying the transforms in reverse order (as we need to for the inverse identity above): T^-1 * M^-1 [1 0 0] [A B 0] [A B 0] where [X' Y'] = [X Y] * [A B] [0 1 0] * [C D 0] = [C D 0] [C D] [X Y 1] [0 0 1] [X' Y' 1]
This can be conceptualized by seeing that a translation effectively defines a new local origin for that frame of reference. Since there is a 2x2 transform AFTER that, the concatenated frame of reference has an origin that is the old origin transformed by the 2x2 transform.
In the last equation: We know that [X Y] is the translation induced by inverting T, or -Translate. We know that [[A B][C D]] == Inverse(M), so we can represent T^-1 * M^-1 as M'* T' where: M' == Inverse(M) T' == Inverse(Translate) * Inverse(M)