Language:
Discover
By Skill Level
By Category

FVector4

Choose your OS:

Inheritance Hierarchy

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

Public variable

float

 

W

The vector's W-component.

Public variable

float

 

X

The vector's X-component.

Public variable

float

 

Y

The vector's Y-component.

Public variable

float

 

Z

The vector's Z-component.

Constructors

Name Description

Public function

FVector4

(
    const FLinearColor & InColor
)

Creates and initializes a new vector from a color value.

Public function

FVector4

(
    EForceInit
)

Creates and initializes a new vector to zero.

Public function

FVector4

(
    const FVector & InVector,
    float InW
)

Constructor.

FVector4 inline functions

Public function

FVector4

(
    FVector2D InXY,
    FVector2D InZW
)

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

Public function

FVector4

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

Creates and initializes a new vector from the specified components.

Functions

Name Description

Public function

float &

 

Component

(
    int32 Index
)

Simple functions.

Public function

const float ...

 

Component

(
    int32 Index
)

Gets a specific component of the vector.

Reference to the component.

Public function

bool

 

ContainsNaN()

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

Public function

void

 

DiagnosticCheckNaN()

Public function

bool

 

Equals

(
    const FVector4 & V,
    float Tolerance
)

Error tolerant comparison.

Public function

void

 

FindBestAxisVectors3

(
    FVector4 & Axis1,
    FVector4 & Axis2
)

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

Public function

FVector4

 

GetSafeNormal

(
    float Tolerance
)

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

Public function

FVector4

 

GetUnsafeNormal3()

Calculates normalized version of vector without checking if it is non-zero.

Public function

bool

 

InitFromString

(
    const FString & InSourceString
)

Initialize this Vector based on an FString .

Public function

bool

 

IsNearlyZero3

(
    float Tolerance
)

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

Public function

bool

 

IsUnit3

(
    float LengthSquaredTolerance
)

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

Public function

FVector4

 

Reflect3

(
    const FVector4 & Normal
)

Reflect vector.

Public function

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

 

Rotation()

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

Public function

bool

 

Serialize

(
    FArchive & Ar
)

Public function

void

 

Set

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

Set all of the vectors coordinates.

Public function

float

 

Size()

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

Public function

float

 

Size3()

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

The length of this vector.

Public function

float

 

SizeSquared()

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

Public function

float

 

SizeSquared3()

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

Public function

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

 

ToOrientationQuat()

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

Public function

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

 

ToOrientationRotator()

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

Public function

FString

 

ToString()

Get a textual representation of the vector.

Text describing the vector.

Operators

Name Description

Public function

FVector4

 

operator-

(
    const FVector4 & V
)

Gets the result of subtracting a vector from this.

The result of vector subtraction.

Public function

FVector4

 

operator-()

Unary operators.

Public function

bool

 

operator!=

(
    const FVector4 & V
)

Checks for inequality against another vector.

Public function

FVector4

 

operator*

(
    const FVector4 & V
)

Gets the result of multiplying a vector with this.

The result of vector multiplication.

Public function

FVector4

 

operator*

(
    float Scale
)

Gets the result of scaling this vector.

The result of vector scaling.

Public function

FVector4

 

operator*=

(
    float S
)

Gets the result of scaling this vector.

The result of vector scaling.

Public function

FVector4

 

operator*=

(
    const FVector4 & V
)

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

Public function

FVector4

 

operator/

(
    float Scale
)

Gets the result of dividing this vector.

The result of division.

Public function

FVector4

 

operator/

(
    const FVector4 & V
)

Gets the result of dividing this vector.

The result of division.

Public function

FVector4

 

operator/=

(
    const FVector4 & V
)

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

Public function

float

 

operator[]

(
    int32 ComponentIndex
)

Access a specific component of the vector.

Copy of the desired component.

Public function

float &

 

operator[]

(
    int32 ComponentIndex
)

Access a specific component of the vector.

Reference to the desired component.

Public function

FVector4

 

operator^

(
    const FVector4 & V
)

Calculate Cross product between this and another vector.

The Cross product.

Public function

FVector4

 

operator+

(
    const FVector4 & V
)

Gets the result of adding a vector to this.

The result of vector addition.

Public function

FVector4

 

operator+=

(
    const FVector4 & V
)

Adds another vector to this one.

Copy of the vector after addition.

Public function

FVector4

 

operator-=

(
    const FVector4 & V
)

Subtracts another vector to this one.

Copy of the vector after subtraction.

Public function

bool

 

operator==

(
    const FVector4 & V
)

Checks for equality against another vector.

References

Module

Core

Header

Runtime/Core/Public/Math/Vector4.h