6#include "Math/UnrealMathUtility.h"
7#include "Math/Vector.h"
9#include "Math/Transform.h"
29 TDualQuat(
const TQuat<T> &InR,
const TQuat<T> &InD)
34 TDualQuat(
const TTransform<T> &Transform)
36 TVector<T> V = Transform.GetTranslation()*0.5f;
37 *
this = TDualQuat<T>(TQuat<T>(0, 0, 0, 1), TQuat<T>(V.X, V.Y, V.Z, 0.f)) * TDualQuat<T>(Transform.GetRotation(), TQuat<T>(0, 0, 0, 0));
42 explicit TDualQuat(
const TDualQuat<FArg>& From) : TDualQuat<T>(TQuat<T>(From.R), TQuat<T>(From.D)) {}
45 TDualQuat<T> operator+(
const TDualQuat<T> &B)
const
47 return{ R + B.R, D + B.D };
51 TDualQuat<T> operator*(
const TDualQuat<T> &B)
const
53 return{ R*B.R, D*B.R + B.D*R };
57 TDualQuat<T> operator*(
const T S)
const
63 TDualQuat<T> Normalized()
const
65 T MinV = 1.0f / FMath::Sqrt(R | R);
66 return{ R*MinV, D*MinV };
70 TTransform<T> AsFTransform(TVector<T> Scale = TVector<T>(1.0f, 1.0f, 1.0f))
72 TQuat<T> TQ = D*TQuat<T>(-R.X, -R.Y, -R.Z, R.W);
73 return TTransform<T>(R, TVector<T>(TQ.X, TQ.Y, TQ.Z)*2.0f, Scale);
82template<>
struct TIsUECoreVariant<FDualQuat4f> {
enum { Value =
true }; };
83template<>
struct TIsUECoreVariant<FDualQuat4d> {
enum { Value =
true }; };
#define UE_DECLARE_LWC_TYPE(...)
#define TEMPLATE_REQUIRES(...)