UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
Vector4.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3#pragma once
4
5#include "CoreTypes.h"
6#include "Misc/Crc.h"
7#include "Math/MathFwd.h" // IWYU pragma: export
10#include "Misc/Parse.h"
12#include "Logging/LogMacros.h"
13#include "Math/Vector2D.h"
14#include "Math/Vector.h"
16#include "Templates/Requires.h"
17
18#include <type_traits>
19
20namespace UE
21{
22namespace Math
23{
24
28template<typename T>
29struct alignas(16) TVector4
30{
31 // Can't have a UE_REQUIRES in the declaration because of the forward declarations, so check for allowed types here.
32 static_assert(std::is_floating_point_v<T>, "TVector4 only supports float and double types.");
33
34
35public:
36 using FReal = T;
37
38 union
39 {
40 struct
41 {
43 T X;
44
46 T Y;
47
49 T Z;
50
52 T W;
53 };
54
55 UE_DEPRECATED(all, "For internal use only")
56 T XYZW[4];
57 };
58
61
62public:
63
69 [[nodiscard]] TVector4(const UE::Math::TVector<T>& InVector);
70
78 [[nodiscard]] inline TVector4(const UE::Math::TVector<T>& InVector, FArg InW)
79 : X(InVector.X)
80 , Y(InVector.Y)
81 , Z(InVector.Z)
82 , W((T)InW)
83 {
85 }
86
93 template<typename FArg UE_REQUIRES(std::is_arithmetic_v<FArg>)>
95 : X(InVector.X)
96 , Y(InVector.Y)
97 , Z(InVector.Z)
98 , W((T)OverrideW)
99 {
101 }
102
108 [[nodiscard]] inline TVector4(const FLinearColor& InColor)
109 : X(InColor.R)
110 , Y(InColor.G)
111 , Z(InColor.B)
112 , W(InColor.A)
113 {
115 }
116
123 [[nodiscard]] inline TVector4(const FLinearColor& InColor, T InOverrideW)
124 : X(InColor.R)
125 , Y(InColor.G)
126 , Z(InColor.B)
128 {
130 }
131
144 [[nodiscard]] explicit TVector4(T InX = 0.0f, T InY = 0.0f, T InZ = 0.0f, T InW = 1.0f);
145
153
159 template<typename IntType>
161
168
175
176public:
177
178 // To satisfy UE::Geometry type
180 {
181 return TVector4(T(0), T(0), T(0), T(0));
182 }
183
184 // To satisfy UE::Geometry type
186 {
187 return TVector4(T(1), T(1), T(1), T(1));
188 }
189
197
204 [[nodiscard]] UE_FORCEINLINE_HINT T operator[](int32 ComponentIndex) const;
205
206 // Unary operators.
207
214
222
230
238
246
253 template<typename FArg UE_REQUIRES(std::is_arithmetic_v<FArg>)>
255 {
256 return TVector4<T>(X + (T)Bias, Y + (T)Bias, Z + (T)Bias, W + (T)Bias);
257 }
258
265 template<typename FArg UE_REQUIRES(std::is_arithmetic_v<FArg>)>
267 {
268 return TVector4<T>(X - (T)Bias, Y - (T)Bias, Z - (T)Bias, W - (T)Bias);
269 }
270
277 template<typename FArg UE_REQUIRES(std::is_arithmetic_v<FArg>)>
279 {
280 return TVector4(X * Scale, Y * Scale, Z * Scale, W * Scale);
281 }
282
289 template<typename FArg UE_REQUIRES(std::is_arithmetic_v<FArg>)>
291 {
292 const T RScale = T(1.0f) / Scale;
293 return TVector4(X * RScale, Y * RScale, Z * RScale, W * RScale);
294 }
295
303
311
319
327
334 template<typename FArg UE_REQUIRES(std::is_arithmetic_v<FArg>)>
336 {
337 X *= Scale; Y *= Scale; Z *= Scale; W *= Scale;
339 return *this;
340 }
341
348 template<typename FArg UE_REQUIRES(std::is_arithmetic_v<FArg>)>
350 {
351 const T RV = T(1.0f) / Scale;
352 X *= RV; Y *= RV; Z *= RV; W *= RV;
354 return *this;
355 }
356
363 [[nodiscard]] bool operator==(const TVector4<T>& V) const;
364
371 [[nodiscard]] bool operator!=(const TVector4<T>& V) const;
372
380
381public:
382
383 // Simple functions.
384
392
399 [[nodiscard]] const T& Component(int32 Index) const;
400
408
416 [[nodiscard]] bool Equals(const TVector4<T>& V, T Tolerance=UE_KINDA_SMALL_NUMBER) const;
417
425
431 [[nodiscard]] FString ToString() const;
432
440 bool InitFromString(const FString& InSourceString);
441
448 [[nodiscard]] inline TVector4 GetSafeNormal(T Tolerance = UE_SMALL_NUMBER) const;
449
456
463
469
481
490 inline void Set(T InX, T InY, T InZ, T InW);
491
494
497
503 [[nodiscard]] T Size3() const;
504
510 [[nodiscard]] T SizeSquared3() const;
511
517 [[nodiscard]] T Size() const;
518
524 [[nodiscard]] T SizeSquared() const;
525
527 [[nodiscard]] bool ContainsNaN() const;
528
530 [[nodiscard]] bool IsNearlyZero3(T Tolerance = UE_KINDA_SMALL_NUMBER) const;
531
533 [[nodiscard]] bool IsNearlyZero(T Tolerance = UE_KINDA_SMALL_NUMBER) const;
534
537
543
544#if ENABLE_NAN_DIAGNOSTIC
545 inline void DiagnosticCheckNaN()
546 {
547 if (ContainsNaN())
548 {
549 logOrEnsureNanError(TEXT("FVector4 contains NaN: %s"), *ToString());
550 *this = TVector4();
551
552 }
553 }
554#else
556#endif
557
558private:
559 bool SerializeFromVector3(FName StructTag, FArchive&Ar);
560public:
561
563 {
564 Ar << *this;
565 return true;
566 }
567
569 {
570 if(SerializeFromVector3(StructTag, Ar))
571 {
572 return true;
573 }
574
575 if constexpr (std::is_same_v<T, float>)
576 {
577 return UE_SERIALIZE_VARIANT_FROM_MISMATCHED_TAG(Ar, Vector4, Vector4f, Vector4d);
578 }
579 else
580 {
581 return UE_SERIALIZE_VARIANT_FROM_MISMATCHED_TAG(Ar, Vector4, Vector4d, Vector4f);
582 }
583 }
584
585 // Conversion from other type: double->float
586 template<typename FArg UE_REQUIRES(std::is_same_v<FArg, double> && std::is_same_v<T, float>)>
587 explicit TVector4(const TVector4<FArg>& From) : TVector4<T>((T)From.X, (T)From.Y, (T)From.Z, (T)From.W) {}
588
589 // Conversion from other type: float->double
590 template<typename FArg UE_REQUIRES(std::is_same_v<FArg, float> && std::is_same_v<T, double>)>
591 explicit TVector4(const TVector4<FArg>& From) : TVector4<T>((T)From.X, (T)From.Y, (T)From.Z, (T)From.W) {}
592
604};
605
614{
615 return Ar << V.X << V.Y << V.Z << V.W;
616}
617
619{
621 {
622 Ar << V.X << V.Y << V.Z << V.W;
623 }
624 else
625 {
626 checkf(Ar.IsLoading(), TEXT("float -> double conversion applied outside of load!"));
627 // Stored as floats, so serialize float and copy.
628 float X, Y, Z, W;
629 Ar << X << Y << Z << W;
630 V = TVector4<double>(X, Y, Z, W);
631 }
632 return Ar;
633}
634
635
636/* TVector4 inline functions
637 *****************************************************************************/
638
639template<typename T>
641 : X(InVector.X)
642 , Y(InVector.Y)
643 , Z(InVector.Z)
644 , W(1.0f)
645{
647}
648
649template<typename T>
651 : X(InX)
652 , Y(InY)
653 , Z(InZ)
654 , W(InW)
655{
657}
658
659
660template<typename T>
662 : X(0.f)
663 , Y(0.f)
664 , Z(0.f)
665 , W(0.f)
666{
668}
669
670
671template<typename T>
675
676
677template<typename T>
679 : X(InXY.X)
680 , Y(InXY.Y)
681 , Z(InZW.X)
682 , W(InZW.Y)
683{
685}
686
687template<typename T>
688template<typename IntType>
690 : X((T)InVector.X)
691 , Y((T)InVector.Y)
692 , Z((T)InVector.Z)
693 , W((T)InVector.W)
694{
695}
696
697template<typename T>
699{
700 return Component(ComponentIndex);
701}
702
703
704template<typename T>
706{
707 return Component(ComponentIndex);
708}
709
710
711template<typename T>
712inline void TVector4<T>::Set(T InX, T InY, T InZ, T InW)
713{
714 X = InX;
715 Y = InY;
716 Z = InZ;
717 W = InW;
718
719 DiagnosticCheckNaN();
720}
721
722
723template<typename T>
725{
726 return TVector4(-X, -Y, -Z, -W);
727}
728
729
730template<typename T>
732{
733 return TVector4(X + V.X, Y + V.Y, Z + V.Z, W + V.W);
734}
735
736
737template<typename T>
739{
740 X += V.X; Y += V.Y; Z += V.Z; W += V.W;
741 DiagnosticCheckNaN();
742 return *this;
743}
744
745
746template<typename T>
748{
749 return TVector4(X - V.X, Y - V.Y, Z - V.Z, W - V.W);
750}
751
752
753template<typename T>
755{
756 X -= V.X; Y -= V.Y; Z -= V.Z; W -= V.W;
757 DiagnosticCheckNaN();
758 return *this;
759}
760
761
762template<typename T>
764{
765 return TVector4(X * V.X, Y * V.Y, Z * V.Z, W * V.W);
766}
767
768
769template<typename T>
771{
772 return TVector4(
773 Y * V.Z - Z * V.Y,
774 Z * V.X - X * V.Z,
775 X * V.Y - Y * V.X,
776 T(0.0f)
777 );
778}
779
780
781template<typename T>
789
790template<typename T>
791inline const T& TVector4<T>::Component(int32 Index) const
792{
793 check(IsValidIndex(Index));
795 return XYZW[Index];
797}
798
799template<typename T>
801{
802 return (Index >= 0) && (Index < NumComponents);
803}
804
805template<typename T>
807{
808 return ((X == V.X) && (Y == V.Y) && (Z == V.Z) && (W == V.W));
809}
810
811
812template<typename T>
814{
815 return ((X != V.X) || (Y != V.Y) || (Z != V.Z) || (W != V.W));
816}
817
818
819template<typename T>
820UE_FORCEINLINE_HINT bool TVector4<T>::Equals(const TVector4<T>& V, T Tolerance) const
821{
822 return FMath::Abs(X-V.X) <= Tolerance && FMath::Abs(Y-V.Y) <= Tolerance && FMath::Abs(Z-V.Z) <= Tolerance && FMath::Abs(W-V.W) <= Tolerance;
823}
824
825
826template<typename T>
828{
829 return FString::Printf(TEXT("X=%3.3f Y=%3.3f Z=%3.3f W=%3.3f"), X, Y, Z, W);
830}
831
832
833template<typename T>
835{
836 X = Y = Z = 0;
837 W = 1.0f;
838
839 // The initialization is only successful if the X, Y, and Z values can all be parsed from the string
840 const bool bSuccessful = FParse::Value(*InSourceString, TEXT("X=") , X) && FParse::Value(*InSourceString, TEXT("Y="), Y) && FParse::Value(*InSourceString, TEXT("Z="), Z);
841
842 // W is optional, so don't factor in its presence (or lack thereof) in determining initialization success
844
845 return bSuccessful;
846}
847
848
849template<typename T>
851{
852 const T SquareSum = X*X + Y*Y + Z*Z;
853 if(SquareSum > Tolerance)
854 {
855 const T Scale = FMath::InvSqrt(SquareSum);
856 return TVector4(X*Scale, Y*Scale, Z*Scale, 0.0f);
857 }
858 return TVector4(T(0.f));
859}
860
861
862template<typename T>
864{
865 const T Scale = FMath::InvSqrt(X*X+Y*Y+Z*Z);
866 return TVector4(X*Scale, Y*Scale, Z*Scale, 0.0f);
867}
868
869template<typename T>
871{
872 return TVector4<T>(FMath::Min(X, Other.X), FMath::Min(Y, Other.Y), FMath::Min(Z, Other.Z), FMath::Min(W, Other.W));
873}
874
875template<typename T>
877{
878 return TVector4<T>(FMath::Max(X, Other.X), FMath::Max(Y, Other.Y), FMath::Max(Z, Other.Z), FMath::Max(W, Other.W));
879}
880
881template<typename T>
883{
884 return FMath::Sqrt(X*X + Y*Y + Z*Z);
885}
886
887
888template<typename T>
890{
891 return X*X + Y*Y + Z*Z;
892}
893
894template<typename T>
896{
897 return FMath::Sqrt(X*X + Y*Y + Z*Z + W*W);
898}
899
900template<typename T>
902{
903 return X*X + Y*Y + Z*Z + W*W;
904}
905
906
907template<typename T>
909{
910 return FMath::Abs(1.0f - SizeSquared3()) < LengthSquaredTolerance;
911}
912
913
914template<typename T>
915inline bool TVector4<T>::ContainsNaN() const
916{
917 return (!FMath::IsFinite(X) ||
918 !FMath::IsFinite(Y) ||
919 !FMath::IsFinite(Z) ||
920 !FMath::IsFinite(W));
921}
922
923
924template<typename T>
925inline bool TVector4<T>::IsNearlyZero3(T Tolerance) const
926{
927 return
928 FMath::Abs(X)<=Tolerance
929 && FMath::Abs(Y)<=Tolerance
930 && FMath::Abs(Z)<=Tolerance;
931}
932
933template<typename T>
934inline bool TVector4<T>::IsNearlyZero(T Tolerance) const
935{
936 return
937 FMath::Abs(X)<=Tolerance
938 && FMath::Abs(Y)<=Tolerance
939 && FMath::Abs(Z)<=Tolerance
940 && FMath::Abs(W)<=Tolerance;
941}
942
943template<typename T>
945{
946 X *= V.X; Y *= V.Y; Z *= V.Z; W *= V.W;
947 DiagnosticCheckNaN();
948 return *this;
949}
950
951
952template<typename T>
954{
955 X /= V.X; Y /= V.Y; Z /= V.Z; W /= V.W;
956 DiagnosticCheckNaN();
957 return *this;
958}
959
960
961template<typename T>
963{
964 return TVector4(X / V.X, Y / V.Y, Z / V.Z, W / V.W);
965}
966
967
968template <typename T>
970{
971 // Upgrade Vector3 - only set X/Y/Z. The W should already have been set to the property specific default and we don't want to trash it by forcing 0 or 1.
973 {
975 Ar << AsVec;
976 X = (T)AsVec.X;
977 Y = (T)AsVec.Y;
978 Z = (T)AsVec.Z;
979 return true;
980 }
982 {
983 FVector3d AsVec; // Note: Vector relies on FVector3d serializer to handle float/double based on archive version.
984 Ar << AsVec;
985 X = (T)AsVec.X;
986 Y = (T)AsVec.Y;
987 Z = (T)AsVec.Z;
988 return true;
989 }
990 return false;
991}
992
993
994} // namespace UE::Math
995} // namespace UE
996
997
999
1000template<> struct TIsPODType<FVector4f> { enum { Value = true }; };
1001template<> struct TIsPODType<FVector4d> { enum { Value = true }; };
1002template<> struct TIsUECoreVariant<FVector4f> { enum { Value = true }; };
1003template<> struct TIsUECoreVariant<FVector4d> { enum { Value = true }; };
1004template<> struct TCanBulkSerialize<FVector4f> { enum { Value = true }; };
1005template<> struct TCanBulkSerialize<FVector4d> { enum { Value = true }; };
1008
1017template<typename T>
1019{
1020 return V1.X * V2.X + V1.Y * V2.Y + V1.Z * V2.Z;
1021}
1022
1023
1032template<typename T>
1034{
1035 return V1.X * V2.X + V1.Y * V2.Y + V1.Z * V2.Z;
1036}
1037
1038template<typename T>
1040{
1041 return V1.X * V2.X + V1.Y * V2.Y + V1.Z * V2.Z;
1042}
1043
1051template<typename T>
1053{
1054 return V1.X * V2.X + V1.Y * V2.Y + V1.Z * V2.Z + V1.W * V2.W;
1055}
1056
1057namespace UE
1058{
1059namespace Math
1060{
1068 template<typename T, typename T2 UE_REQUIRES(std::is_arithmetic_v<T2>)>
1070 {
1071 return V.operator*(Scale);
1072 }
1073
1074
1075 template<typename T>
1077 {
1078 return T(2.0f) * Dot3(*this, Normal) * Normal - *this;
1079 }
1080
1081
1082 template<typename T>
1084 {
1085 const T NX = FMath::Abs(X);
1086 const T NY = FMath::Abs(Y);
1087 const T NZ = FMath::Abs(Z);
1088
1089 // Find best basis vectors.
1090 if (NZ > NX && NZ > NY) Axis1 = TVector4(1, 0, 0);
1091 else Axis1 = TVector4(0, 0, 1);
1092
1093 Axis1 = (Axis1 - *this * Dot3(Axis1, *this)).GetSafeNormal();
1094 Axis2 = Axis1 ^ *this;
1095 }
1096
1097
1098/* FVector inline functions
1099*****************************************************************************/
1100
1101template<typename T>
1103 : X(V.X), Y(V.Y), Z(V.Z)
1104 {
1106 }
1107
1108
1109/* FVector2D inline functions
1110*****************************************************************************/
1111
1112template<typename T>
1114 : X(V.X), Y(V.Y)
1115 {
1117 }
1118
1119} // namespace UE::Math
1120} // namespace UE
1121
1122
@ Normal
Definition AndroidInputInterface.h:116
#define check(expr)
Definition AssertionMacros.h:314
#define checkf(expr, format,...)
Definition AssertionMacros.h:315
ENoInit
Definition CoreMiscDefines.h:158
EForceInit
Definition CoreMiscDefines.h:154
#define UE_DEPRECATED(Version, Message)
Definition CoreMiscDefines.h:302
#define TEXT(x)
Definition Platform.h:1272
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
#define UE_FORCEINLINE_HINT
Definition Platform.h:723
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
#define X(Name, Desc)
Definition FormatStringSan.h:47
#define PRAGMA_ENABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:12
#define PRAGMA_DISABLE_DEPRECATION_WARNINGS
Definition GenericPlatformCompilerPreSetup.h:8
#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 logOrEnsureNanError(_FormatString_,...)
Definition LogMacros.h:436
#define DECLARE_INTRINSIC_TYPE_LAYOUT(T)
Definition MemoryLayout.h:760
#define UE_REQUIRES(...)
Definition Requires.h:86
#define UE_SMALL_NUMBER
Definition UnrealMathUtility.h:130
#define UE_KINDA_SMALL_NUMBER
Definition UnrealMathUtility.h:131
UE_FORCEINLINE_HINT T Dot4(const UE::Math::TVector4< T > &V1, const UE::Math::TVector4< T > &V2)
Definition Vector4.h:1052
UE_FORCEINLINE_HINT T Dot3(const UE::Math::TVector4< T > &V1, const UE::Math::TVector4< T > &V2)
Definition Vector4.h:1018
uint32_t uint32
Definition binka_ue_file_header.h:6
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
UE_FORCEINLINE_HINT TQuat< T > operator*(const float Scale, const TQuat< T > &Q)
Definition Quat.h:1055
Definition AdvancedWidgetsModule.cpp:13
U16 Index
Definition radfft.cpp:71
static CORE_API uint32 MemCrc_DEPRECATED(const void *Data, int32 Length, uint32 CRC=0)
Definition Crc.cpp:592
Definition Color.h:48
static CORE_API bool Value(const TCHAR *Stream, const TCHAR *Match, FName &Name)
Definition Parse.cpp:584
Definition Array.h:45
@ Value
Definition Array.h:46
Definition IsPODType.h:12
@ Value
Definition IsPODType.h:13
Definition IsUECoreType.h:19
@ Value
Definition IsUECoreType.h:20
Definition IntVector.h:1216
Definition Quat.h:39
Definition Rotator.h:37
Definition Vector2D.h:38
UE_FORCEINLINE_HINT void DiagnosticCheckNaN()
Definition Vector2D.h:683
Definition Vector4.h:30
CORE_API TQuat< T > ToOrientationQuat() const
Definition UnrealMath.cpp:308
TVector4 GetSafeNormal(T Tolerance=UE_SMALL_NUMBER) const
Definition Vector4.h:850
static TVector4< T > Zero()
Definition Vector4.h:179
bool operator==(const TVector4< T > &V) const
Definition Vector4.h:806
T Size3() const
Definition Vector4.h:882
T SizeSquared() const
Definition Vector4.h:901
CORE_API TRotator< T > ToOrientationRotator() const
Definition UnrealMath.cpp:259
TVector4(const UE::Math::TVector< T > &InVector)
Definition Vector4.h:640
TVector4< T > operator/=(FArg Scale)
Definition Vector4.h:349
TVector4< T > operator/=(const TVector4< T > &V)
Definition Vector4.h:953
UE_FORCEINLINE_HINT T operator[](int32 ComponentIndex) const
Definition Vector4.h:705
TVector4< T > operator+=(const TVector4< T > &V)
Definition Vector4.h:738
TVector4(EForceInit)
Definition Vector4.h:661
UE_FORCEINLINE_HINT TRotator< T > Rotation() const
Definition Vector4.h:477
UE_FORCEINLINE_HINT TVector4< T > operator*(FArg Scale) const
Definition Vector4.h:278
TVector4(T InX=0.0f, T InY=0.0f, T InZ=0.0f, T InW=1.0f)
Definition Vector4.h:650
T Y
Definition Vector4.h:46
FString ToString() const
Definition Vector4.h:827
bool IsValidIndex(int32 Index) const
Definition Vector4.h:800
TVector4(const FLinearColor &InColor, T InOverrideW)
Definition Vector4.h:123
static CORE_API constexpr int32 NumComponents
Definition Vector4.h:60
TVector4(const TVector4< FArg > &From)
Definition Vector4.h:587
TVector4< T > operator/(FArg Scale) const
Definition Vector4.h:290
UE_FORCEINLINE_HINT TVector4< T > operator-(const TVector4< T > &V) const
Definition Vector4.h:747
const T & Component(int32 Index) const
Definition Vector4.h:791
bool Equals(const TVector4< T > &V, T Tolerance=UE_KINDA_SMALL_NUMBER) const
Definition Vector4.h:820
TVector4< T > operator*=(FArg Scale)
Definition Vector4.h:335
UE_FORCEINLINE_HINT TVector4< T > operator-(FArg Bias) const
Definition Vector4.h:266
void FindBestAxisVectors3(TVector4< T > &Axis1, TVector4< T > &Axis2) const
Definition Vector4.h:1083
TVector4(TVector2< T > InXY, TVector2< T > InZW)
Definition Vector4.h:678
TVector4(const UE::Math::TVector4< T > &InVector, FArg OverrideW)
Definition Vector4.h:94
T SizeSquared3() const
Definition Vector4.h:889
T XYZW[4]
Definition Vector4.h:56
UE_FORCEINLINE_HINT TVector4< T > operator+(const TVector4< T > &V) const
Definition Vector4.h:731
UE_FORCEINLINE_HINT void DiagnosticCheckNaN()
Definition Vector4.h:555
UE_FORCEINLINE_HINT TVector4< T > operator-() const
Definition Vector4.h:724
UE_FORCEINLINE_HINT T & operator[](int32 ComponentIndex)
Definition Vector4.h:698
TVector4< T > operator*(const TVector4< T > &V) const
Definition Vector4.h:763
T & Component(int32 Index)
Definition Vector4.h:782
TVector4(ENoInit)
Definition Vector4.h:672
TVector4< T > operator-=(const TVector4< T > &V)
Definition Vector4.h:754
TVector4< T > operator^(const TVector4< T > &V) const
Definition Vector4.h:770
bool IsNearlyZero(T Tolerance=UE_KINDA_SMALL_NUMBER) const
Definition Vector4.h:934
bool operator!=(const TVector4< T > &V) const
Definition Vector4.h:813
bool ContainsNaN() const
Definition Vector4.h:915
void Set(T InX, T InY, T InZ, T InW)
Definition Vector4.h:712
UE_FORCEINLINE_HINT friend uint32 GetTypeHash(const UE::Math::TVector4< T > &Vector)
Definition Vector4.h:600
TVector4< T > ComponentMax(const TVector4< T > &Other) const
Definition Vector4.h:876
bool IsNearlyZero3(T Tolerance=UE_KINDA_SMALL_NUMBER) const
Definition Vector4.h:925
TVector4(const TIntVector4< IntType > &InVector)
bool InitFromString(const FString &InSourceString)
Definition Vector4.h:834
bool SerializeFromMismatchedTag(FName StructTag, FArchive &Ar)
Definition Vector4.h:568
TVector4< T > ComponentMin(const TVector4< T > &Other) const
Definition Vector4.h:870
TVector4 GetUnsafeNormal3() const
Definition Vector4.h:863
TVector4< T > Reflect3(const TVector4< T > &Normal) const
Definition Vector4.h:1076
TVector4< T > operator/(const TVector4< T > &V) const
Definition Vector4.h:962
TVector4< T > operator*=(const TVector4< T > &V)
Definition Vector4.h:944
T Size() const
Definition Vector4.h:895
TVector4(const FLinearColor &InColor)
Definition Vector4.h:108
T Z
Definition Vector4.h:49
T W
Definition Vector4.h:52
bool Serialize(FArchive &Ar)
Definition Vector4.h:562
static TVector4< T > One()
Definition Vector4.h:185
T X
Definition Vector4.h:43
UE_FORCEINLINE_HINT TVector4< T > operator+(FArg Bias) const
Definition Vector4.h:254
bool IsUnit3(T LengthSquaredTolerance=UE_KINDA_SMALL_NUMBER) const
Definition Vector4.h:908
T FReal
Definition Vector4.h:36
Definition Vector.h:51
UE_FORCEINLINE_HINT void DiagnosticCheckNaN() const
Definition Vector.h:147
T X
Definition Vector.h:62