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