engine
 
载入中...
搜索中...
未找到
Public 成员函数 | 静态 Public 成员函数 | Public 属性 | 静态 Public 属性 | 友元 | 所有成员列表
FVector结构体 参考

A vector in 3-D space composed of components (X, Y, Z) with floating point precision. 更多...

#include <Vector.h>

+ 类 FVector 继承关系图:

Public 成员函数

void AddBounded (const FVector &V, float Radius=MAX_int16)
 Add a vector to this and clamp the result in a cube. 更多...
 
bool AllComponentsEqual (float Tolerance=KINDA_SMALL_NUMBER) const
 Checks whether all components of this vector are the same, within a tolerance. 更多...
 
FVector BoundToBox (const FVector &Min, const FVector Max) const
 Get a copy of this vector, clamped inside of a cube.
 
FVector BoundToCube (float Radius) const
 Get a copy of this vector, clamped inside of a cube. 更多...
 
float & Component (int32 Index)
 Gets a specific component of the vector. 更多...
 
float Component (int32 Index) const
 Gets a specific component of the vector. 更多...
 
FVector ComponentMax (const FVector &Other) const
 Gets the component-wise max of two vectors.
 
FVector ComponentMin (const FVector &Other) const
 Gets the component-wise min of two vectors.
 
bool ContainsNaN () const
 Utility to check if there are any non-finite values (NaN or Inf) in this vector. 更多...
 
FORCEINLINE float CosineAngle2D (FVector B) const
 Returns the cosine of the angle between this vector and another projected onto the XY plane (no Z). 更多...
 
bool Equals (const FVector &V, float Tolerance=KINDA_SMALL_NUMBER) const
 Check against another vector for equality, within specified error limits. 更多...
 
CORE_API void FindBestAxisVectors (FVector &Axis1, FVector &Axis2) const
 Find good arbitrary axis vectors to represent U and V axes of a plane, using this vector as the normal of the plane. 更多...
 
FORCEINLINE FVector ()
 Default constructor (no initialization).
 
 FVector (const FLinearColor &InColor)
 Constructs a vector from an FLinearColor. 更多...
 
FORCEINLINE FVector (const FVector2D V, float InZ)
 Constructs a vector from an FVector2D and Z value. 更多...
 
FORCEINLINE FVector (const FVector4 &V)
 Constructor using the XYZ components from a 4D vector. 更多...
 
FORCEINLINE FVector (EForceInit)
 Constructor which initializes all components to zero. 更多...
 
 FVector (FIntPoint A)
 Constructs a vector from an FIntPoint. 更多...
 
 FVector (FIntVector InVector)
 Constructs a vector from an FIntVector. 更多...
 
FORCEINLINE FVector (float InF)
 Constructor initializing all components to a single float value. 更多...
 
FORCEINLINE FVector (float InX, float InY, float InZ)
 Constructor using initial values for each component. 更多...
 
FVector GetAbs () const
 Get a copy of this vector with absolute value of each component. 更多...
 
float GetAbsMax () const
 Get the maximum absolute value of the vector's components. 更多...
 
float GetAbsMin () const
 Get the minimum absolute value of the vector's components. 更多...
 
FVector GetClampedToMaxSize (float MaxSize) const
 Create a copy of this vector, with its maximum magnitude clamped to MaxSize.
 
FVector GetClampedToMaxSize2D (float MaxSize) const
 Create a copy of this vector, with the maximum 2D magnitude clamped to MaxSize. 更多...
 
FVector GetClampedToSize (float Min, float Max) const
 Create a copy of this vector, with its magnitude clamped between Min and Max.
 
FVector GetClampedToSize2D (float Min, float Max) const
 Create a copy of this vector, with the 2D magnitude clamped between Min and Max. 更多...
 
float GetComponentForAxis (EAxis::Type Axis) const
 Get a specific component of the vector, given a specific axis by enum
 
float GetMax () const
 Get the maximum value of the vector's components. 更多...
 
float GetMin () const
 Get the minimum value of the vector's components. 更多...
 
FVector GetSafeNormal (float Tolerance=SMALL_NUMBER) const
 Gets a normalized copy of the vector, checking it is safe to do so based on the length. 更多...
 
FVector GetSafeNormal2D (float Tolerance=SMALL_NUMBER) const
 Gets a normalized copy of the 2D components of the vector, checking it is safe to do so. 更多...
 
FORCEINLINE FVector GetSignVector () const
 Get a copy of the vector as sign only. 更多...
 
FORCEINLINE FVector GetUnsafeNormal () const
 Calculates normalized version of vector without checking for zero length. 更多...
 
FORCEINLINE FVector GetUnsafeNormal2D () const
 Calculates normalized 2D version of vector without checking for zero length. 更多...
 
FVector GridSnap (const float &GridSz) const
 Gets a copy of this vector snapped to a grid. 更多...
 
float HeadingAngle () const
 Convert a direction vector into a 'heading' angle. 更多...
 
bool InitFromString (const FString &InSourceString)
 Initialize this Vector based on an FString. 更多...
 
bool IsNearlyZero (float Tolerance=KINDA_SMALL_NUMBER) const
 Checks whether vector is near to zero within a specified tolerance. 更多...
 
bool IsNormalized () const
 Checks whether vector is normalized. 更多...
 
bool IsUniform (float Tolerance=KINDA_SMALL_NUMBER) const
 Check whether X, Y and Z are nearly equal. 更多...
 
FORCEINLINE bool IsUnit (float LengthSquaredTolerance=KINDA_SMALL_NUMBER) const
 Check if the vector is of unit length, with specified tolerance. 更多...
 
bool IsZero () const
 Checks whether all components of the vector are exactly zero. 更多...
 
FVector MirrorByPlane (const FPlane &Plane) const
 Mirrors a vector about a plane. 更多...
 
FVector MirrorByVector (const FVector &MirrorNormal) const
 Mirror a vector about a normal vector. 更多...
 
CORE_API bool NetSerialize (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess)
 Network serialization function. 更多...
 
bool Normalize (float Tolerance=SMALL_NUMBER)
 Normalize this vector in-place if it is larger than a given tolerance. 更多...
 
bool operator!= (const FVector &V) const
 Check against another vector for inequality. 更多...
 
FORCEINLINE FVector operator* (const FVector &V) const
 Gets the result of component-wise multiplication of this vector by another. 更多...
 
FORCEINLINE FVector operator* (float Scale) const
 Gets the result of scaling the vector (multiplying each component by a value). 更多...
 
FVector operator*= (const FVector &V)
 Multiplies the vector with another vector, using component-wise multiplication. 更多...
 
FORCEINLINE FVector operator*= (float Scale)
 Scales the vector. 更多...
 
FORCEINLINE FVector operator+ (const FVector &V) const
 Gets the result of component-wise addition of this and another vector. 更多...
 
FORCEINLINE FVector operator+ (float Bias) const
 Gets the result of adding to each component of the vector. 更多...
 
FORCEINLINE FVector operator+= (const FVector &V)
 Adds another vector to this. 更多...
 
FORCEINLINE FVector operator- () const
 Get a negated copy of the vector. 更多...
 
FORCEINLINE FVector operator- (const FVector &V) const
 Gets the result of component-wise subtraction of this by another vector. 更多...
 
FORCEINLINE FVector operator- (float Bias) const
 Gets the result of subtracting from each component of the vector. 更多...
 
FORCEINLINE FVector operator-= (const FVector &V)
 Subtracts another vector from this. 更多...
 
FORCEINLINE FVector operator/ (const FVector &V) const
 Gets the result of component-wise division of this vector by another. 更多...
 
FVector operator/ (float Scale) const
 Gets the result of dividing each component of the vector by a value. 更多...
 
FVector operator/= (const FVector &V)
 Divides the vector by another vector, using component-wise division. 更多...
 
FVector operator/= (float V)
 Divides the vector by a number. 更多...
 
bool operator== (const FVector &V) const
 Check against another vector for equality. 更多...
 
float & operator[] (int32 Index)
 Gets specific component of the vector. 更多...
 
float operator[] (int32 Index) const
 Gets specific component of the vector. 更多...
 
FORCEINLINE FVector operator^ (const FVector &V) const
 Calculate cross product between this and another vector. 更多...
 
FORCEINLINE float operator| (const FVector &V) const
 Calculate the dot product between this and another vector. 更多...
 
FVector Projection () const
 Projects 2D components of vector based on Z. 更多...
 
FORCEINLINE FVector ProjectOnTo (const FVector &A) const
 Gets a copy of this vector projected onto the input vector. 更多...
 
FORCEINLINE FVector ProjectOnToNormal (const FVector &Normal) const
 Gets a copy of this vector projected onto the input vector, which is assumed to be unit length. 更多...
 
FVector Reciprocal () const
 Gets the reciprocal of this vector, avoiding division by zero. 更多...
 
FVector RotateAngleAxis (const float AngleDeg, const FVector &Axis) const
 Rotates around Axis (assumes Axis.Size() == 1). 更多...
 
CORE_API FRotator Rotation () const
 Return the FRotator orientation corresponding to the direction in which the vector points. 更多...
 
void Set (float InX, float InY, float InZ)
 Set the values of the vector directly. 更多...
 
void SetComponentForAxis (EAxis::Type Axis, float Component)
 Set a specified componet of the vector, given a specific axis by enum
 
float Size () const
 Get the length (magnitude) of this vector. 更多...
 
float Size2D () const
 Get the length of the 2D components of this vector. 更多...
 
float SizeSquared () const
 Get the squared length of this vector. 更多...
 
float SizeSquared2D () const
 Get the squared length of the 2D components of this vector. 更多...
 
FString ToCompactString () const
 Get a short textural representation of this vector, for compact readable logging.
 
FText ToCompactText () const
 Get a short locale aware textural representation of this vector, for compact readable logging.
 
void ToDirectionAndLength (FVector &OutDir, float &OutLength) const
 Util to convert this vector into a unit direction vector and its original length. 更多...
 
CORE_API FQuat ToOrientationQuat () const
 Return the Quaternion orientation corresponding to the direction in which the vector points. 更多...
 
CORE_API FRotator ToOrientationRotator () const
 Return the FRotator orientation corresponding to the direction in which the vector points. 更多...
 
FString ToString () const
 Get a textual representation of this vector. 更多...
 
FText ToText () const
 Get a locale aware textual representation of this vector. 更多...
 
FVector2D UnitCartesianToSpherical () const
 Converts a Cartesian unit vector into spherical coordinates on the unit sphere. 更多...
 
CORE_API void UnwindEuler ()
 When this vector contains Euler angles (degrees), ensure that angles are between +/-180
 

静态 Public 成员函数

static FORCEINLINE float BoxPushOut (const FVector &Normal, const FVector &Size)
 Compute pushout of a box from a plane. 更多...
 
static bool Coincident (const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
 See if two normal vectors are coincident (nearly parallel and point in the same direction). 更多...
 
static bool Coplanar (const FVector &Base1, const FVector &Normal1, const FVector &Base2, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
 See if two planes are coplanar. 更多...
 
static CORE_API void CreateOrthonormalBasis (FVector &XAxis, FVector &YAxis, FVector &ZAxis)
 Create an orthonormal basis from a basis with at least two orthogonal vectors. 更多...
 
static FORCEINLINE FVector CrossProduct (const FVector &A, const FVector &B)
 Calculate the cross product of two vectors. 更多...
 
static FVector DegreesToRadians (const FVector &DegVector)
 Converts a vector containing degree values to a vector containing radian values. 更多...
 
static FORCEINLINE float Dist (const FVector &V1, const FVector &V2)
 Euclidean distance between two points. 更多...
 
static FORCEINLINE float DistSquared (const FVector &V1, const FVector &V2)
 Squared distance between two points. 更多...
 
static FORCEINLINE float DistSquaredXY (const FVector &V1, const FVector &V2)
 Squared distance between two points in the XY plane only. 更多...
 
static FORCEINLINE float DistXY (const FVector &V1, const FVector &V2)
 Euclidean distance between two points in the XY plane (ignoring Z). 更多...
 
static FORCEINLINE float DotProduct (const FVector &A, const FVector &B)
 Calculate the dot product of two vectors. 更多...
 
static CORE_API float EvaluateBezier (const FVector *ControlPoints, int32 NumPoints, TArray< FVector > &OutPoints)
 Generates a list of sample points on a Bezier curve defined by 2 points. 更多...
 
static CORE_API void GenerateClusterCenters (TArray< FVector > &Clusters, const TArray< FVector > &Points, int32 NumIterations, int32 NumConnectionsToBeValid)
 Given a current set of cluster centers, a set of points, iterate N times to move clusters to be central. 更多...
 
static bool Orthogonal (const FVector &Normal1, const FVector &Normal2, float OrthogonalCosineThreshold=THRESH_NORMALS_ARE_ORTHOGONAL)
 See if two normal vectors are nearly orthogonal (perpendicular), meaning the angle between them is close to 90 degrees. 更多...
 
static bool Parallel (const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL)
 See if two normal vectors are nearly parallel, meaning the angle between them is close to 0 degrees. 更多...
 
static float PointPlaneDist (const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
 Calculate the signed distance (in the direction of the normal) between a point and a plane. 更多...
 
static FVector PointPlaneProject (const FVector &Point, const FPlane &Plane)
 Calculate the projection of a point on the given plane. 更多...
 
static FVector PointPlaneProject (const FVector &Point, const FVector &A, const FVector &B, const FVector &C)
 Calculate the projection of a point on the plane defined by counter-clockwise (CCW) points A,B,C. 更多...
 
static FVector PointPlaneProject (const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal)
 Calculate the projection of a point on the plane defined by PlaneBase and PlaneNormal. 更多...
 
static bool PointsAreNear (const FVector &Point1, const FVector &Point2, float Dist)
 Compare two points and see if they're within specified distance. 更多...
 
static bool PointsAreSame (const FVector &P, const FVector &Q)
 Compare two points and see if they're the same, using a threshold. 更多...
 
static FVector RadiansToDegrees (const FVector &RadVector)
 Converts a vector containing radian values to a vector containing degree values. 更多...
 
static float Triple (const FVector &X, const FVector &Y, const FVector &Z)
 Triple product of three vectors: X dot (Y cross Z). 更多...
 
static FVector VectorPlaneProject (const FVector &V, const FVector &PlaneNormal)
 Calculate the projection of a vector on the plane defined by PlaneNormal. 更多...
 

Public 属性

float X
 Vector's X component.
 
float Y
 Vector's Y component.
 
float Z
 Vector's Z component.
 

静态 Public 属性

static CORE_API const FVector BackwardVector
 Unreal backward vector (-1,0,0)
 
static CORE_API const FVector DownVector
 Unreal down vector (0,0,-1)
 
static CORE_API const FVector ForwardVector
 Unreal forward vector (1,0,0)
 
static CORE_API const FVector LeftVector
 Unreal left vector (0,-1,0)
 
static CORE_API const FVector OneVector
 One vector (1,1,1)
 
static CORE_API const FVector RightVector
 Unreal right vector (0,1,0)
 
static CORE_API const FVector UpVector
 Unreal up vector (0,0,1)
 
static CORE_API const FVector XAxisVector
 Unit X axis vector (1,0,0)
 
static CORE_API const FVector YAxisVector
 Unit Y axis vector (0,1,0)
 
static CORE_API const FVector ZAxisVector
 Unit Z axis vector (0,0,1)
 
static CORE_API const FVector ZeroVector
 A zero vector (0,0,0)
 

友元

void operator<< (FStructuredArchive::FSlot Slot, FVector &V)
 Structured archive slot serializer. 更多...
 

详细描述

A vector in 3-D space composed of components (X, Y, Z) with floating point precision.

构造及析构函数说明

◆ FVector() [1/8]

FORCEINLINE FVector::FVector ( float  InF)
explicit

Constructor initializing all components to a single float value.

参数
InFValue to set all components to.

◆ FVector() [2/8]

FORCEINLINE FVector::FVector ( float  InX,
float  InY,
float  InZ 
)

Constructor using initial values for each component.

参数
InXX Coordinate.
InYY Coordinate.
InZZ Coordinate.

◆ FVector() [3/8]

FORCEINLINE FVector::FVector ( const FVector2D  V,
float  InZ 
)
explicit

Constructs a vector from an FVector2D and Z value.

参数
VVector to copy from.
InZZ Coordinate.

◆ FVector() [4/8]

FORCEINLINE FVector::FVector ( const FVector4 &  V)

Constructor using the XYZ components from a 4D vector.

参数
V4D Vector to copy from.

◆ FVector() [5/8]

FORCEINLINE FVector::FVector ( const FLinearColor &  InColor)
explicit

Constructs a vector from an FLinearColor.

参数
InColorColor to copy from.

◆ FVector() [6/8]

FORCEINLINE FVector::FVector ( FIntVector  InVector)
explicit

Constructs a vector from an FIntVector.

参数
InVectorFIntVector to copy from.

◆ FVector() [7/8]

FORCEINLINE FVector::FVector ( FIntPoint  A)
explicit

Constructs a vector from an FIntPoint.

参数
AInt Point used to set X and Y coordinates, Z is set to zero.

◆ FVector() [8/8]

FORCEINLINE FVector::FVector ( EForceInit  )
explicit

Constructor which initializes all components to zero.

参数
EForceInitForce init enum

成员函数说明

◆ AddBounded()

FORCEINLINE void FVector::AddBounded ( const FVector &  V,
float  Radius = MAX_int16 
)

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

参数
VVector to add.
RadiusHalf size of the cube.

◆ AllComponentsEqual()

FORCEINLINE bool FVector::AllComponentsEqual ( float  Tolerance = KINDA_SMALL_NUMBER) const

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

参数
ToleranceError tolerance.
返回
true if the vectors are equal within tolerance limits, false otherwise.

◆ BoundToCube()

FORCEINLINE FVector FVector::BoundToCube ( float  Radius) const

Get a copy of this vector, clamped inside of a cube.

参数
RadiusHalf size of the cube.
返回
A copy of this vector, bound by cube.

◆ BoxPushOut()

FORCEINLINE float FVector::BoxPushOut ( const FVector &  Normal,
const FVector &  Size 
)
static

Compute pushout of a box from a plane.

参数
NormalThe plane normal.
SizeThe size of the box.
返回
Pushout required.

◆ Coincident()

bool FVector::Coincident ( const FVector &  Normal1,
const FVector &  Normal2,
float  ParallelCosineThreshold = THRESH_NORMALS_ARE_PARALLEL 
)
inlinestatic

See if two normal vectors are coincident (nearly parallel and point in the same direction).

参数
Normal1First normalized vector.
Normal2Second normalized vector.
ParallelCosineThresholdNormals are coincident if dot product (cosine of angle between them) is greater than or equal to this. For example: cos(1.0 degrees).
返回
true if vectors are coincident (nearly parallel and point in the same direction), false otherwise.

◆ Component() [1/2]

FORCEINLINE float & FVector::Component ( int32  Index)

Gets a specific component of the vector.

参数
IndexThe index of the component required.
返回
Reference to the specified component.

◆ Component() [2/2]

FORCEINLINE float FVector::Component ( int32  Index) const

Gets a specific component of the vector.

参数
IndexThe index of the component required.
返回
Copy of the specified component.

◆ ContainsNaN()

FORCEINLINE bool FVector::ContainsNaN ( ) const

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

返回
true if there are any non-finite values in this vector, false otherwise.

◆ Coplanar()

bool FVector::Coplanar ( const FVector &  Base1,
const FVector &  Normal1,
const FVector &  Base2,
const FVector &  Normal2,
float  ParallelCosineThreshold = THRESH_NORMALS_ARE_PARALLEL 
)
inlinestatic

See if two planes are coplanar.

They are coplanar if the normals are nearly parallel and the planes include the same set of points.

参数
Base1The base point in the first plane.
Normal1The normal of the first plane.
Base2The base point in the second plane.
Normal2The normal of the second plane.
ParallelCosineThresholdNormals are parallel if absolute value of dot product is greater than or equal to this.
返回
true if the planes are coplanar, false otherwise.

◆ CosineAngle2D()

FORCEINLINE float FVector::CosineAngle2D ( FVector  B) const

Returns the cosine of the angle between this vector and another projected onto the XY plane (no Z).

参数
Bthe other vector to find the 2D cosine of the angle with.
返回
The cosine.

◆ CreateOrthonormalBasis()

static CORE_API void FVector::CreateOrthonormalBasis ( FVector &  XAxis,
FVector &  YAxis,
FVector &  ZAxis 
)
static

Create an orthonormal basis from a basis with at least two orthogonal vectors.

It may change the directions of the X and Y axes to make the basis orthogonal, but it won't change the direction of the Z axis. All axes will be normalized.

参数
XAxisThe input basis' XAxis, and upon return the orthonormal basis' XAxis.
YAxisThe input basis' YAxis, and upon return the orthonormal basis' YAxis.
ZAxisThe input basis' ZAxis, and upon return the orthonormal basis' ZAxis.

◆ CrossProduct()

FORCEINLINE FVector FVector::CrossProduct ( const FVector &  A,
const FVector &  B 
)
static

Calculate the cross product of two vectors.

参数
AThe first vector.
BThe second vector.
返回
The cross product.

◆ DegreesToRadians()

FVector FVector::DegreesToRadians ( const FVector &  DegVector)
inlinestatic

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

参数
DegVectorVector containing degree values
返回
Vector containing radian values

◆ Dist()

FORCEINLINE float FVector::Dist ( const FVector &  V1,
const FVector &  V2 
)
static

Euclidean distance between two points.

参数
V1The first point.
V2The second point.
返回
The distance between two points.

◆ DistSquared()

FORCEINLINE float FVector::DistSquared ( const FVector &  V1,
const FVector &  V2 
)
static

Squared distance between two points.

参数
V1The first point.
V2The second point.
返回
The squared distance between two points.

◆ DistSquaredXY()

FORCEINLINE float FVector::DistSquaredXY ( const FVector &  V1,
const FVector &  V2 
)
static

Squared distance between two points in the XY plane only.

参数
V1The first point.
V2The second point.
返回
The squared distance between two points in the XY plane

◆ DistXY()

FORCEINLINE float FVector::DistXY ( const FVector &  V1,
const FVector &  V2 
)
static

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

参数
V1The first point.
V2The second point.
返回
The distance between two points in the XY plane.

◆ DotProduct()

FORCEINLINE float FVector::DotProduct ( const FVector &  A,
const FVector &  B 
)
static

Calculate the dot product of two vectors.

参数
AThe first vector.
BThe second vector.
返回
The dot product.

◆ Equals()

FORCEINLINE bool FVector::Equals ( const FVector &  V,
float  Tolerance = KINDA_SMALL_NUMBER 
) const

Check against another vector for equality, within specified error limits.

参数
VThe vector to check against.
ToleranceError tolerance.
返回
true if the vectors are equal within tolerance limits, false otherwise.

◆ EvaluateBezier()

static CORE_API float FVector::EvaluateBezier ( const FVector *  ControlPoints,
int32  NumPoints,
TArray< FVector > &  OutPoints 
)
static

Generates a list of sample points on a Bezier curve defined by 2 points.

参数
ControlPointsArray of 4 FVectors (vert1, controlpoint1, controlpoint2, vert2).
NumPointsNumber of samples.
OutPointsReceives the output samples.
返回
The path length.

◆ FindBestAxisVectors()

CORE_API void FVector::FindBestAxisVectors ( FVector &  Axis1,
FVector &  Axis2 
) const

Find good arbitrary axis vectors to represent U and V axes of a plane, using this vector as the normal of the plane.

参数
Axis1Reference to first axis.
Axis2Reference to second axis.

◆ GenerateClusterCenters()

static CORE_API void FVector::GenerateClusterCenters ( TArray< FVector > &  Clusters,
const TArray< FVector > &  Points,
int32  NumIterations,
int32  NumConnectionsToBeValid 
)
static

Given a current set of cluster centers, a set of points, iterate N times to move clusters to be central.

参数
ClustersReference to array of Clusters.
PointsSet of points.
NumIterationsNumber of iterations.
NumConnectionsToBeValidSometimes you will have long strings that come off the mass of points which happen to have been chosen as Cluster starting points. You want to be able to disregard those.

◆ GetAbs()

FORCEINLINE FVector FVector::GetAbs ( ) const

Get a copy of this vector with absolute value of each component.

返回
A copy of this vector with absolute value of each component.

◆ GetAbsMax()

FORCEINLINE float FVector::GetAbsMax ( ) const

Get the maximum absolute value of the vector's components.

返回
The maximum absolute value of the vector's components.

◆ GetAbsMin()

FORCEINLINE float FVector::GetAbsMin ( ) const

Get the minimum absolute value of the vector's components.

返回
The minimum absolute value of the vector's components.

◆ GetClampedToMaxSize2D()

FORCEINLINE FVector FVector::GetClampedToMaxSize2D ( float  MaxSize) const

Create a copy of this vector, with the maximum 2D magnitude clamped to MaxSize.

Z is unchanged.

◆ GetClampedToSize2D()

FORCEINLINE FVector FVector::GetClampedToSize2D ( float  Min,
float  Max 
) const

Create a copy of this vector, with the 2D magnitude clamped between Min and Max.

Z is unchanged.

◆ GetMax()

FORCEINLINE float FVector::GetMax ( ) const

Get the maximum value of the vector's components.

返回
The maximum value of the vector's components.

◆ GetMin()

FORCEINLINE float FVector::GetMin ( ) const

Get the minimum value of the vector's components.

返回
The minimum value of the vector's components.

◆ GetSafeNormal()

FORCEINLINE FVector FVector::GetSafeNormal ( float  Tolerance = SMALL_NUMBER) const

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

Returns zero vector if vector length is too small to safely normalize.

参数
ToleranceMinimum squared vector length.
返回
A normalized copy if safe, (0,0,0) otherwise.

◆ GetSafeNormal2D()

FORCEINLINE FVector FVector::GetSafeNormal2D ( float  Tolerance = SMALL_NUMBER) const

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

Z is set to zero. Returns zero vector if vector length is too small to normalize.

参数
ToleranceMinimum squared vector length.
返回
Normalized copy if safe, otherwise returns zero vector.

◆ GetSignVector()

FORCEINLINE FVector FVector::GetSignVector ( ) const

Get a copy of the vector as sign only.

Each component is set to +1 or -1, with the sign of zero treated as +1.

参数
Acopy of the vector with each component set to +1 or -1

◆ GetUnsafeNormal()

FORCEINLINE FVector FVector::GetUnsafeNormal ( ) const

Calculates normalized version of vector without checking for zero length.

返回
Normalized version of vector.
参见
GetSafeNormal()

◆ GetUnsafeNormal2D()

FORCEINLINE FVector FVector::GetUnsafeNormal2D ( ) const

Calculates normalized 2D version of vector without checking for zero length.

返回
Normalized version of vector.
参见
GetSafeNormal2D()

◆ GridSnap()

FORCEINLINE FVector FVector::GridSnap ( const float &  GridSz) const

Gets a copy of this vector snapped to a grid.

参数
GridSzGrid dimension.
返回
A copy of this vector snapped to a grid.
参见
FMath::GridSnap()

◆ HeadingAngle()

FORCEINLINE float FVector::HeadingAngle ( ) const

Convert a direction vector into a 'heading' angle.

返回
'Heading' angle between +/-PI. 0 is pointing down +X.

◆ InitFromString()

FORCEINLINE bool FVector::InitFromString ( const FString &  InSourceString)

Initialize this Vector based on an FString.

The String is expected to contain X=, Y=, Z=. The FVector will be bogus when InitFromString returns false.

参数
InSourceStringFString containing the vector values.
返回
true if the X,Y,Z values were read successfully; false otherwise.

◆ IsNearlyZero()

FORCEINLINE bool FVector::IsNearlyZero ( float  Tolerance = KINDA_SMALL_NUMBER) const

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

参数
ToleranceError tolerance.
返回
true if the vector is near to zero, false otherwise.

◆ IsNormalized()

FORCEINLINE bool FVector::IsNormalized ( ) const

Checks whether vector is normalized.

返回
true if normalized, false otherwise.

◆ IsUniform()

FORCEINLINE bool FVector::IsUniform ( float  Tolerance = KINDA_SMALL_NUMBER) const

Check whether X, Y and Z are nearly equal.

参数
ToleranceSpecified Tolerance.
返回
true if X == Y == Z within the specified tolerance.

◆ IsUnit()

FORCEINLINE bool FVector::IsUnit ( float  LengthSquaredTolerance = KINDA_SMALL_NUMBER) const

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

参数
LengthSquaredToleranceTolerance against squared length.
返回
true if the vector is a unit vector within the specified tolerance.

◆ IsZero()

FORCEINLINE bool FVector::IsZero ( ) const

Checks whether all components of the vector are exactly zero.

返回
true if the vector is exactly zero, false otherwise.

◆ MirrorByPlane()

FVector FVector::MirrorByPlane ( const FPlane &  Plane) const
inline

Mirrors a vector about a plane.

参数
PlanePlane to mirror about.
返回
Mirrored vector.

◆ MirrorByVector()

FORCEINLINE FVector FVector::MirrorByVector ( const FVector &  MirrorNormal) const

Mirror a vector about a normal vector.

参数
MirrorNormalNormal vector to mirror about.
返回
Mirrored vector.

◆ NetSerialize()

CORE_API bool FVector::NetSerialize ( FArchive &  Ar,
class UPackageMap *  Map,
bool &  bOutSuccess 
)

Network serialization function.

FVectors NetSerialize without quantization (ie exact values are serialized).

参见
FVector_NetQuantize, FVector_NetQuantize10, FVector_NetQuantize100, FVector_NetQuantizeNormal

◆ Normalize()

FORCEINLINE bool FVector::Normalize ( float  Tolerance = SMALL_NUMBER)

Normalize this vector in-place if it is larger than a given tolerance.

Leaves it unchanged if not.

参数
ToleranceMinimum squared length of vector for normalization.
返回
true if the vector was normalized correctly, false otherwise.

◆ operator!=()

FORCEINLINE bool FVector::operator!= ( const FVector &  V) const

Check against another vector for inequality.

参数
VThe vector to check against.
返回
true if the vectors are not equal, false otherwise.

◆ operator*() [1/2]

FORCEINLINE FVector FVector::operator* ( const FVector &  V) const

Gets the result of component-wise multiplication of this vector by another.

参数
VThe vector to multiply with.
返回
The result of multiplication.

◆ operator*() [2/2]

FORCEINLINE FVector FVector::operator* ( float  Scale) const

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

参数
ScaleWhat to multiply each component by.
返回
The result of multiplication.

◆ operator*=() [1/2]

FORCEINLINE FVector FVector::operator*= ( const FVector &  V)

Multiplies the vector with another vector, using component-wise multiplication.

参数
VWhat to multiply this vector with.
返回
Copy of the vector after multiplication.

◆ operator*=() [2/2]

FORCEINLINE FVector FVector::operator*= ( float  Scale)

Scales the vector.

参数
ScaleAmount to scale this vector by.
返回
Copy of the vector after scaling.

◆ operator+() [1/2]

FORCEINLINE FVector FVector::operator+ ( const FVector &  V) const

Gets the result of component-wise addition of this and another vector.

参数
VThe vector to add to this.
返回
The result of vector addition.

◆ operator+() [2/2]

FORCEINLINE FVector FVector::operator+ ( float  Bias) const

Gets the result of adding to each component of the vector.

参数
BiasHow much to add to each component.
返回
The result of addition.

◆ operator+=()

FORCEINLINE FVector FVector::operator+= ( const FVector &  V)

Adds another vector to this.

Uses component-wise addition.

参数
VVector to add to this.
返回
Copy of the vector after addition.

◆ operator-() [1/3]

FORCEINLINE FVector FVector::operator- ( ) const

Get a negated copy of the vector.

返回
A negated copy of the vector.

◆ operator-() [2/3]

FORCEINLINE FVector FVector::operator- ( const FVector &  V) const

Gets the result of component-wise subtraction of this by another vector.

参数
VThe vector to subtract from this.
返回
The result of vector subtraction.

◆ operator-() [3/3]

FORCEINLINE FVector FVector::operator- ( float  Bias) const

Gets the result of subtracting from each component of the vector.

参数
BiasHow much to subtract from each component.
返回
The result of subtraction.

◆ operator-=()

FORCEINLINE FVector FVector::operator-= ( const FVector &  V)

Subtracts another vector from this.

Uses component-wise subtraction.

参数
VVector to subtract from this.
返回
Copy of the vector after subtraction.

◆ operator/() [1/2]

FORCEINLINE FVector FVector::operator/ ( const FVector &  V) const

Gets the result of component-wise division of this vector by another.

参数
VThe vector to divide by.
返回
The result of division.

◆ operator/() [2/2]

FORCEINLINE FVector FVector::operator/ ( float  Scale) const

Gets the result of dividing each component of the vector by a value.

参数
ScaleWhat to divide each component by.
返回
The result of division.

◆ operator/=() [1/2]

FORCEINLINE FVector FVector::operator/= ( const FVector &  V)

Divides the vector by another vector, using component-wise division.

参数
VWhat to divide vector by.
返回
Copy of the vector after division.

◆ operator/=() [2/2]

FORCEINLINE FVector FVector::operator/= ( float  V)

Divides the vector by a number.

参数
VWhat to divide this vector by.
返回
Copy of the vector after division.

◆ operator==()

FORCEINLINE bool FVector::operator== ( const FVector &  V) const

Check against another vector for equality.

参数
VThe vector to check against.
返回
true if the vectors are equal, false otherwise.

◆ operator[]() [1/2]

FORCEINLINE float & FVector::operator[] ( int32  Index)

Gets specific component of the vector.

参数
Indexthe index of vector component
返回
reference to component.

◆ operator[]() [2/2]

FORCEINLINE float FVector::operator[] ( int32  Index) const

Gets specific component of the vector.

参数
Indexthe index of vector component
返回
Copy of the component.

◆ operator^()

FORCEINLINE FVector FVector::operator^ ( const FVector &  V) const

Calculate cross product between this and another vector.

参数
VThe other vector.
返回
The cross product.

◆ operator|()

FORCEINLINE float FVector::operator| ( const FVector &  V) const

Calculate the dot product between this and another vector.

参数
VThe other vector.
返回
The dot product.

◆ Orthogonal()

bool FVector::Orthogonal ( const FVector &  Normal1,
const FVector &  Normal2,
float  OrthogonalCosineThreshold = THRESH_NORMALS_ARE_ORTHOGONAL 
)
inlinestatic

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

参数
Normal1First normalized vector.
Normal2Second normalized vector.
OrthogonalCosineThresholdNormals are orthogonal if absolute value of dot product (cosine of angle between them) is less than or equal to this. For example: cos(89.0 degrees).
返回
true if vectors are orthogonal (perpendicular), false otherwise.

◆ Parallel()

bool FVector::Parallel ( const FVector &  Normal1,
const FVector &  Normal2,
float  ParallelCosineThreshold = THRESH_NORMALS_ARE_PARALLEL 
)
inlinestatic

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

参数
Normal1First normalized vector.
Normal1Second normalized vector.
ParallelCosineThresholdNormals are parallel if absolute value of dot product (cosine of angle between them) is greater than or equal to this. For example: cos(1.0 degrees).
返回
true if vectors are nearly parallel, false otherwise.

◆ PointPlaneDist()

float FVector::PointPlaneDist ( const FVector &  Point,
const FVector &  PlaneBase,
const FVector &  PlaneNormal 
)
inlinestatic

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

参数
PointThe Point we are checking.
PlaneBaseThe Base Point in the plane.
PlaneNormalThe Normal of the plane (assumed to be unit length).
返回
Signed distance between point and plane.

◆ PointPlaneProject() [1/3]

FVector FVector::PointPlaneProject ( const FVector &  Point,
const FPlane &  Plane 
)
inlinestatic

Calculate the projection of a point on the given plane.

参数
PointThe point to project onto the plane
PlaneThe plane
返回
Projection of Point onto Plane

◆ PointPlaneProject() [2/3]

FVector FVector::PointPlaneProject ( const FVector &  Point,
const FVector &  A,
const FVector &  B,
const FVector &  C 
)
inlinestatic

Calculate the projection of a point on the plane defined by counter-clockwise (CCW) points A,B,C.

参数
PointThe point to project onto the plane
A1st of three points in CCW order defining the plane
B2nd of three points in CCW order defining the plane
C3rd of three points in CCW order defining the plane
返回
Projection of Point onto plane ABC

◆ PointPlaneProject() [3/3]

FVector FVector::PointPlaneProject ( const FVector &  Point,
const FVector &  PlaneBase,
const FVector &  PlaneNormal 
)
inlinestatic

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

参数
PointThe point to project onto the plane
PlaneBasePoint on the plane
PlaneNormNormal of the plane (assumed to be unit length).
返回
Projection of Point onto plane

◆ PointsAreNear()

bool FVector::PointsAreNear ( const FVector &  Point1,
const FVector &  Point2,
float  Dist 
)
inlinestatic

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

参数
Point1First vector.
Point2Second vector.
DistSpecified distance.
返回
Whether two points are within the specified distance. Uses fast distance approximation (linear per-component distance).

◆ PointsAreSame()

bool FVector::PointsAreSame ( const FVector &  P,
const FVector &  Q 
)
inlinestatic

Compare two points and see if they're the same, using a threshold.

参数
PFirst vector.
QSecond vector.
返回
Whether points are the same within a threshold. Uses fast distance approximation (linear per-component distance).

◆ Projection()

FORCEINLINE FVector FVector::Projection ( ) const

Projects 2D components of vector based on Z.

返回
Projected version of vector based on Z.

◆ ProjectOnTo()

FORCEINLINE FVector FVector::ProjectOnTo ( const FVector &  A) const

Gets a copy of this vector projected onto the input vector.

参数
AVector to project onto, does not assume it is normalized.
返回
Projected vector.

◆ ProjectOnToNormal()

FORCEINLINE FVector FVector::ProjectOnToNormal ( const FVector &  Normal) const

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

参数
NormalVector to project onto (assumed to be unit length).
返回
Projected vector.

◆ RadiansToDegrees()

FVector FVector::RadiansToDegrees ( const FVector &  RadVector)
inlinestatic

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

参数
RadVectorVector containing radian values
返回
Vector containing degree values

◆ Reciprocal()

FORCEINLINE FVector FVector::Reciprocal ( ) const

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

Zero components are set to BIG_NUMBER.

返回
Reciprocal of this vector.

◆ RotateAngleAxis()

FVector FVector::RotateAngleAxis ( const float  AngleDeg,
const FVector &  Axis 
) const
inline

Rotates around Axis (assumes Axis.Size() == 1).

参数
AngleAngle to rotate (in degrees).
AxisAxis to rotate around.
返回
Rotated Vector.

◆ Rotation()

CORE_API FRotator FVector::Rotation ( ) 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.

注解
Identical to 'ToOrientationRotator()' and preserved for legacy reasons.
返回
FRotator from the Vector's direction.
参见
ToOrientationRotator(), ToOrientationQuat()

◆ Set()

FORCEINLINE void FVector::Set ( float  InX,
float  InY,
float  InZ 
)

Set the values of the vector directly.

参数
InXNew X coordinate.
InYNew Y coordinate.
InZNew Z coordinate.

◆ Size()

FORCEINLINE float FVector::Size ( ) const

Get the length (magnitude) of this vector.

返回
The length of this vector.

◆ Size2D()

FORCEINLINE float FVector::Size2D ( ) const

Get the length of the 2D components of this vector.

返回
The 2D length of this vector.

◆ SizeSquared()

FORCEINLINE float FVector::SizeSquared ( ) const

Get the squared length of this vector.

返回
The squared length of this vector.

◆ SizeSquared2D()

FORCEINLINE float FVector::SizeSquared2D ( ) const

Get the squared length of the 2D components of this vector.

返回
The squared 2D length of this vector.

◆ ToDirectionAndLength()

FORCEINLINE void FVector::ToDirectionAndLength ( FVector &  OutDir,
float &  OutLength 
) const

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

参数
OutDirReference passed in to store unit direction vector.
OutLengthReference passed in to store length of the vector.

◆ ToOrientationQuat()

CORE_API FQuat FVector::ToOrientationQuat ( ) const

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

Similar to the FRotator version, returns a result without roll such that it preserves the up vector.

注解
If you don't care about preserving the up vector and just want the most direct rotation, you can use the faster 'FQuat::FindBetweenVectors(FVector::ForwardVector, YourVector)' or 'FQuat::FindBetweenNormals(...)' if you know the vector is of unit length.
返回
Quaternion from the Vector's direction, without any roll.
参见
ToOrientationRotator(), FQuat::FindBetweenVectors()

◆ ToOrientationRotator()

CORE_API FRotator FVector::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.

返回
FRotator from the Vector's direction, without any roll.
参见
ToOrientationQuat()

◆ ToString()

FORCEINLINE FString FVector::ToString ( ) const

Get a textual representation of this vector.

返回
A string describing the vector.

◆ ToText()

FORCEINLINE FText FVector::ToText ( ) const

Get a locale aware textual representation of this vector.

返回
A string describing the vector.

◆ Triple()

float FVector::Triple ( const FVector &  X,
const FVector &  Y,
const FVector &  Z 
)
inlinestatic

Triple product of three vectors: X dot (Y cross Z).

参数
XThe first vector.
YThe second vector.
ZThe third vector.
返回
The triple product: X dot (Y cross Z).

◆ UnitCartesianToSpherical()

FORCEINLINE FVector2D FVector::UnitCartesianToSpherical ( ) const

Converts a Cartesian unit vector into spherical coordinates on the unit sphere.

返回
Output Theta will be in the range [0, PI], and output Phi will be in the range [-PI, PI].

◆ VectorPlaneProject()

FVector FVector::VectorPlaneProject ( const FVector &  V,
const FVector &  PlaneNormal 
)
inlinestatic

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

参数
VThe vector to project onto the plane.
PlaneNormalNormal of the plane (assumed to be unit length).
返回
Projection of V onto plane.

友元及相关函数文档

◆ operator<<

void operator<< ( FStructuredArchive::FSlot  Slot,
FVector &  V 
)
friend

Structured archive slot serializer.

参数
SlotStructured archive slot.
VVector to serialize.

该结构体的文档由以下文件生成: