Ark Server API (ASE) - Wiki
|
#include <Vector.h>
Public Member Functions | |
FORCEINLINE | FVector () |
FORCEINLINE | FVector (float InF) |
FORCEINLINE CONSTEXPR | FVector (float InX, float InY, float InZ) |
FORCEINLINE | FVector (const FVector2D V, float InZ) |
FVector (const FLinearColor &InColor) | |
FVector (FIntVector InVector) | |
FVector (FIntPoint A) | |
FORCEINLINE | FVector (EForceInit) |
FORCEINLINE FVector | operator^ (const FVector &V) const |
FORCEINLINE float | operator| (const FVector &V) const |
FORCEINLINE FVector | operator+ (const FVector &V) const |
FORCEINLINE FVector | operator- (const FVector &V) const |
FORCEINLINE FVector | operator- (float Bias) const |
FORCEINLINE FVector | operator+ (float Bias) const |
FORCEINLINE FVector | operator* (float Scale) const |
FVector | operator/ (float Scale) const |
FORCEINLINE FVector | operator* (const FVector &V) const |
FORCEINLINE FVector | operator/ (const FVector &V) const |
bool | operator== (const FVector &V) const |
bool | operator!= (const FVector &V) const |
bool | Equals (const FVector &V, float Tolerance=KINDA_SMALL_NUMBER) const |
bool | AllComponentsEqual (float Tolerance=KINDA_SMALL_NUMBER) const |
FORCEINLINE FVector | operator- () const |
FORCEINLINE FVector | operator+= (const FVector &V) |
FORCEINLINE FVector | operator-= (const FVector &V) |
FORCEINLINE FVector | operator*= (float Scale) |
FVector | operator/= (float V) |
FVector | operator*= (const FVector &V) |
FVector | operator/= (const FVector &V) |
float & | operator[] (int32 Index) |
float | operator[] (int32 Index) const |
float & | Component (int32 Index) |
float | Component (int32 Index) const |
void | Set (float InX, float InY, float InZ) |
float | GetMax () const |
float | GetAbsMax () const |
float | GetMin () const |
float | GetAbsMin () const |
FVector | ComponentMin (const FVector &Other) const |
FVector | ComponentMax (const FVector &Other) const |
FVector | GetAbs () const |
float | Size () const |
float | SizeSquared () const |
float | Size2D () const |
float | SizeSquared2D () const |
bool | IsNearlyZero (float Tolerance=KINDA_SMALL_NUMBER) const |
bool | IsZero () const |
bool | Normalize (float Tolerance=SMALL_NUMBER) |
bool | IsNormalized () const |
void | ToDirectionAndLength (FVector &OutDir, float &OutLength) const |
FORCEINLINE FVector | GetSignVector () const |
FVector | Projection () const |
FORCEINLINE FVector | GetUnsafeNormal () const |
FVector | GridSnap (const float &GridSz) const |
FVector | BoundToCube (float Radius) const |
FVector | GetClampedToSize (float Min, float Max) const |
FVector | GetClampedToSize2D (float Min, float Max) const |
FVector | GetClampedToMaxSize (float MaxSize) const |
FVector | GetClampedToMaxSize2D (float MaxSize) const |
FVector | Reciprocal () const |
bool | IsUniform (float Tolerance=KINDA_SMALL_NUMBER) const |
FVector | MirrorByVector (const FVector &MirrorNormal) const |
FVector | RotateAngleAxis (const float AngleDeg, const FVector &Axis) const |
FVector | GetSafeNormal (float Tolerance=SMALL_NUMBER) const |
FVector | GetSafeNormal2D (float Tolerance=SMALL_NUMBER) const |
FORCEINLINE float | CosineAngle2D (FVector B) const |
FORCEINLINE FVector | ProjectOnTo (const FVector &A) const |
FORCEINLINE FVector | ProjectOnToNormal (const FVector &Normal) const |
FRotator | ToOrientationRotator () const |
FQuat | ToOrientationQuat () const |
FRotator | Rotation () const |
void | FindBestAxisVectors (FVector &Axis1, FVector &Axis2) const |
void | UnwindEuler () |
bool | ContainsNaN () const |
FORCEINLINE bool | IsUnit (float LengthSquaredTolerance=KINDA_SMALL_NUMBER) const |
FString | ToString () const |
bool | InitFromString (const FString &InSourceString) |
FVector2D | UnitCartesianToSpherical () const |
float | HeadingAngle () const |
Static Public Member Functions | |
static FORCEINLINE FVector | CrossProduct (const FVector &A, const FVector &B) |
static FORCEINLINE float | DotProduct (const FVector &A, const FVector &B) |
static void | CreateOrthonormalBasis (FVector &XAxis, FVector &YAxis, FVector &ZAxis) |
static bool | PointsAreSame (const FVector &P, const FVector &Q) |
static bool | PointsAreNear (const FVector &Point1, const FVector &Point2, float Dist) |
static float | PointPlaneDist (const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal) |
static FVector | PointPlaneProject (const FVector &Point, const FVector &A, const FVector &B, const FVector &C) |
static FVector | PointPlaneProject (const FVector &Point, const FVector &PlaneBase, const FVector &PlaneNormal) |
static FVector | VectorPlaneProject (const FVector &V, const FVector &PlaneNormal) |
static FORCEINLINE float | Dist (const FVector &V1, const FVector &V2) |
static FORCEINLINE float | Distance (const FVector &V1, const FVector &V2) |
static FORCEINLINE float | DistXY (const FVector &V1, const FVector &V2) |
static FORCEINLINE float | Dist2D (const FVector &V1, const FVector &V2) |
static FORCEINLINE float | DistSquared (const FVector &V1, const FVector &V2) |
static FORCEINLINE float | DistSquaredXY (const FVector &V1, const FVector &V2) |
static FORCEINLINE float | DistSquared2D (const FVector &V1, const FVector &V2) |
static FORCEINLINE float | BoxPushOut (const FVector &Normal, const FVector &Size) |
static bool | Parallel (const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL) |
static bool | Coincident (const FVector &Normal1, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL) |
static bool | Orthogonal (const FVector &Normal1, const FVector &Normal2, float OrthogonalCosineThreshold=THRESH_NORMALS_ARE_ORTHOGONAL) |
static bool | Coplanar (const FVector &Base1, const FVector &Normal1, const FVector &Base2, const FVector &Normal2, float ParallelCosineThreshold=THRESH_NORMALS_ARE_PARALLEL) |
static float | Triple (const FVector &X, const FVector &Y, const FVector &Z) |
static float | EvaluateBezier (const FVector *ControlPoints, int32 NumPoints, TArray< FVector > &OutPoints) |
static FVector | RadiansToDegrees (const FVector &RadVector) |
static FVector | DegreesToRadians (const FVector &DegVector) |
Public Attributes | |
float | X |
float | Y |
float | Z |
Static Public Attributes | |
static const FVector | ZeroVector |
A vector in 3-D space composed of components (X, Y, Z) with floating point precision.
|
explicit |
FORCEINLINE CONSTEXPR FVector::FVector | ( | float | InX, |
float | InY, | ||
float | InZ ) |
|
explicit |
|
explicit |
Constructs a vector from an FLinearColor.
InColor | Color to copy from. |
|
explicit |
Constructs a vector from an FIntVector.
InVector | FIntVector to copy from. |
|
explicit |
|
explicit |
FORCEINLINE bool FVector::AllComponentsEqual | ( | float | Tolerance = KINDA_SMALL_NUMBER | ) | const |
Checks whether all components of this vector are the same, within a tolerance.
Tolerance | Error tolerance. |
Definition at line 1186 of file Vector.h.
FORCEINLINE FVector FVector::BoundToCube | ( | float | Radius | ) | const |
|
inlinestatic |
See if two normal vectors are coincident (nearly parallel and point in the same direction).
Normal1 | First normalized vector. |
Normal2 | Second normalized vector. |
ParallelCosineThreshold | Normals are coincident if dot product (cosine of angle between them) is greater than or equal to this. For example: cos(1.0 degrees). |
Definition at line 1025 of file Vector.h.
FORCEINLINE float & FVector::Component | ( | int32 | Index | ) |
FORCEINLINE float FVector::Component | ( | int32 | Index | ) | const |
FORCEINLINE bool FVector::ContainsNaN | ( | ) | const |
|
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.
Base1 | The base point in the first plane. |
Normal1 | The normal of the first plane. |
Base2 | The base point in the second plane. |
Normal2 | The normal of the second plane. |
ParallelCosineThreshold | Normals are parallel if absolute value of dot product is greater than or equal to this. |
Definition at line 1037 of file Vector.h.
FORCEINLINE float FVector::CosineAngle2D | ( | FVector | B | ) | const |
|
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.
XAxis | The input basis' XAxis, and upon return the orthonormal basis' XAxis. |
YAxis | The input basis' YAxis, and upon return the orthonormal basis' YAxis. |
ZAxis | The input basis' ZAxis, and upon return the orthonormal basis' ZAxis. |
Euclidean distance between two points in the XY plane (ignoring Z).
V1 | The first point. |
V2 | The second point. |
Definition at line 1617 of file Vector.h.
FORCEINLINE bool FVector::Equals | ( | const FVector & | V, |
float | Tolerance = KINDA_SMALL_NUMBER ) const |
Check against another vector for equality, within specified error limits.
V | The vector to check against. |
Tolerance | Error tolerance. |
Definition at line 1181 of file Vector.h.
|
static |
Generates a list of sample points on a Bezier curve defined by 2 points.
ControlPoints | Array of 4 FVectors (vert1, controlpoint1, controlpoint2, vert2). |
NumPoints | Number of samples. |
OutPoints | Receives the output samples. |
Find good arbitrary axis vectors to represent U and V axes of a plane, using this vector as the normal of the plane.
Axis1 | Reference to first axis. |
Axis2 | Reference to second axis. |
FORCEINLINE FVector FVector::GetAbs | ( | ) | const |
FORCEINLINE float FVector::GetAbsMax | ( | ) | const |
FORCEINLINE float FVector::GetAbsMin | ( | ) | const |
FORCEINLINE FVector FVector::GetClampedToMaxSize | ( | float | MaxSize | ) | const |
FORCEINLINE FVector FVector::GetClampedToMaxSize2D | ( | float | MaxSize | ) | const |
FORCEINLINE FVector FVector::GetClampedToSize | ( | float | Min, |
float | Max ) const |
FORCEINLINE FVector FVector::GetClampedToSize2D | ( | float | Min, |
float | Max ) const |
FORCEINLINE float FVector::GetMax | ( | ) | const |
FORCEINLINE float FVector::GetMin | ( | ) | const |
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.
Tolerance | Minimum squared vector length. |
Definition at line 1520 of file Vector.h.
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.
Tolerance | Minimum squared vector length. |
Definition at line 1537 of file Vector.h.
FORCEINLINE FVector FVector::GetSignVector | ( | ) | const |
FORCEINLINE FVector FVector::GetUnsafeNormal | ( | ) | const |
Calculates normalized version of vector without checking for zero length.
Definition at line 1392 of file Vector.h.
FVector FVector::GridSnap | ( | const float & | GridSz | ) | const |
Gets a copy of this vector snapped to a grid.
GridSz | Grid dimension. |
FORCEINLINE float FVector::HeadingAngle | ( | ) | const |
bool FVector::InitFromString | ( | const FString & | InSourceString | ) |
FORCEINLINE bool FVector::IsNearlyZero | ( | float | Tolerance = KINDA_SMALL_NUMBER | ) | const |
FORCEINLINE bool FVector::IsNormalized | ( | ) | const |
FORCEINLINE bool FVector::IsUniform | ( | float | Tolerance = KINDA_SMALL_NUMBER | ) | const |
FORCEINLINE bool FVector::IsUnit | ( | float | LengthSquaredTolerance = KINDA_SMALL_NUMBER | ) | const |
FORCEINLINE bool FVector::IsZero | ( | ) | const |
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.
Tolerance | Minimum squared length of vector for normalization. |
Definition at line 1344 of file Vector.h.
FORCEINLINE bool FVector::operator!= | ( | const FVector & | V | ) | const |
FORCEINLINE FVector FVector::operator* | ( | float | Scale | ) | const |
FORCEINLINE FVector FVector::operator*= | ( | float | Scale | ) |
FORCEINLINE FVector FVector::operator+ | ( | float | Bias | ) | const |
FORCEINLINE FVector FVector::operator- | ( | ) | const |
FORCEINLINE FVector FVector::operator- | ( | float | Bias | ) | const |
FORCEINLINE FVector FVector::operator/ | ( | float | Scale | ) | const |
FORCEINLINE FVector FVector::operator/= | ( | float | V | ) |
FORCEINLINE bool FVector::operator== | ( | const FVector & | V | ) | const |
FORCEINLINE float & FVector::operator[] | ( | int32 | Index | ) |
FORCEINLINE float FVector::operator[] | ( | int32 | Index | ) | const |
FORCEINLINE float FVector::operator| | ( | const FVector & | V | ) | const |
|
inlinestatic |
See if two normal vectors are nearly orthogonal (perpendicular), meaning the angle between them is close to 90 degrees.
Normal1 | First normalized vector. |
Normal2 | Second normalized vector. |
OrthogonalCosineThreshold | Normals 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). |
Definition at line 1031 of file Vector.h.
|
inlinestatic |
See if two normal vectors are nearly parallel, meaning the angle between them is close to 0 degrees.
Normal1 | First normalized vector. |
Normal1 | Second normalized vector. |
ParallelCosineThreshold | Normals 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). |
Definition at line 1019 of file Vector.h.
|
inlinestatic |
Calculate the signed distance (in the direction of the normal) between a point and a plane.
Point | The Point we are checking. |
PlaneBase | The Base Point in the plane. |
PlaneNormal | The Normal of the plane (assumed to be unit length). |
Definition at line 996 of file Vector.h.
|
static |
Calculate the projection of a point on the plane defined by counter-clockwise (CCW) points A,B,C.
Point | The point to project onto the plane |
A | 1st of three points in CCW order defining the plane |
B | 2nd of three points in CCW order defining the plane |
C | 3rd of three points in CCW order defining the plane |
|
inlinestatic |
Calculate the projection of a point on the plane defined by PlaneBase and PlaneNormal.
Point | The point to project onto the plane |
PlaneBase | Point on the plane |
PlaneNorm | Normal of the plane (assumed to be unit length). |
Definition at line 1007 of file Vector.h.
|
inlinestatic |
Compare two points and see if they're within specified distance.
Point1 | First vector. |
Point2 | Second vector. |
Dist | Specified distance. |
Definition at line 987 of file Vector.h.
FORCEINLINE FVector FVector::Projection | ( | ) | const |
Gets a copy of this vector projected onto the input vector, which is assumed to be unit length.
Normal | Vector to project onto (assumed to be unit length). |
Definition at line 1577 of file Vector.h.
FORCEINLINE FVector FVector::Reciprocal | ( | ) | const |
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.
FORCEINLINE void FVector::Set | ( | float | InX, |
float | InY, | ||
float | InZ ) |
FORCEINLINE float FVector::Size | ( | ) | const |
FORCEINLINE float FVector::Size2D | ( | ) | const |
FORCEINLINE float FVector::SizeSquared | ( | ) | const |
FORCEINLINE float FVector::SizeSquared2D | ( | ) | const |
FORCEINLINE void FVector::ToDirectionAndLength | ( | FVector & | OutDir, |
float & | OutLength ) const |
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.
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.
FORCEINLINE FString FVector::ToString | ( | ) | const |
FVector2D FVector::UnitCartesianToSpherical | ( | ) | const |
Converts a Cartesian unit vector into spherical coordinates on the unit sphere.
void FVector::UnwindEuler | ( | ) |
When this vector contains Euler angles (degrees), ensure that angles are between +/-180
Calculate the projection of a vector on the plane defined by PlaneNormal.
V | The vector to project onto the plane. |
PlaneNormal | Normal of the plane (assumed to be unit length). |
Definition at line 1014 of file Vector.h.