24#pragma warning (disable : 4459)
44 static_assert(std::is_floating_point_v<T>,
"T must be floating point");
49 alignas(16) T
M[4][4];
55#if ENABLE_NAN_DIAGNOSTIC
371 Output += FString::Printf(
TEXT(
"[%g %g %g %g] "),
M[0][0],
M[0][1],
M[0][2],
M[0][3]);
372 Output += FString::Printf(
TEXT(
"[%g %g %g %g] "),
M[1][0],
M[1][1],
M[1][2],
M[1][3]);
373 Output += FString::Printf(
TEXT(
"[%g %g %g %g] "),
M[2][0],
M[2][1],
M[2][2],
M[2][3]);
374 Output += FString::Printf(
TEXT(
"[%g %g %g %g] "),
M[3][0],
M[3][1],
M[3][2],
M[3][3]);
392 for (
uint32 i = 0; i < 16; ++i)
412 if constexpr (std::is_same_v<T, float>)
423 template<
typename FArg UE_REQUIRES(!std::is_same_v<T, FArg>)>
426#if PLATFORM_ENABLE_VECTORINTRINSICS
437 if constexpr (std::is_same_v<T, float>)
452 M[0][0] = (T)From.
M[0][0];
M[0][1] = (T)From.
M[0][1];
M[0][2] = (T)From.
M[0][2];
M[0][3] = (T)From.
M[0][3];
453 M[1][0] = (T)From.
M[1][0];
M[1][1] = (T)From.
M[1][1];
M[1][2] = (T)From.
M[1][2];
M[1][3] = (T)From.
M[1][3];
454 M[2][0] = (T)From.
M[2][0];
M[2][1] = (T)From.
M[2][1];
M[2][2] = (T)From.
M[2][2];
M[2][3] = (T)From.
M[2][3];
455 M[3][0] = (T)From.
M[3][0];
M[3][1] = (T)From.
M[3][1];
M[3][2] = (T)From.
M[3][2];
M[3][3] = (T)From.
M[3][3];
466 static void ErrorEnsure(
const TCHAR* Message)
473#if !defined(_MSC_VER) || defined(__clang__)
488 Ar << M.
M[0][0] << M.
M[0][1] << M.
M[0][2] << M.
M[0][3];
489 Ar << M.
M[1][0] << M.
M[1][1] << M.
M[1][2] << M.
M[1][3];
490 Ar << M.
M[2][0] << M.
M[2][1] << M.
M[2][2] << M.
M[2][3];
491 Ar << M.
M[3][0] << M.
M[3][1] << M.
M[3][2] << M.
M[3][3];
507 Ar << M.
M[0][0] << M.
M[0][1] << M.
M[0][2] << M.
M[0][3];
508 Ar << M.
M[1][0] << M.
M[1][1] << M.
M[1][2] << M.
M[1][3];
509 Ar << M.
M[2][0] << M.
M[2][1] << M.
M[2][2] << M.
M[2][3];
510 Ar << M.
M[3][0] << M.
M[3][1] << M.
M[3][2] << M.
M[3][3];
516 for (
int32 Row = 0; Row < 4; ++Row)
539 template<
typename FArg UE_REQUIRES(!std::is_same_v<T, FArg>)>
561 template<
typename FArg UE_REQUIRES(!std::is_same_v<T, FArg>)>
583 template<
typename FArg UE_REQUIRES(!std::is_same_v<T, FArg>)>
598#define UE_DECLARE_MATRIX_TYPE_TRAITS(TYPE) \
599template<> struct TIsPODType<F##TYPE##44f> { enum { Value = true }; }; \
600template<> struct TIsUECoreVariant<F##TYPE##44f> { enum { Value = true }; }; \
601template<> struct TIsPODType<F##TYPE##44d> { enum { Value = true }; }; \
602template<> struct TIsUECoreVariant<F##TYPE##44d> { enum { Value = true }; }; \
609#undef UE_DECLARE_MATRIX_TYPE_TRAITS
618template<
typename FArg UE_REQUIRES(std::is_
floating_po
int_v<FArg>)>
619static inline bool Inverse4x4(
double*
dst,
const FArg* src )
645 if(
det == 0.0 || !FMath::IsFinite(
det) )
652 for(
int i = 0; i < 16; i++ )
#define NULL
Definition oodle2base.h:134
#define ensureMsgf( InExpression, InFormat,...)
Definition AssertionMacros.h:465
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
EForceInit
Definition CoreMiscDefines.h:154
@ ForceInitToZero
Definition CoreMiscDefines.h:156
#define UE_DECLARE_MATRIX_TYPE_TRAITS(TYPE)
Definition Matrix.h:598
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define UE_SERIALIZE_VARIANT_FROM_MISMATCHED_TAG(AR_OR_SLOT, ALIAS, TYPE, ALT_TYPE)
Definition LargeWorldCoordinatesSerializer.h:9
#define UE_DECLARE_LWC_TYPE(...)
Definition LargeWorldCoordinates.h:27
#define UE_LOG(CategoryName, Verbosity, Format,...)
Definition LogMacros.h:270
#define logOrEnsureNanError(_FormatString_,...)
Definition LogMacros.h:436
@ LARGE_WORLD_COORDINATES
char * dst
Definition lz4.h:735
FORCEINLINE void VectorStore(const VectorRegister4Float &Vec, float *Dst)
Definition UnrealMathFPU.h:566
FORCEINLINE VectorRegister4Float VectorLoad(const float *Ptr)
Definition UnrealMathFPU.h:394
FORCEINLINE VectorRegister4Float MakeVectorRegisterFloatFromDouble(const VectorRegister4Double &Vec4d)
Definition UnrealMathFPU.h:262
#define UE_SMALL_NUMBER
Definition UnrealMathUtility.h:130
#define UE_KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:131
typename UE::Math::VectorRegisterPrivate::TVectorRegisterTypeHelper< T >::Type TVectorRegisterType
Definition VectorRegister.h:49
memcpy(InputBufferBase, BinkBlocksData, BinkBlocksSize)
Definition Archive.h:1208
UE_FORCEINLINE_HINT bool IsLoading() const
Definition Archive.h:236
UE_FORCEINLINE_HINT FPackageFileVersion UEVer() const
Definition Archive.h:204
Definition NameTypes.h:617
FArchive & operator<<(FArchive &Ar, TBoxSphereBounds< float, float > &Bounds)
Definition BoxSphereBounds.h:396
Definition AdvancedWidgetsModule.cpp:13
static UE_FORCEINLINE_HINT void * Memzero(void *Dest, SIZE_T Count)
Definition UnrealMemory.h:131
TBasisVectorMatrix(const TBasisVectorMatrix< FArg > &From)
Definition Matrix.h:540
TLookAtMatrix(const TLookAtMatrix< FArg > &From)
Definition Matrix.h:584
TLookFromMatrix(const TLookFromMatrix< FArg > &From)
Definition Matrix.h:562
void SetColumn(int32 i, TVector< T > Value)
Definition Matrix.inl:747
FString ToString() const
Definition Matrix.h:367
TMatrix< T > Inverse() const
Definition Matrix.inl:384
TVector4< T > TransformPosition(const TVector< T > &V) const
Definition Matrix.inl:184
TMatrix(EForceInit)
Definition Matrix.h:77
TVector4< T > TransformVector(const TVector< T > &V) const
Definition Matrix.inl:204
T GetMinimumAxisScale() const
Definition Matrix.inl:604
TMatrix< T > TransposeAdjoint() const
Definition Matrix.inl:404
TMatrix< T > operator+(const TMatrix< T > &Other) const
Definition Matrix.inl:76
T M[4][4]
Definition Matrix.h:49
void DiagnosticCheckNaN() const
Definition Matrix.h:65
bool GetFrustumBottomPlane(TPlane< T > &OuTPln) const
Definition Matrix.inl:831
void To3x4MatrixTranspose(T *Out) const
Definition Matrix.inl:252
uint32 ComputeHash() const
Definition Matrix.h:386
TVector< T > GetUnitAxis(EAxis::Type Axis) const
Definition Matrix.inl:676
bool GetFrustumLeftPlane(TPlane< T > &OuTPln) const
Definition Matrix.inl:795
TVector< T > GetColumn(int32 i) const
Definition Matrix.inl:740
bool operator!=(const TMatrix< T > &Other) const
Definition Matrix.inl:161
TVector< T > InverseTransformVector(const TVector< T > &V) const
Definition Matrix.inl:211
bool GetFrustumNearPlane(TPlane< T > &OuTPln) const
Definition Matrix.inl:771
TMatrix< T > ApplyScale(T Scale) const
Definition Matrix.inl:898
TMatrix< T > GetMatrixWithoutScale(T Tolerance=UE_SMALL_NUMBER) const
Definition Matrix.inl:458
T GetMaximumAxisScale() const
Definition Matrix.inl:618
bool GetFrustumFarPlane(TPlane< T > &OuTPln) const
Definition Matrix.inl:783
CORE_API UE::Math::TQuat< T > ToQuat() const
TVector< T > ExtractScaling(T Tolerance=UE_SMALL_NUMBER)
Definition Matrix.inl:467
bool ContainsNaN() const
Definition Matrix.inl:586
bool GetFrustumRightPlane(TPlane< T > &OuTPln) const
Definition Matrix.inl:807
TMatrix< T > ConcatTranslation(const TVector< T > &Translation) const
Definition Matrix.inl:555
TVector< T > GetScaleVector(T Tolerance=UE_SMALL_NUMBER) const
Definition Matrix.inl:523
TMatrix< T > RemoveTranslation() const
Definition Matrix.inl:545
TMatrix< T > GetTransposed() const
Definition Matrix.inl:221
bool SerializeFromMismatchedTag(FName StructTag, FArchive &Ar)
Definition Matrix.h:410
void SetIdentity()
Definition Matrix.inl:48
bool Serialize(FArchive &Ar)
Definition Matrix.h:400
TVector< T > GetScaledAxis(EAxis::Type Axis) const
Definition Matrix.inl:647
bool GetFrustumTopPlane(TPlane< T > &OuTPln) const
Definition Matrix.inl:819
void GetUnitAxes(TVector< T > &X, TVector< T > &Y, TVector< T > &Z) const
Definition Matrix.inl:682
TMatrix< T > InverseFast() const
Definition Matrix.inl:357
TVector4< T > TransformFVector4(const TVector4< T > &V) const
Definition Matrix.inl:170
void GetScaledAxes(TVector< T > &X, TVector< T > &Y, TVector< T > &Z) const
Definition Matrix.inl:668
CORE_API UE::Math::TRotator< T > Rotator() const
Definition UnrealMath.cpp:597
T FReal
Definition Matrix.h:47
void operator+=(const TMatrix< T > &Other)
Definition Matrix.inl:93
void SetAxis(int32 i, const TVector< T > &Axis)
Definition Matrix.inl:691
TMatrix(const TMatrix< FArg > &From)
Definition Matrix.h:424
static CORE_API const TMatrix Identity
Definition Matrix.h:52
bool operator==(const TMatrix< T > &Other) const
Definition Matrix.inl:126
TVector< T > GetOrigin() const
Definition Matrix.inl:641
void DebugPrint() const
Definition Matrix.h:380
T Determinant() const
Definition Matrix.inl:318
void ScaleTranslation(const TVector< T > &Scale3D)
Definition Matrix.inl:631
void RemoveScaling(T Tolerance=UE_SMALL_NUMBER)
Definition Matrix.inl:435
void operator*=(const TMatrix< T > &Other)
Definition Matrix.inl:58
TMatrix< T > operator*(const TMatrix< T > &Other) const
Definition Matrix.inl:66
TVector< T > InverseTransformPosition(const TVector< T > &V) const
Definition Matrix.inl:191
void SetOrigin(const TVector< T > &NewOrigin)
Definition Matrix.inl:701
void SetAxes(const TVector< T > *Axis0=NULL, const TVector< T > *Axis1=NULL, const TVector< T > *Axis2=NULL, const TVector< T > *Origin=NULL)
Definition Matrix.inl:710
T RotDeterminant() const
Definition Matrix.inl:344