6#include "Math/Vector.h"
7#include "Math/Rotator.h"
8#include "Math/Matrix.h"
9#include "Math/RotationMatrix.h"
10#include "Math/TranslationMatrix.h"
12#include "Math/ScaleMatrix.h"
13#include "Math/TransformCalculus.h"
32
33
34
35
36
40 static_assert(
std::is_floating_point_v<T>,
"T must be floating point");
50 template<
typename VType>
75template<>
template<>
inline FRotator3f TransformConverter<FRotator3f>::Convert<FMatrix44f>(
const FMatrix44f& Transform)
77 return Transform.Rotator();
79template<>
template<>
inline FRotator3d TransformConverter<FRotator3d>::Convert<FMatrix44d>(
const FMatrix44d& Transform)
81 return Transform.Rotator();
89
90
91
92
93
94
95template<
typename TransformType>
96inline auto ToMatrix(
const TransformType& Transform) ->
decltype(Transform.ToMatrix())
98 return Transform.ToMatrix();
102
103
104
105
106
107inline const UE::Math::TMatrix<
float>& ToMatrix(
const UE::Math::TMatrix<
float>& Transform)
112inline const UE::Math::TMatrix<
double>& ToMatrix(
const UE::Math::TMatrix<
double>& Transform)
118
119
120
121
122
123inline UE::Math::TMatrix<
float> ToMatrix(
float Scale)
125 return UE::Math::TScaleMatrix<
float>(Scale);
128inline UE::Math::TMatrix<
double> ToMatrix(
double Scale)
130 return UE::Math::TScaleMatrix<
double>(Scale);
134
135
136
137
138
139inline UE::Math::TMatrix<
float> ToMatrix(
const TScale<
float>& Scale)
141 return UE::Math::TScaleMatrix<
float>(UE::Math::TVector<
float>(Scale.GetVector()));
143inline UE::Math::TMatrix<
double> ToMatrix(
const TScale<
double>& Scale)
145 return UE::Math::TScaleMatrix<
double>(UE::Math::TVector<
double>(Scale.GetVector()));
149
150
151
152
153
154inline UE::Math::TMatrix<
float> ToMatrix(
const UE::Math::TVector<
float>& Translation)
156 return UE::Math::TTranslationMatrix<
float>(UE::Math::TVector<
float>(Translation));
158inline UE::Math::TMatrix<
double> ToMatrix(
const UE::Math::TVector<
double>& Translation)
160 return UE::Math::TTranslationMatrix<
double>(UE::Math::TVector<
double>(Translation));
164
165
166
167
168
169inline UE::Math::TMatrix<
float> ToMatrix(
const UE::Math::TRotator<
float>& Rotation)
171 return UE::Math::TRotationMatrix<
float>(UE::Math::TRotator<
float>(Rotation));
173inline UE::Math::TMatrix<
double> ToMatrix(
const UE::Math::TRotator<
double>& Rotation)
175 return UE::Math::TRotationMatrix<
double>(UE::Math::TRotator<
double>(Rotation));
179
180
181
182
183
184inline UE::Math::TMatrix<
float> ToMatrix(
const UE::Math::TQuat<
float>& Rotation)
186 return UE::Math::TRotationMatrix<
float>::Make(UE::Math::TQuat<
float>(Rotation));
188inline UE::Math::TMatrix<
double> ToMatrix(
const UE::Math::TQuat<
double>& Rotation)
190 return UE::Math::TRotationMatrix<
double>::Make(UE::Math::TQuat<
double>(Rotation));
194
195
196
197
198
200struct TransformConverter<FMatrix44f>
202 template<
typename OtherTransformType>
203 static auto Convert(
const OtherTransformType& Transform) ->
decltype((FMatrix44f)ToMatrix(Transform))
205 return (FMatrix44f)ToMatrix(Transform);
210struct TransformConverter<FMatrix44d>
212 template<
typename OtherTransformType>
213 static auto Convert(
const OtherTransformType& Transform) ->
decltype((FMatrix44d)ToMatrix(Transform))
215 return (FMatrix44d)ToMatrix(Transform);
275
276
277
278
279
280
289
290
291
292
293
294
303
304
305
306
307
308
309
310
311
322
323
324
325
326
327
332 return TransformCast<UE::Math::TRotator<T>>(Concatenate(TransformCast<UE::Math::TMatrix<T>>(LHS), TransformCast<UE::Math::TMatrix<T>>(RHS)));
344
345
346
347
348
349
353 return Transform.Inverse();
357
358
359
360
361
362
366 UE::Math::TVector<T> EulerAngles = Transform.Euler();
367 return UE::Math::TRotator<T>::MakeFromEuler(UE::Math::TVector<T>(-EulerAngles.Z, -EulerAngles.Y, -EulerAngles.X));
371
372
373
374
375
376
380 return Transform.Inverse();
384
385
386
387
388
389
404
405
409 return Transform.TransformPosition(Point);
413
414
418 return Transform.RotateVector(Point);
422
423
427 return Transform.RotateVector(Vector);
431
432
436 return Transform.RotateVector(Point);
440
441
445 return Transform.RotateVector(Vector);
449
450
454 return Transform + Point;
458
459
467
468
472 return Transform.GetVector() * Point;
476
477
481 return Transform.GetVector() * Vector;
const Vector3Type & GetVector() const
const TScale Inverse() const
const TScale Concatenate(const TScale &RHS) const
TScale(const UE::Math::TVector< VType > &InScale)
UE::Math::TMatrix< T > Concatenate(const UE::Math::TMatrix< T > &LHS, const UE::Math::TMatrix< T > &RHS)
UE::Math::TVector< T > Concatenate(const UE::Math::TVector< T > &LHS, const UE::Math::TVector< T > &RHS)
UE::Math::TQuat< T > Concatenate(const UE::Math::TQuat< T > &LHS, const UE::Math::TQuat< T > &RHS)
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TQuat< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TQuat< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType
UE::Math::TMatrix< T > ResultType