FVector
struct FVector
A vector in 3D space composed of components (X, Y, Z) with floating point precision.
A point or direction FVector in 3d space. The full C++ class is located here: Engine\Source\Runtime\Core\Public\Math\Vector.h
Name  Description  

float 
X 
Vector's X component. 

float 
Y 
Vector's Y component. 

float 
Z 
Vector's Z component. 
Name  Description  

FVector() 
Default constructor (no initialization). 

FVector ( 
Constructor initializing all components to a single float value. 

FVector ( 
Constructor using the XYZ components from a 4D vector. 

FVector ( 
Constructs a vector from an FLinearColor . 

FVector ( 
Constructs a vector from an FIntVector . 

FVector ( 
Constructs a vector from an FIntPoint . 

FVector ( 
Constructor which initializes all components to zero. 

FVector ( 
Constructs a vector from an FVector2D and Z value. 

FVector ( 
Constructor using initial values for each component. 
Name  Description  

void 
AddBounded ( 
Add a vector to this and clamp the result in a cube. 

bool 
AllComponentsEqual ( 
Checks whether all components of this vector are the same, within a tolerance. 

BoundToCube ( 
Get a copy of this vector, clamped inside of a cube. A copy of this vector, bound by cube. 


float 
BoxPushOut 
Compute pushout of a box from a plane. Pushout required. 
ClampMaxSize ( 

ClampMaxSize2D ( 

ClampSize ( 

ClampSize2D ( 


bool 
Coincident 
See if two normal vectors are coincident (nearly parallel and point in the same direction). 
float 
Component ( 
Gets a specific component of the vector. Copy of the specified component. 

float & 
Component ( 
Gets a specific component of the vector. Reference to the specified component. 

ComponentMax ( 
Gets the componentwise max of two vectors. 

ComponentMin ( 
Gets the componentwise min of two vectors. 

bool 
ContainsNaN() 
Utility to check if there are any nonfinite values (NaN or Inf) in this vector. 


bool 
Coplanar 
See if two planes are coplanar. 
float 
CosineAngle2D ( 
Returns the cosine of the angle between this vector and another projected onto the XY plane (no Z). 


[CORE_API](API\Runtime\Core\Misc\CORE_API_1) voi... 
CreateOrthonormalBasis 
Create an orthonormal basis from a basis with at least two orthogonal vectors. 

CrossProduct 
Calculate the cross product of two vectors. The cross product. 


DegreesToRadians ( 
Converts a vector containing degree values to a vector containing radian values. 

void 
DiagnosticCheckNaN() 

void 
DiagnosticCheckNaN ( 


float 
Dist 
Euclidean distance between two points. The distance between two points. 

float 
Dist2D 


float 
Distance 


float 
DistSquared 
Squared distance between two points. The squared distance between two points. 

float 
DistSquared2D 


float 
DistSquaredXY 
Squared distance between two points in the XY plane only. 

float 
DistXY 
Euclidean distance between two points in the XY plane (ignoring Z). 

float 
DotProduct 
Calculate the dot product of two vectors. The dot product. 
bool 
Equals ( 
Check against another vector for equality, within specified error limits. 


[CORE_API](API\Runtime\Core\Misc\CORE_API_1) flo... 
EvaluateBezier 
Generates a list of sample points on a Bezier curve defined by 2 points. The path length. 
[CORE_API](API\Runtime\Core\Misc\CORE_API_1) voi... 
FindBestAxisVectors 
Find good arbitrary axis vectors to represent U and V axes of a plane, using this vector as the normal of the plane. 


[CORE_API](API\Runtime\Core\Misc\CORE_API_1) voi... 
GenerateClusterCenters 
Given a current set of cluster centers, a set of points, iterate N times to move clusters to be central. 
GetAbs() 
Get a copy of this vector with absolute value of each component. 

float 
GetAbsMax() 
Get the maximum absolute value of the vector's components. 

float 
GetAbsMin() 
Get the minimum absolute value of the vector's components. 

GetClampedToMaxSize ( 
Create a copy of this vector, with its maximum magnitude clamped to MaxSize. 

GetClampedToMaxSize2D ( 
Create a copy of this vector, with the maximum 2D magnitude clamped to MaxSize. Z is unchanged. 

GetClampedToSize ( 
Create a copy of this vector, with its magnitude clamped between Min and Max. 

GetClampedToSize2D ( 
Create a copy of this vector, with the 2D magnitude clamped between Min and Max. Z is unchanged. 

float 
GetComponentForAxis ( 
Get a specific component of the vector, given a specific axis by enum 

float 
GetMax() 
Get the maximum value of the vector's components. The maximum value of the vector's components. 

float 
GetMin() 
Get the minimum value of the vector's components. The minimum value of the vector's components. 

GetSafeNormal ( 
Gets a normalized copy of the vector, checking it is safe to do so based on the length. 

GetSafeNormal2D ( 
Gets a normalized copy of the 2D components of the vector, checking it is safe to do so. 

GetSignVector() 
Get a copy of the vector as sign only. 

GetUnsafeNormal() 
Calculates normalized version of vector without checking for zero length. 

GridSnap ( 
Gets a copy of this vector snapped to a grid. A copy of this vector snapped to a grid. 

float 
HeadingAngle() 
Convert a direction vector into a 'heading' angle. 

bool 
InitFromString ( 
Initialize this Vector based on an FString . 

bool 
IsNearlyZero ( 
Checks whether vector is near to zero within a specified tolerance. 

bool 
IsNormalized() 
Checks whether vector is normalized. true if Normalized, false otherwise. 

bool 
IsUniform ( 
Check whether X, Y and Z are nearly equal. true if X == Y == Z within the specified tolerance. 

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

bool 
IsZero() 
Checks whether all components of the vector are exactly zero. 

MirrorByPlane ( 
Mirrors a vector about a plane. 

MirrorByVector ( 
Mirror a vector about a normal vector. Mirrored vector. 

[CORE_API](API\Runtime\Core\Misc\CORE_API_1) boo... 
NetSerialize ( 
Network serialization function. 

bool 
Normalize ( 
Normalize this vector inplace if it is large enough, set it to (0,0,0) otherwise. 


bool 
Orthogonal 
See if two normal vectors are nearly orthogonal (perpendicular), meaning the angle between them is close to 90 degrees. 

bool 
Parallel 
See if two normal vectors are nearly parallel, meaning the angle between them is close to 0 degrees. 

float 
PointPlaneDist 
Calculate the signed distance (in the direction of the normal) between a point and a plane. 

PointPlaneProject 
Calculate the projection of a point on the plane defined by counterclockwise (CCW) points A,B,C. 


PointPlaneProject 
Calculate the projection of a point on the given plane. Projection of Point onto Plane 


PointPlaneProject 
Calculate the projection of a point on the plane defined by PlaneBase and PlaneNormal. 


bool 
PointsAreNear 
Compare two points and see if they're within specified distance. 

bool 
PointsAreSame 
Compare two points and see if they're the same, using a threshold. 
Projection() 
Projects 2D components of vector based on Z. Projected version of vector based on Z. 

ProjectOnTo ( 
Gets a copy of this vector projected onto the input vector. Projected vector. 

ProjectOnToNormal ( 
Gets a copy of this vector projected onto the input vector, which is assumed to be unit length. 


RadiansToDegrees ( 
Converts a vector containing radian values to a vector containing degree values. 

Reciprocal() 
Gets the reciprocal of this vector, avoiding division by zero. 

RotateAngleAxis ( 
Rotates around Axis (assumes Axis.Size() == 1). Rotated 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. 

SafeNormal ( 

SafeNormal2D ( 

bool 
Serialize ( 

void 
Set ( 
Simple functions. 

void 
SetComponentForAxis ( 
Set a specified componet of the vector, given a specific axis by enum 

float 
Size() 
Get the length (magnitude) of this vector. The length of this vector. 

float 
Size2D() 
Get the length of the 2D components of this vector. The 2D length of this vector. 

float 
SizeSquared() 
Get the squared length of this vector. The squared length of this vector. 

float 
SizeSquared2D() 
Get the squared length of the 2D components of this vector. 

ToCompactString() 
Get a short textural representation of this vector, for compact readable logging. 

ToCompactText() 
Get a short locale aware textural representation of this vector, for compact readable logging. 

void 
ToDirectionAndLength ( 
Util to convert this vector into a unit direction vector and its original length. 

[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 this vector. A string describing the vector. 

ToText() 
Get a locale aware textual representation of this vector. A string describing the vector. 


float 
Triple 
Triple product of three vectors: X dot (Y cross Z). The triple product: X dot (Y cross Z). 
UnitCartesianToSpherical() 
Converts a Cartesian unit vector into spherical coordinates on the unit sphere. 

UnsafeNormal() 

[CORE_API](API\Runtime\Core\Misc\CORE_API_1) voi... 
UnwindEuler() 
When this vector contains Euler angles (degrees), ensure that angles are between +/180 


VectorPlaneProject 
Calculate the projection of a vector on the plane defined by PlaneNormal. 
Name  Description  

operator() 
Get a negated copy of the vector. A negated copy of the vector. 

operator ( 
Gets the result of componentwise subtraction of this by another vector. 

operator ( 
Gets the result of subtracting from each component of the vector. The result of subtraction. 

bool 
operator!= ( 
Check against another vector for inequality. true if the vectors are not equal, false otherwise. 

operator* ( 
Gets the result of scaling the vector (multiplying each component by a value). 

operator* ( 
Gets the result of componentwise multiplication of this vector by another. 

operator*= ( 
Scales the vector. Copy of the vector after scaling. 

operator*= ( 
Multiplies the vector with another vector, using componentwise multiplication. 

operator/ ( 
Gets the result of dividing each component of the vector by a value. The result of division. 

operator/ ( 
Gets the result of componentwise division of this vector by another. The result of division. 

operator/= ( 
Divides the vector by a number. Copy of the vector after division. 

operator/= ( 
Divides the vector by another vector, using componentwise division. 

float & 
operator[] ( 
Gets specific component of the vector. reference to component. 

float 
operator[] ( 
Gets specific component of the vector. Copy of the component. 

operator^ ( 
Calculate cross product between this and another vector. The cross product. 

float 
operator ( 
Calculate the dot product between this and another vector. The dot product. 

operator+ ( 
Gets the result of componentwise addition of this and another vector. 

operator+ ( 
Gets the result of adding to each component of the vector. The result of addition. 

operator+= ( 
Adds another vector to this. Uses componentwise addition. Copy of the vector after addition. 

operator= ( 
Subtracts another vector from this. 

bool 
operator== ( 
Binary comparison operators. 
Name 
Description 

ForwardVector 
Unreal forward vector (1,0,0) 
OneVector 
One vector (1,1,1) 
RightVector 
Unreal right vector (0,1,0) 
UpVector 
World up vector (0,0,1) 
ZeroVector 
A zero vector (0,0,0) 
Module 

Header 
Runtime/Core/Public/Math/Vector.h 