Language:
Discover
By Skill Level
By Category

FVector4

Inheritance Hierarchy

FVector4

 TVector< float, 4 >

Syntax

struct FVector4

Remarks

A 4D homogeneous vector, 4x1 FLOATs, 16-byte aligned.

A 4-D homogeneous vector. The full C++ class is located here: Engine\Source\Runtime\Core\Public\Math\Vector4.h

Variables

Name Description

float

W

The vector's W-component.

float

X

The vector's X-component.

float

Y

The vector's Y-component.

float

Z

The vector's Z-component.

Constructors

Name Description

FVector4

(
const FLinearColor & InColor
)

Creates and initializes a new vector from a color value.

FVector4

Creates and initializes a new vector to zero.

FVector4

(
const FVector & InVector,
float InW
)

Constructor.

FVector4 inline functions

FVector4

(
FVector2D InXY,
FVector2D InZW
)

Creates and initializes a new vector from the specified 2D vectors.

FVector4

(
float InX,
float InY,
float InZ,
float InW
)

Creates and initializes a new vector from the specified components.

Functions

Name Description

float &

Component

(
int32 Index
)

Simple functions.

const float ...

Component

(
int32 Index
)

Gets a specific component of the vector.

Reference to the component.

bool

ContainsNaN()

Utility to check if there are any non-finite values (NaN or Inf) in this vector.

void

DiagnosticCheckNaN()

bool

Equals

(
const FVector4 & V,
float Tolerance
)

Error tolerant comparison.

void

FindBestAxisVectors3

(
FVector4 & Axis1,
FVector4 & Axis2
)

Find good arbitrary axis vectors to represent U and V axes of a plane, given just the normal.

GetSafeNormal

(
float Tolerance
)

Returns a normalized copy of the vector if safe to normalize.

GetUnsafeNormal3()

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

(
float Tolerance
)

Utility to check if all of the components of this vector are nearly zero given the tolerance.

bool

IsUnit3

(
float LengthSquaredTolerance
)

Check if the vector is of unit length, with specified tolerance.

Reflect3

(
const FVector4 & Normal
)

Reflect vector.

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FRot ...

Rotation()

Return the FRotator orientation corresponding to the direction in which the vector points.

bool

Serialize

(
FArchive & Ar
)

void

Set

(
float InX,
float InY,
float InZ,
float InW
)

Set all of the vectors coordinates.

float

Size()

Get the length (magnitude) of this vector, taking the W component into account

float

Size3()

Get the length of this vector not taking W component into account.

The length of this vector.

float

SizeSquared()

Get the squared length of this vector, taking the W component into account

float

SizeSquared3()

Get the squared length of this vector not taking W component into account.

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FQua ...

ToOrientationQuat()

Return the Quaternion orientation corresponding to the direction in which the vector points.

[CORE_API](API\Runtime\Core\Misc\CORE_API_1)FRot ...

ToOrientationRotator()

Return the FRotator orientation corresponding to the direction in which the vector points.

ToString()

Get a textual representation of the vector.

Text describing the vector.

Operators

Name Description

operator-

(
const FVector4 & V
)

Gets the result of subtracting a vector from this.

The result of vector subtraction.

operator-()

Unary operators.

bool

operator!=

(
const FVector4 & V
)

Checks for inequality against another vector.

operator*

(
const FVector4 & V
)

Gets the result of multiplying a vector with this.

The result of vector multiplication.

operator*

(
float Scale
)

Gets the result of scaling this vector.

The result of vector scaling.

operator*=

(
float S
)

Gets the result of scaling this vector.

The result of vector scaling.

operator*=

(
const FVector4 & V
)

Gets the result of multiplying a vector with another Vector (component wise).

operator/

(
float Scale
)

Gets the result of dividing this vector.

The result of division.

operator/

(
const FVector4 & V
)

Gets the result of dividing this vector.

The result of division.

operator/=

(
const FVector4 & V
)

Gets the result of dividing a vector with another Vector (component wise).

float

operator[]

(
int32 ComponentIndex
)

Access a specific component of the vector.

Copy of the desired component.

float &

operator[]

(
int32 ComponentIndex
)

Access a specific component of the vector.

Reference to the desired component.

operator^

(
const FVector4 & V
)

Calculate Cross product between this and another vector.

The Cross product.

operator+

(
const FVector4 & V
)

Gets the result of adding a vector to this.

operator+=

(
const FVector4 & V
)

Adds another vector to this one.

Copy of the vector after addition.

operator-=

(
const FVector4 & V
)

Subtracts another vector to this one.

Copy of the vector after subtraction.

bool

operator==

(
const FVector4 & V
)

Checks for equality against another vector.

References