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.
|
inlineexplicit |
Constructor with an initial translation
| InTranslation | The value to use for the translation component |
|
inlineexplicit |
Constructor with an initial rotation
| InRotation | The value to use for rotation component |
|
inlineexplicit |
Constructor with an initial rotation
| InRotation | The value to use for rotation component (after being converted to a quaternion) |
|
inline |
Constructor with all components initialized
| InRotation | The value to use for rotation component |
| InTranslation | The value to use for the translation component |
| InScale3D | The value to use for the scale component |
|
inline |
Constructor with all components initialized, taking a FRotator as the rotation component
| InRotation | The value to use for rotation component (after being converted to a quaternion) |
| InTranslation | The value to use for the translation component |
| InScale3D | The value to use for the scale component |
|
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.
| Atom | The other transform to accumulate into this one |
| BlendWeight | The weight to multiply Atom by before it is accumulated. |
|
inline |
Accumulates another transform with this one
Rotation is accumulated multiplicatively (Rotation = SourceAtom.Rotation * Rotation) Translation is accumulated additively (Translation += SourceAtom.Translation) Scale3D is accumulated multiplicatively (Scale3D *= SourceAtom.Scale3D)
| SourceAtom | The other transform to accumulate into this one |
|
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.
| Atom | The other transform to accumulate into this one |
| BlendWeight | The weight to multiply Atom by before it is accumulated. |
|
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)
| DeltaAtom | The other transform to accumulate into this one |
| Weight | The weight to multiply DeltaAtom by before it is accumulated. |
|
inline |
Adjusts the translation component of this transformation
| DeltaTranslation | The translation to add in the following fashion: Translation += DeltaTranslation |
|
inlinestatic |
Add the translations from two FTransforms and return the result.
|
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 |
| SourceAtom | The target transformation (used when BlendWeight = 1); this is modified during the process |
| BlendWeight | The blend weight between Identity and SourceAtom |
|
inline |
Concatenates another rotation to this transformation
| DeltaRotation | The rotation to concatenate in the following fashion: Rotation = Rotation * DeltaRotation |
|
inline |
Checks the components for non-finite values (NaN or Inf).
|
inline |
Sets the Rotation and Scale3D of this transformation from another transform
| SrcBA | The transform to copy rotation and Scale3D from |
|
inline |
Sets the Translation and Scale3D of this transformation from another transform
| SrcBA | The transform to copy translation and Scale3D from |
|
inline |
same version of FMatrix::GetMaximumAxisScale function
|
inline |
|
inline |
Returns the rotation component
|
inline |
Returns the Scale3D component
|
inline |
Returns the translation component
| 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.
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.
|
inline |
Checks whether the rotation component is normalized or not
|
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)
| SourceAtom1 | The starting point source atom (used 100% if Alpha is 0) |
| SourceAtom2 | The ending point source atom (used 100% if Alpha is 1) |
| Alpha | The blending weight between SourceAtom1 and SourceAtom2 |
|
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.
| OutTransform | pointer to transform that will store the result of A * B. |
| A | Transform A. |
| B | Transform B. |
|
inline |
Scales the Scale3D component by a new factor
| Scale3DMultiplier | The value to multiply Scale3D with |
| 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.
| Other | other quaternion rotation by which to multiply. |
| 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.
| Other | other transform by which to multiply. |
| 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.
| Other | other quaternion rotation by which to multiply. |
| 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.
| Other | other transform by which to multiply. |
|
inline |
Quaternion addition is wrong here.
This is just a special case for linear interpolation. Use only within blends!! Rotation part is NOT normalized!!
|
inline |
Sets the components
| InRotation | The new value for the Rotation component |
| InTranslation | The new value for the Translation component |
| InScale3D | The new value for the Scale3D component |
|
inline |
Sets the rotation component
| NewRotation | The new value for the rotation component |
|
inline |
Sets the Scale3D component
| NewScale3D | The new value for the Scale3D component |
| 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.
|
inline |
Sets the translation component
| NewTranslation | The new value for the translation component |
|
inline |
Sets both the translation and Scale3D components at the same time
| NewTranslation | The new value for the translation component |
| NewScale3D | The new value for the Scale3D component |
|
inlinestatic |
Subtract translations from two FTransforms and return the difference.
| 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.