Navigation
API > API/Runtime > API/Runtime/Core
A 4D homogeneous vector, 4x1 FLOATs, 16-byte aligned.
| Name | TVector4 |
| Type | struct |
| Header File | /Engine/Source/Runtime/Core/Public/Math/MathFwd.h |
| Include Path | #include "Math/MathFwd.h" |
| Source | /Engine/Source/Runtime/Core/Public/Math/Vector4.h |
Syntax
template<typename T>
struct TVector4
Derived Classes
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Creates and initializes a new vector from the specified 2D vectors. | Math/Vector4.h | ||
TVector4
(
const UE::Math::TVector< T >& InVector |
Constructor from 3D TVector. | Math/Vector4.h | |
TVector4
(
const FLinearColor& InColor |
Creates and initializes a new vector from a color value. | Math/Vector4.h | |
TVector4
(
const TIntVector4< IntType >& InVector |
Creates and initializes a new vector from an int vector value. | Math/Vector4.h | |
TVector4
(
EForceInit |
Creates and initializes a new vector to zero. | Math/Vector4.h | |
| Creates an uninitialized new vector. | Math/Vector4.h | ||
| Conversion from other type: double->float. | Math/Vector4.h | ||
| Conversion from other type: float->double. | Math/Vector4.h | ||
TVector4
(
const UE::Math::TVector< T >& InVector, |
Constructor. | Math/Vector4.h | |
TVector4
(
const UE::Math::TVector4< T >& InVector, |
Constructor allowing copying of an TVector4 whilst setting up a new W component. | Math/Vector4.h | |
TVector4
(
const FLinearColor& InColor, |
Creates and initializes a new vector from a color RGB and W | Math/Vector4.h | |
TVector4
(
T InX, |
Creates and initializes a new vector from the specified components. | Math/Vector4.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FReal | T | Can't have a UE_REQUIRES in the declaration because of the forward declarations, so check for allowed types here. | Math/Vector4.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| NumComponents | int32 | The number of components this vector type has. | Math/Vector4.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| TVector4 | union UE::Math::TVector4 | Math/Vector4.h | ||
| W | T | The vector's W-component. | Math/Vector4.h | |
| X | T | The vector's X-component. | Math/Vector4.h | |
| XYZW | T | Math/Vector4.h | ||
| Y | T | The vector's Y-component. | Math/Vector4.h | |
| Z | T | The vector's Z-component. | Math/Vector4.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
T & Component
(
int32 Index |
Gets a specific component of the vector. | Math/Vector4.h | |
const T & Component
(
int32 Index |
Gets a specific component of the vector. | Math/Vector4.h | |
| Gets the component-wise max of two vectors. | Math/Vector4.h | ||
| Gets the component-wise min of two vectors. | Math/Vector4.h | ||
bool ContainsNaN() |
Utility to check if there are any non-finite values (NaN or Inf) in this vector. | Math/Vector4.h | |
void DiagnosticCheckNaN() |
Math/Vector4.h | ||
bool Equals
(
const TVector4< T >& V, |
Error tolerant comparison. | Math/Vector4.h | |
| Find good arbitrary axis vectors to represent U and V axes of a plane, given just the normal. | Math/Vector4.h | ||
TVector4 GetSafeNormal
(
T Tolerance |
Returns a normalized copy of the vector if safe to normalize. | Math/Vector4.h | |
TVector4 GetUnsafeNormal3() |
Calculates normalized version of vector without checking if it is non-zero. | Math/Vector4.h | |
bool InitFromString
(
const FString& InSourceString |
Initialize this Vector based on an FString. | Math/Vector4.h | |
bool IsNearlyZero
(
T Tolerance |
Utility to check if all of the components of this vector are nearly zero given the tolerance. | Math/Vector4.h | |
bool IsNearlyZero3
(
T Tolerance |
Utility to check if the XYZ components of this vector are nearly zero given the tolerance. | Math/Vector4.h | |
bool IsUnit3
(
T LengthSquaredTolerance |
Check if the vector is of unit length, with specified tolerance. | Math/Vector4.h | |
bool IsValidIndex
(
int32 Index |
Tests if index is valid, i.e. greater than or equal to zero, and less than the number of components in the vector. | Math/Vector4.h | |
| Reflect vector. | Math/Vector4.h | ||
| Return the FRotator orientation corresponding to the direction in which the vector points. | Math/Vector4.h | ||
bool Serialize
(
FArchive& Ar |
Math/Vector4.h | ||
| Math/Vector4.h | |||
void Set
(
T InX, |
Set all of the vectors coordinates. | Math/Vector4.h | |
T Size() |
Get the length (magnitude) of this vector, taking the W component into account | Math/Vector4.h | |
T Size3() |
Get the length of this vector not taking W component into account. | Math/Vector4.h | |
T SizeSquared() |
Get the squared length of this vector, taking the W component into account | Math/Vector4.h | |
T SizeSquared3() |
Get the squared length of this vector not taking W component into account. | Math/Vector4.h | |
TQuat< T > ToOrientationQuat() |
Return the Quaternion orientation corresponding to the direction in which the vector points. | Math/Vector4.h | |
TRotator< T > ToOrientationRotator () |
Return the FRotator orientation corresponding to the direction in which the vector points. | Math/Vector4.h | |
FString ToString() |
Get a textual representation of the vector. | Math/Vector4.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static TVector4< T > One() |
To satisfy UE::Geometry type. | Math/Vector4.h | |
static TVector4< T > Zero() |
To satisfy UE::Geometry type. | Math/Vector4.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Gets the result of subtracting from each component of the vector. | Math/Vector4.h | ||
| Gets the result of subtracting a vector from this. | Math/Vector4.h | ||
TVector4< T > operator-() |
Gets a negated copy of the vector. | Math/Vector4.h | |
bool operator!=
(
const TVector4< T >& V |
Checks for inequality against another vector. | Math/Vector4.h | |
| Gets the result of multiplying a vector with this. | Math/Vector4.h | ||
| Gets the result of scaling this vector. | Math/Vector4.h | ||
TVector4< T > operator*=
(
FArg Scale |
Gets the result of scaling this vector. | Math/Vector4.h | |
TVector4< T > operator*=
(
const TVector4< T >& V |
Gets the result of multiplying a vector with another Vector (component wise). | Math/Vector4.h | |
| Gets the result of dividing this vector. | Math/Vector4.h | ||
| Gets the result of dividing this vector. | Math/Vector4.h | ||
TVector4< T > operator/=
(
FArg Scale |
Gets the result of scaling this vector by 1/Scale. | Math/Vector4.h | |
TVector4< T > operator/=
(
const TVector4< T >& V |
Gets the result of dividing a vector with another Vector (component wise). | Math/Vector4.h | |
T operator[]
(
int32 ComponentIndex |
Access a specific component of the vector. | Math/Vector4.h | |
T & operator[]
(
int32 ComponentIndex |
Access a specific component of the vector. | Math/Vector4.h | |
| Calculate Cross product between this and another vector. | Math/Vector4.h | ||
| Gets the result of adding to each component of the vector. | Math/Vector4.h | ||
| Gets the result of adding a vector to this. | Math/Vector4.h | ||
| Adds another vector to this one. | Math/Vector4.h | ||
| Subtracts another vector to this one. | Math/Vector4.h | ||
bool operator==
(
const TVector4< T >& V |
Checks for equality against another vector. | Math/Vector4.h |