![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <Vector4.h>
Public Types | |
| using | FReal = T |
Static Public Member Functions | |
| static TVector4< T > | Zero () |
| static TVector4< T > | One () |
Public Attributes | ||
| union { | ||
| struct { | ||
| T X | ||
| T Y | ||
| T Z | ||
| T W | ||
| } | ||
| T XYZW [4] | ||
| }; | ||
Static Public Attributes | |
| static CORE_API constexpr int32 | NumComponents = 4 |
Friends | |
| UE_FORCEINLINE_HINT friend uint32 | GetTypeHash (const UE::Math::TVector4< T > &Vector) |
A 4D homogeneous vector, 4x1 FLOATs, 16-byte aligned.
| using UE::Math::TVector4< T >::FReal = T |
|
inline |
Constructor from 3D TVector. W is set to 1.
| InVector | 3D Vector to set first three components. |
|
inline |
Constructor.
| InVector | 3D Vector to set first three components. |
| InW | W Coordinate. |
|
inline |
Constructor allowing copying of an TVector4 whilst setting up a new W component.
| InVector | 4D Vector to set first three components. |
| InOverrideW | Replaces W Coordinate of InVector. |
|
inline |
Creates and initializes a new vector from a color value.
| InColour | Color used to set vector. |
|
inline |
Creates and initializes a new vector from a color RGB and W
| InColour | Color used to set XYZ. |
| InOverrideW |
|
inlineexplicit |
Creates and initializes a new vector from the specified components.
| InX | X Coordinate. |
| InY | Y Coordinate. |
| InZ | Z Coordinate. |
| InW | W Coordinate. |
NOTE: This default constructor is unlike TVector, TMatrix etc. in that it actually initializes the instance. Ideally it should be = default; in the same way, but this would break backwards compatibility.
|
inlineexplicit |
Creates and initializes a new vector from the specified 2D vectors.
| InXY | A 2D vector holding the X- and Y-components. |
| InZW | A 2D vector holding the Z- and W-components. |
| UE::Math::TVector4< T >::TVector4 | ( | const TIntVector4< IntType > & | InVector | ) |
Creates and initializes a new vector from an int vector value.
| InVector | IntVector used to set vector. |
|
inlineexplicit |
Creates and initializes a new vector to zero.
| EForceInit | Force Init Enum. |
| UE_FORCEINLINE_HINT UE::Math::TVector4< T >::TVector4 | ( | ENoInit | ) |
Creates an uninitialized new vector.
| ENoInit | Force uninitialized enum. |
|
inlineexplicit |
|
inlineexplicit |
| UE_FORCEINLINE_HINT UE::Math::TVector4< T >::TVector4 | ( | const TIntVector4< IntType > & | InVector | ) |
|
inline |
Gets a specific component of the vector.
| Index | The index of the component. |
|
inline |
Gets a specific component of the vector.
| Index | The index of the component. |
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::ComponentMax | ( | const TVector4< T > & | Other | ) | const |
Gets the component-wise max of two vectors.
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::ComponentMin | ( | const TVector4< T > & | Other | ) | const |
Gets the component-wise min of two vectors.
|
inline |
Utility to check if there are any non-finite values (NaN or Inf) in this vector.
|
inline |
| UE_FORCEINLINE_HINT bool UE::Math::TVector4< T >::Equals | ( | const TVector4< T > & | V, |
| T | Tolerance = UE_KINDA_SMALL_NUMBER |
||
| ) | const |
Error tolerant comparison.
| V | Vector to compare against. |
| Tolerance | Error Tolerance. |
|
inline |
Find good arbitrary axis vectors to represent U and V axes of a plane, given just the normal.
|
inline |
Returns a normalized copy of the vector if safe to normalize.
| Tolerance | Minimum squared length of vector for normalization. |
|
inline |
Calculates normalized version of vector without checking if it is non-zero.
|
inline |
|
inline |
Utility to check if all of the components of this vector are nearly zero given the tolerance.
|
inline |
Utility to check if the XYZ components of this vector are nearly zero given the tolerance.
| UE_FORCEINLINE_HINT bool UE::Math::TVector4< T >::IsUnit3 | ( | T | LengthSquaredTolerance = UE_KINDA_SMALL_NUMBER | ) | const |
Check if the vector is of unit length, with specified tolerance.
| LengthSquaredTolerance | Tolerance against squared length. |
| bool UE::Math::TVector4< T >::IsValidIndex | ( | int32 | Index | ) | const |
Tests if index is valid, i.e. greater than or equal to zero, and less than the number of components in the vector.
| Index | Index to test. |
|
inlinestatic |
| UE_FORCEINLINE_HINT bool UE::Math::TVector4< T >::operator!= | ( | const TVector4< T > & | V | ) | const |
Checks for inequality against another vector.
| V | The other vector. |
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::operator* | ( | const TVector4< T > & | V | ) | const |
Gets the result of multiplying a vector with this.
| V | The vector to multiply. |
|
inline |
Gets the result of scaling this vector.
| Scale | The scaling factor. |
|
inline |
Gets the result of multiplying a vector with another Vector (component wise).
| V | The vector to multiply. |
|
inline |
Gets the result of scaling this vector.
| Scale | The scaling factor. |
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::operator+ | ( | const TVector4< T > & | V | ) | const |
Gets the result of adding a vector to this.
| V | The vector to add. |
|
inline |
Gets the result of adding to each component of the vector.
| Bias | How much to add to each component. |
|
inline |
Adds another vector to this one.
| V | The other vector to add. |
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::operator- | ( | ) | const |
Gets a negated copy of the vector.
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::operator- | ( | const TVector4< T > & | V | ) | const |
Gets the result of subtracting a vector from this.
| V | The vector to subtract. |
|
inline |
Gets the result of subtracting from each component of the vector.
| Bias | How much to subtract from each component. |
|
inline |
Subtracts another vector to this one.
| V | The other vector to subtract. |
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::operator/ | ( | const TVector4< T > & | V | ) | const |
Gets the result of dividing this vector.
| V | What to divide by. |
|
inline |
Gets the result of dividing this vector.
| Scale | What to divide by. |
|
inline |
Gets the result of dividing a vector with another Vector (component wise).
| V | The vector to divide with. |
|
inline |
Gets the result of scaling this vector by 1/Scale.
| Scale | The inverse scaling factor. |
| UE_FORCEINLINE_HINT bool UE::Math::TVector4< T >::operator== | ( | const TVector4< T > & | V | ) | const |
Checks for equality against another vector.
| V | The other vector. |
| UE_FORCEINLINE_HINT T & UE::Math::TVector4< T >::operator[] | ( | int32 | ComponentIndex | ) |
Access a specific component of the vector.
| ComponentIndex | The index of the component. |
| UE_FORCEINLINE_HINT T UE::Math::TVector4< T >::operator[] | ( | int32 | ComponentIndex | ) | const |
Access a specific component of the vector.
| ComponentIndex | The index of the component. |
|
inline |
Calculate Cross product between this and another vector.
| V | The other vector. |
| UE_FORCEINLINE_HINT TVector4< T > UE::Math::TVector4< T >::Reflect3 | ( | const TVector4< T > & | Normal | ) | const |
Reflect vector.
|
inline |
Return the FRotator orientation corresponding to the direction in which the vector points. Sets Yaw and Pitch to the proper numbers, and sets roll to zero because the roll can't be determined from a vector. Identical to 'ToOrientationRotator()'.
|
inline |
|
inline |
|
inline |
Set all of the vectors coordinates.
| InX | New X Coordinate. |
| InY | New Y Coordinate. |
| InZ | New Z Coordinate. |
| InW | New W Coordinate. |
| UE_FORCEINLINE_HINT T UE::Math::TVector4< T >::Size | ( | ) | const |
Get the length (magnitude) of this vector, taking the W component into account
| UE_FORCEINLINE_HINT T UE::Math::TVector4< T >::Size3 | ( | ) | const |
Get the length of this vector not taking W component into account.
| UE_FORCEINLINE_HINT T UE::Math::TVector4< T >::SizeSquared | ( | ) | const |
Get the squared length of this vector, taking the W component into account
| UE_FORCEINLINE_HINT T UE::Math::TVector4< T >::SizeSquared3 | ( | ) | const |
Get the squared length of this vector not taking W component into account.
| UE::Math::TQuat< T > UE::Math::TVector4< T >::ToOrientationQuat | ( | ) | const |
Return the Quaternion orientation corresponding to the direction in which the vector points.
| UE::Math::TRotator< T > UE::Math::TVector4< T >::ToOrientationRotator | ( | ) | const |
Return the FRotator orientation corresponding to the direction in which the vector points. Sets Yaw and Pitch to the proper numbers, and sets roll to zero because the roll can't be determined from a vector.
| UE_FORCEINLINE_HINT FString UE::Math::TVector4< T >::ToString | ( | ) | const |
Get a textual representation of the vector.
|
inlinestatic |
|
friend |
Creates a hash value from a TVector4.
| Vector | the vector to create a hash value for |
| union { ... } UE::Math::TVector4< T > |
|
staticconstexpr |
The number of components this vector type has.
| T UE::Math::TVector4< T >::W |
The vector's W-component.
| T UE::Math::TVector4< T >::X |
The vector's X-component.
| T UE::Math::TVector4< T >::XYZW[4] |
| T UE::Math::TVector4< T >::Y |
The vector's Y-component.
| T UE::Math::TVector4< T >::Z |
The vector's Z-component.