engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | 静态 Public 属性 | Protected 属性 | 所有成员列表
FTransform结构体 参考

Transform composed of Scale, Rotation (as a quaternion), and Translation. 更多...

#include <TransformNonVectorized.h>

被 Chaos::TRigidTransform< float, 2 > , 以及 Chaos::TRigidTransform< float, 3 > 继承.

Public 成员函数

FORCEINLINE void Accumulate (const FTransform &Atom, float BlendWeight)
 Accumulates another transform with this one, with a blending weight 更多...
 
FORCEINLINE void Accumulate (const FTransform &SourceAtom)
 Accumulates another transform with this one 更多...
 
FORCEINLINE void AccumulateWithAdditiveScale (const FTransform &Atom, float BlendWeight)
 Accumulates another transform with this one, with a blending weight 更多...
 
FORCEINLINE void AccumulateWithShortestRotation (const FTransform &DeltaAtom, float BlendWeight)
 Accumulates another transform with this one, with an optional blending weight 更多...
 
FORCEINLINE void AddToTranslation (const FVector &DeltaTranslation)
 Adjusts the translation component of this transformation 更多...
 
FORCEINLINE void Blend (const FTransform &Atom1, const FTransform &Atom2, float Alpha)
 Set this transform to the weighted blend of the supplied two transforms.
 
FORCEINLINE void BlendWith (const FTransform &OtherAtom, float Alpha)
 Set this Transform to the weighted blend of it and the supplied Transform.
 
FORCEINLINE void ConcatenateRotation (const FQuat &DeltaRotation)
 Concatenates another rotation to this transformation 更多...
 
bool ContainsNaN () const
 Checks the components for non-finite values (NaN or Inf). 更多...
 
FORCEINLINE void CopyRotation (const FTransform &Other)
 Copy rotation from another FTransform.
 
FORCEINLINE void CopyRotationPart (const FTransform &SrcBA)
 Sets the Rotation and Scale3D of this transformation from another transform 更多...
 
FORCEINLINE void CopyScale3D (const FTransform &Other)
 Copy scale from another FTransform.
 
FORCEINLINE void CopyTranslation (const FTransform &Other)
 Copy translation from another FTransform.
 
FORCEINLINE void CopyTranslationAndScale3D (const FTransform &SrcBA)
 Sets the Translation and Scale3D of this transformation from another transform 更多...
 
bool DebugEqualMatrix (const FMatrix &Matrix) const
 Debug purpose only
 
CORE_API void DebugPrint () const
 Does a debugf of the contents of this Transform.
 
FORCEINLINE FTransform ()
 Default constructor.
 
FORCEINLINE FTransform (const FMatrix &InMatrix)
 Constructor for converting a Matrix (including scale) into a FTransform.
 
FORCEINLINE FTransform (const FQuat &InRotation)
 Constructor with an initial rotation 更多...
 
FORCEINLINE FTransform (const FQuat &InRotation, const FVector &InTranslation, const FVector &InScale3D=FVector::OneVector)
 Constructor with all components initialized 更多...
 
FORCEINLINE FTransform (const FRotator &InRotation)
 Constructor with an initial rotation 更多...
 
FORCEINLINE FTransform (const FRotator &InRotation, const FVector &InTranslation, const FVector &InScale3D=FVector::OneVector)
 Constructor with all components initialized, taking a FRotator as the rotation component 更多...
 
FORCEINLINE FTransform (const FVector &InTranslation)
 Constructor with an initial translation 更多...
 
FORCEINLINE FTransform (const FVector &InX, const FVector &InY, const FVector &InZ, const FVector &InTranslation)
 Constructor that takes basis axes and translation
 
FORCEINLINE FTransform (ENoInit)
 Constructor with leaving uninitialized memory
 
FORCEINLINE float GetDeterminant () const
 Calculate the determinant of this transformation
 
FORCEINLINE float GetMaximumAxisScale () const
 same version of FMatrix::GetMaximumAxisScale function 更多...
 
FORCEINLINE float GetMinimumAxisScale () const
 
FORCEINLINE FQuat GetRotation () const
 Returns the rotation component 更多...
 
FORCEINLINE FVector GetScale3D () const
 Returns the Scale3D component 更多...
 
FORCEINLINE FTransform GetScaled (float Scale) const
 Apply Scale to this transform
 
FORCEINLINE FTransform GetScaled (FVector Scale) const
 Apply Scale to this transform
 
FORCEINLINE FVector GetTranslation () const
 Returns the translation component 更多...
 
CORE_API bool InitFromString (const FString &InSourceString)
 Acceptable form: "%f,%f,%f|%f,%f,%f|%f,%f,%f"
 
FORCEINLINE FTransform Inverse () const
 Convert this Transform to inverse.
 
FORCEINLINE FVector InverseTransformPosition (const FVector &V) const
 Inverts the transform and then transforms V - correctly handles scaling in this transform.
 
FORCEINLINE FQuat InverseTransformRotation (const FQuat &Q) const
 Inverse transform a rotation. 更多...
 
FORCEINLINE FVector InverseTransformVector (const FVector &V) const
 Transform a direction vector by the inverse of this transform - will not take into account translation part. 更多...
 
FORCEINLINE bool IsRotationNormalized () const
 Checks whether the rotation component is normalized or not 更多...
 
FORCEINLINE void LerpTranslationScale3D (const FTransform &SourceAtom1, const FTransform &SourceAtom2, ScalarRegister Alpha)
 Set the translation and Scale3D components of this transform to a linearly interpolated combination of two other transforms 更多...
 
FORCEINLINE void MultiplyScale3D (const FVector &Scale3DMultiplier)
 Scales the Scale3D component by a new factor 更多...
 
FORCEINLINE void NormalizeRotation ()
 Normalize the rotation component of this transformation
 
FORCEINLINE FTransform operator* (const FQuat &Other) const
 Return a transform that is the result of this multiplied by another transform (made only from a rotation). 更多...
 
FORCEINLINE FTransform operator* (const FTransform &Other) const
 Return a transform that is the result of this multiplied by another transform. 更多...
 
FORCEINLINE void operator*= (const FQuat &Other)
 Sets this transform to the result of this multiplied by another transform (made only from a rotation). 更多...
 
FORCEINLINE void operator*= (const FTransform &Other)
 Sets this transform to the result of this multiplied by another transform. 更多...
 
FORCEINLINE FTransform operator+ (const FTransform &Atom) const
 Quaternion addition is wrong here. 更多...
 
FORCEINLINE void ScaleTranslation (const FVector &InScale3D)
 Scale the translation part of the Transform by the supplied vector.
 
FORCEINLINE void SetComponents (const FQuat &InRotation, const FVector &InTranslation, const FVector &InScale3D)
 Sets the components 更多...
 
FORCEINLINE void SetIdentity ()
 Sets the components to the identity transform: Rotation = (0,0,0,1) Translation = (0,0,0) Scale3D = (1,1,1)
 
FORCEINLINE void SetLocation (const FVector &Origin)
 Set the translation of this transformation
 
FORCEINLINE void SetRotation (const FQuat &NewRotation)
 Sets the rotation component 更多...
 
FORCEINLINE void SetScale3D (const FVector &NewScale3D)
 Sets the Scale3D component 更多...
 
CORE_API void SetToRelativeTransform (const FTransform &ParentTransform)
 Set current transform and the relative to ParentTransform. 更多...
 
FORCEINLINE void SetTranslation (const FVector &NewTranslation)
 Sets the translation component 更多...
 
FORCEINLINE void SetTranslationAndScale3D (const FVector &NewTranslation, const FVector &NewScale3D)
 Sets both the translation and Scale3D components at the same time 更多...
 
CORE_API FString ToHumanReadableString () const
 Convert FTransform contents to a string
 
FORCEINLINE FMatrix ToInverseMatrixWithScale () const
 Convert this Transform to matrix with scaling and compute the inverse of that.
 
FORCEINLINE FMatrix ToMatrixNoScale () const
 Convert this Transform to a transformation matrix, ignoring its scaling
 
FORCEINLINE FMatrix ToMatrixWithScale () const
 Convert this Transform to a transformation matrix with scaling.
 
FORCEINLINE FVector4 TransformFVector4 (const FVector4 &V) const
 Transform FVector4
 
FORCEINLINE FVector4 TransformFVector4NoScale (const FVector4 &V) const
 Transform homogenous FVector4, ignoring the scaling part of this transform
 
FORCEINLINE FQuat TransformRotation (const FQuat &Q) const
 Transform a rotation. 更多...
 

静态 Public 成员函数

static FORCEINLINE FVector AddTranslations (const FTransform &A, const FTransform &B)
 Add the translations from two FTransforms and return the result. 更多...
 
static FORCEINLINE void BlendFromIdentityAndAccumulate (FTransform &FinalAtom, FTransform &SourceAtom, float BlendWeight)
 Blends the Identity transform with a weighted source transform and accumulates that into a destination transform 更多...
 
static FORCEINLINE void Multiply (FTransform *OutTransform, const FTransform *A, const FTransform *B)
 Create a new transform: OutTransform = A * B. 更多...
 
static FORCEINLINE FVector SubtractTranslations (const FTransform &A, const FTransform &B)
 Subtract translations from two FTransforms and return the difference. 更多...
 

静态 Public 属性

static CORE_API const FTransform Identity
 The identity transformation (Rotation = FQuat::Identity, Translation = FVector::ZeroVector, Scale3D = (1,1,1)).
 

Protected 属性

FQuat Rotation
 Rotation of this transformation, as a quaternion.
 
FVector Scale3D
 3D scale (always applied in local space) as a vector.
 
FVector Translation
 Translation of this transformation, as a vector.
 

详细描述

Transform composed of Scale, Rotation (as a quaternion), and Translation.

Transforms can be used to convert from one space to another, for example by transforming positions and directions from local space to world space.

Transformation of position vectors is applied in the order: Scale -> Rotate -> Translate. Transformation of direction vectors is applied in the order: Scale -> Rotate.

Order matters when composing transforms: C = A * B will yield a transform C that logically first applies A then B to any subsequent transformation. Note that this is the opposite order of quaternion (FQuat) multiplication.

Example: LocalToWorld = (DeltaRotation * LocalToWorld) will change rotation in local space by DeltaRotation. Example: LocalToWorld = (LocalToWorld * DeltaRotation) will change rotation in world space by DeltaRotation.

构造及析构函数说明

◆ FTransform() [1/5]

FORCEINLINE FTransform::FTransform ( const FVector &  InTranslation)
inlineexplicit

Constructor with an initial translation

参数
InTranslationThe value to use for the translation component

◆ FTransform() [2/5]

FORCEINLINE FTransform::FTransform ( const FQuat &  InRotation)
inlineexplicit

Constructor with an initial rotation

参数
InRotationThe value to use for rotation component

◆ FTransform() [3/5]

FORCEINLINE FTransform::FTransform ( const FRotator &  InRotation)
inlineexplicit

Constructor with an initial rotation

参数
InRotationThe value to use for rotation component (after being converted to a quaternion)

◆ FTransform() [4/5]

FORCEINLINE FTransform::FTransform ( const FQuat &  InRotation,
const FVector &  InTranslation,
const FVector &  InScale3D = FVector::OneVector 
)
inline

Constructor with all components initialized

参数
InRotationThe value to use for rotation component
InTranslationThe value to use for the translation component
InScale3DThe value to use for the scale component

◆ FTransform() [5/5]

FORCEINLINE FTransform::FTransform ( const FRotator &  InRotation,
const FVector &  InTranslation,
const FVector &  InScale3D = FVector::OneVector 
)
inline

Constructor with all components initialized, taking a FRotator as the rotation component

参数
InRotationThe value to use for rotation component (after being converted to a quaternion)
InTranslationThe value to use for the translation component
InScale3DThe value to use for the scale component

成员函数说明

◆ Accumulate() [1/2]

FORCEINLINE void FTransform::Accumulate ( const FTransform &  Atom,
float  BlendWeight 
)
inline

Accumulates another transform with this one, with a blending weight

Let SourceAtom = Atom * BlendWeight Rotation is accumulated multiplicatively (Rotation = SourceAtom.Rotation * Rotation). Translation is accumulated additively (Translation += SourceAtom.Translation) Scale3D is accumulated multiplicatively (Scale3D *= SourceAtom.Scale3D)

Note: Rotation will not be normalized! Will have to be done manually.

参数
AtomThe other transform to accumulate into this one
BlendWeightThe weight to multiply Atom by before it is accumulated.

◆ Accumulate() [2/2]

FORCEINLINE void FTransform::Accumulate ( const FTransform &  SourceAtom)
inline

Accumulates another transform with this one

注解
: Added template type function for Accumulate The template type isn't much useful yet, but it is with the plan to move forward to unify blending features with just type of additive or full pose Eventually it would be nice to just call blend and it all works depending on full pose or additive, but right now that is a lot more refactoring For now this types only defines the different functionality of accumulate

Rotation is accumulated multiplicatively (Rotation = SourceAtom.Rotation * Rotation) Translation is accumulated additively (Translation += SourceAtom.Translation) Scale3D is accumulated multiplicatively (Scale3D *= SourceAtom.Scale3D)

参数
SourceAtomThe other transform to accumulate into this one

◆ AccumulateWithAdditiveScale()

FORCEINLINE void FTransform::AccumulateWithAdditiveScale ( const FTransform &  Atom,
float  BlendWeight 
)
inline

Accumulates another transform with this one, with a blending weight

Let SourceAtom = Atom * BlendWeight Rotation is accumulated multiplicatively (Rotation = SourceAtom.Rotation * Rotation). Translation is accumulated additively (Translation += SourceAtom.Translation) Scale3D is accumulated assuming incoming scale is additive scale (Scale3D *= (1 + SourceAtom.Scale3D))

When we create additive, we create additive scale based on [TargetScale/SourceScale -1] because that way when you apply weight of 0.3, you don't shrink. We only saves the % of grow/shrink when we apply that back to it, we add back the 1, so that it goes back to it. This solves issue where you blend two additives with 0.3, you don't come back to 0.6 scale, but 1 scale at the end because [1 + [1-1]*0.3 + [1-1]*0.3] becomes 1, so you don't shrink by applying additive scale

Note: Rotation will not be normalized! Will have to be done manually.

参数
AtomThe other transform to accumulate into this one
BlendWeightThe weight to multiply Atom by before it is accumulated.

◆ AccumulateWithShortestRotation()

FORCEINLINE void FTransform::AccumulateWithShortestRotation ( const FTransform &  DeltaAtom,
float  BlendWeight 
)
inline

Accumulates another transform with this one, with an optional blending weight

Rotation is accumulated additively, in the shortest direction (Rotation = Rotation +/- DeltaAtom.Rotation * Weight) Translation is accumulated additively (Translation += DeltaAtom.Translation * Weight) Scale3D is accumulated additively (Scale3D += DeltaAtom.Scale3D * Weight)

参数
DeltaAtomThe other transform to accumulate into this one
WeightThe weight to multiply DeltaAtom by before it is accumulated.

◆ AddToTranslation()

FORCEINLINE void FTransform::AddToTranslation ( const FVector &  DeltaTranslation)
inline

Adjusts the translation component of this transformation

参数
DeltaTranslationThe translation to add in the following fashion: Translation += DeltaTranslation

◆ AddTranslations()

static FORCEINLINE FVector FTransform::AddTranslations ( const FTransform &  A,
const FTransform &  B 
)
inlinestatic

Add the translations from two FTransforms and return the result.

返回
A.Translation + B.Translation

◆ BlendFromIdentityAndAccumulate()

static FORCEINLINE void FTransform::BlendFromIdentityAndAccumulate ( FTransform &  FinalAtom,
FTransform &  SourceAtom,
float  BlendWeight 
)
inlinestatic

Blends the Identity transform with a weighted source transform and accumulates that into a destination transform

SourceAtom = Blend(Identity, SourceAtom, BlendWeight) FinalAtom.Rotation = SourceAtom.Rotation * FinalAtom.Rotation FinalAtom.Translation += SourceAtom.Translation FinalAtom.Scale3D *= SourceAtom.Scale3D

参数
FinalAtom[in/out] The atom to accumulate the blended source atom into
SourceAtomThe target transformation (used when BlendWeight = 1); this is modified during the process
BlendWeightThe blend weight between Identity and SourceAtom

◆ ConcatenateRotation()

FORCEINLINE void FTransform::ConcatenateRotation ( const FQuat &  DeltaRotation)
inline

Concatenates another rotation to this transformation

参数
DeltaRotationThe rotation to concatenate in the following fashion: Rotation = Rotation * DeltaRotation

◆ ContainsNaN()

bool FTransform::ContainsNaN ( ) const
inline

Checks the components for non-finite values (NaN or Inf).

返回
Returns true if any component (rotation, translation, or scale) is not finite.

◆ CopyRotationPart()

FORCEINLINE void FTransform::CopyRotationPart ( const FTransform &  SrcBA)
inline

Sets the Rotation and Scale3D of this transformation from another transform

参数
SrcBAThe transform to copy rotation and Scale3D from

◆ CopyTranslationAndScale3D()

FORCEINLINE void FTransform::CopyTranslationAndScale3D ( const FTransform &  SrcBA)
inline

Sets the Translation and Scale3D of this transformation from another transform

参数
SrcBAThe transform to copy translation and Scale3D from

◆ GetMaximumAxisScale()

float FTransform::GetMaximumAxisScale ( ) const
inline

same version of FMatrix::GetMaximumAxisScale function

返回
the maximum magnitude of all components of the 3D scale.

◆ GetMinimumAxisScale()

float FTransform::GetMinimumAxisScale ( ) const
inline
返回
the minimum magnitude of all components of the 3D scale.

◆ GetRotation()

FORCEINLINE FQuat FTransform::GetRotation ( ) const
inline

Returns the rotation component

返回
The rotation component

◆ GetScale3D()

FORCEINLINE FVector FTransform::GetScale3D ( ) const
inline

Returns the Scale3D component

返回
The Scale3D component

◆ GetTranslation()

FORCEINLINE FVector FTransform::GetTranslation ( ) const
inline

Returns the translation component

返回
The translation component

◆ InverseTransformRotation()

FORCEINLINE FQuat FTransform::InverseTransformRotation ( const FQuat &  Q) const

Inverse transform a rotation.

For example if this is a LocalToWorld transform, InverseTransformRotation(Q) would transform Q from world to local space.

◆ InverseTransformVector()

FORCEINLINE FVector FTransform::InverseTransformVector ( const FVector &  V) const

Transform a direction vector by the inverse of this transform - will not take into account translation part.

If you want to transform a surface normal (or plane) and correctly account for non-uniform scaling you should use TransformByUsingAdjointT with adjoint of matrix inverse.

◆ IsRotationNormalized()

FORCEINLINE bool FTransform::IsRotationNormalized ( ) const
inline

Checks whether the rotation component is normalized or not

返回
true if the rotation component is normalized, and false otherwise.

◆ LerpTranslationScale3D()

FORCEINLINE void FTransform::LerpTranslationScale3D ( const FTransform &  SourceAtom1,
const FTransform &  SourceAtom2,
ScalarRegister  Alpha 
)
inline

Set the translation and Scale3D components of this transform to a linearly interpolated combination of two other transforms

Translation = FMath::Lerp(SourceAtom1.Translation, SourceAtom2.Translation, Alpha) Scale3D = FMath::Lerp(SourceAtom1.Scale3D, SourceAtom2.Scale3D, Alpha)

参数
SourceAtom1The starting point source atom (used 100% if Alpha is 0)
SourceAtom2The ending point source atom (used 100% if Alpha is 1)
AlphaThe blending weight between SourceAtom1 and SourceAtom2

◆ Multiply()

FORCEINLINE void FTransform::Multiply ( FTransform *  OutTransform,
const FTransform *  A,
const FTransform *  B 
)
static

Create a new transform: OutTransform = A * B.

Returns Multiplied Transform of 2 FTransforms

Order matters when composing transforms : A * B will yield a transform that logically first applies A then B to any subsequent transformation.

参数
OutTransformpointer to transform that will store the result of A * B.
ATransform A.
BTransform B.

◆ MultiplyScale3D()

FORCEINLINE void FTransform::MultiplyScale3D ( const FVector &  Scale3DMultiplier)
inline

Scales the Scale3D component by a new factor

参数
Scale3DMultiplierThe value to multiply Scale3D with

◆ operator*() [1/2]

FORCEINLINE FTransform FTransform::operator* ( const FQuat &  Other) const

Return a transform that is the result of this multiplied by another transform (made only from a rotation).

Order matters when composing transforms : C = A * B will yield a transform C that logically first applies A then B to any subsequent transformation.

参数
Otherother quaternion rotation by which to multiply.
返回
new transform: this * FTransform(Other)

◆ operator*() [2/2]

FORCEINLINE FTransform FTransform::operator* ( const FTransform &  Other) const

Return a transform that is the result of this multiplied by another transform.

Order matters when composing transforms : C = A * B will yield a transform C that logically first applies A then B to any subsequent transformation.

参数
Otherother transform by which to multiply.
返回
new transform: this * Other

◆ operator*=() [1/2]

FORCEINLINE void FTransform::operator*= ( const FQuat &  Other)

Sets this transform to the result of this multiplied by another transform (made only from a rotation).

Order matters when composing transforms : C = A * B will yield a transform C that logically first applies A then B to any subsequent transformation.

参数
Otherother quaternion rotation by which to multiply.

◆ operator*=() [2/2]

FORCEINLINE void FTransform::operator*= ( const FTransform &  Other)

Sets this transform to the result of this multiplied by another transform.

Order matters when composing transforms : C = A * B will yield a transform C that logically first applies A then B to any subsequent transformation.

参数
Otherother transform by which to multiply.

◆ operator+()

FORCEINLINE FTransform FTransform::operator+ ( const FTransform &  Atom) const
inline

Quaternion addition is wrong here.

This is just a special case for linear interpolation. Use only within blends!! Rotation part is NOT normalized!!

◆ SetComponents()

FORCEINLINE void FTransform::SetComponents ( const FQuat &  InRotation,
const FVector &  InTranslation,
const FVector &  InScale3D 
)
inline

Sets the components

参数
InRotationThe new value for the Rotation component
InTranslationThe new value for the Translation component
InScale3DThe new value for the Scale3D component

◆ SetRotation()

FORCEINLINE void FTransform::SetRotation ( const FQuat &  NewRotation)
inline

Sets the rotation component

参数
NewRotationThe new value for the rotation component

◆ SetScale3D()

FORCEINLINE void FTransform::SetScale3D ( const FVector &  NewScale3D)
inline

Sets the Scale3D component

参数
NewScale3DThe new value for the Scale3D component

◆ SetToRelativeTransform()

CORE_API void FTransform::SetToRelativeTransform ( const FTransform &  ParentTransform)

Set current transform and the relative to ParentTransform.

Equates to This = This->GetRelativeTransform(Parent), but saves the intermediate FTransform storage and copy.

◆ SetTranslation()

FORCEINLINE void FTransform::SetTranslation ( const FVector &  NewTranslation)
inline

Sets the translation component

参数
NewTranslationThe new value for the translation component

◆ SetTranslationAndScale3D()

FORCEINLINE void FTransform::SetTranslationAndScale3D ( const FVector &  NewTranslation,
const FVector &  NewScale3D 
)
inline

Sets both the translation and Scale3D components at the same time

参数
NewTranslationThe new value for the translation component
NewScale3DThe new value for the Scale3D component

◆ SubtractTranslations()

static FORCEINLINE FVector FTransform::SubtractTranslations ( const FTransform &  A,
const FTransform &  B 
)
inlinestatic

Subtract translations from two FTransforms and return the difference.

返回
A.Translation - B.Translation.

◆ TransformRotation()

FORCEINLINE FQuat FTransform::TransformRotation ( const FQuat &  Q) const

Transform a rotation.

For example if this is a LocalToWorld transform, TransformRotation(Q) would transform Q from local to world space.


该结构体的文档由以下文件生成: