6#include "Math/UnrealMathUtility.h"
7#include "Math/VectorRegister.h"
8#include "Math/Matrix.h"
15struct TRotationTranslationMatrix
22
23
24
25
26
27 TRotationTranslationMatrix(
const TRotator<T>& Rot,
const TVector<T>& Origin);
31 explicit TRotationTranslationMatrix(
const TRotationTranslationMatrix<FArg>& From) : TMatrix<T>(From) {}
34 static TMatrix<T> Make(
const TRotator<T>& Rot,
const TVector<T>& Origin)
36 return TRotationTranslationMatrix(Rot, Origin);
42FORCEINLINE TRotationTranslationMatrix<T>::TRotationTranslationMatrix(
const TRotator<T>& Rot,
const TVector<T>& Origin)
46 const TVectorRegisterType<T> Angles = MakeVectorRegister(Rot.Pitch, Rot.Yaw, Rot.Roll, 0.0f);
47 const TVectorRegisterType<T> HalfAngles = VectorMultiply(Angles, GlobalVectorConstants::DEG_TO_RAD);
49 union { TVectorRegisterType<T> v; T f[4]; } SinAngles, CosAngles;
50 VectorSinCos(&SinAngles.v, &CosAngles.v, &HalfAngles);
52 const T SP = SinAngles.f[0];
53 const T SY = SinAngles.f[1];
54 const T SR = SinAngles.f[2];
55 const T CP = CosAngles.f[0];
56 const T CY = CosAngles.f[1];
57 const T CR = CosAngles.f[2];
63 FMath::SinCos(&SP, &CP, (T)FMath::DegreesToRadians(Rot.Pitch));
64 FMath::SinCos(&SY, &CY, (T)FMath::DegreesToRadians(Rot.Yaw));
65 FMath::SinCos(&SR, &CR, (T)FMath::DegreesToRadians(Rot.Roll));
74 M[1][0] = SR * SP * CY - CR * SY;
75 M[1][1] = SR * SP * SY + CR * CY;
79 M[2][0] = -( CR * SP * CY + SR * SY );
80 M[2][1] = CY * SR - CR * SP * SY;
95template<>
struct TIsUECoreVariant<FRotationTranslationMatrix44f> {
enum { Value =
true }; };
96template<>
struct TIsUECoreVariant<FRotationTranslationMatrix44d> {
enum { Value =
true }; };
#define UE_DECLARE_LWC_TYPE(...)
#define TEMPLATE_REQUIRES(...)