engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 所有成员列表
FTransform2D类 参考

Support for generalized 2D affine transforms. 更多...

#include <TransformCalculus2D.h>

Public 成员函数

FTransform2D Concatenate (const FTransform2D &RHS) const
 Concatenates two transforms. 更多...
 
 FTransform2D (const FMatrix2x2 &Transform, const FVector2D &Translation=FVector2D(0.f, 0.f))
 Initialize the transform using a general 2x2 transform and a translation.
 
 FTransform2D (const FQuat2D &Rot, const FVector2D &Translation=FVector2D(0.f, 0.f))
 Initialize the transform using a 2D rotation and a translation.
 
 FTransform2D (const FScale2D &Scale, const FVector2D &Translation=FVector2D(0.f, 0.f))
 Initialize the transform using a 2D scale and a translation.
 
 FTransform2D (const FShear2D &Shear, const FVector2D &Translation=FVector2D(0.f, 0.f))
 Initialize the transform using a 2D shear and a translation.
 
 FTransform2D (const FVector2D &Translation=FVector2D(0.f, 0.f))
 Initialize the transform using an identity matrix and a translation.
 
 FTransform2D (float UniformScale, const FVector2D &Translation=FVector2D(0.f, 0.f))
 Initialize the transform using a uniform scale and a translation.
 
const FMatrix2x2 & GetMatrix () const
 Access to the 2x2 transform
 
const FVector2D & GetTranslation () const
 Access to the translation
 
FTransform2D Inverse () const
 Inverts a transform. 更多...
 
bool IsIdentity () const
 Specialized function to determine if a transform is precisely the identity transform. 更多...
 
bool operator!= (const FTransform2D &Other) const
 Inequality.
 
bool operator== (const FTransform2D &Other) const
 Equality.
 
FMatrix To3DMatrix () const
 Converts this affine 2D Transform into an affine 3D transform.
 
FVector2D TransformPoint (const FVector2D &Point) const
 2D transformation of a point. 更多...
 
FVector2D TransformVector (const FVector2D &Vector) const
 2D transformation of a vector. 更多...
 

详细描述

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]

成员函数说明

◆ Concatenate()

FTransform2D FTransform2D::Concatenate ( const FTransform2D &  RHS) const
inline

Concatenates two transforms.

Result is equivalent to transforming first by this, followed by RHS. Concat(A,B) == (P * MA + TA) * MB + TB == (P * MA * MB) + TA*MB + TB NewM == MA * MB NewT == TA * MB + TB

◆ Inverse()

FTransform2D FTransform2D::Inverse ( ) const
inline

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)

◆ IsIdentity()

bool FTransform2D::IsIdentity ( ) const
inline

Specialized function to determine if a transform is precisely the identity transform.

Uses exact float comparison, so rounding error is not considered.

◆ TransformPoint()

FVector2D FTransform2D::TransformPoint ( const FVector2D &  Point) const
inline

2D transformation of a point.

Transforms position, rotation, and scale.

◆ TransformVector()

FVector2D FTransform2D::TransformVector ( const FVector2D &  Vector) const
inline

2D transformation of a vector.

Transforms rotation and scale.


该类的文档由以下文件生成: