Ark Server API (ASA) - Wiki
Loading...
Searching...
No Matches
UE::Math::TVector2< T > Struct Template Reference

#include <Vector2D.h>

Public Types

using FReal = T
 

Public Member Functions

FORCEINLINE TVector2 ()
 
FORCEINLINE TVector2 (T InX, T InY)
 
FORCEINLINE TVector2 (T InF)
 
template<typename IntType >
FORCEINLINE TVector2 (TIntPoint< IntType > InPos)
 
FORCEINLINE TVector2 (EForceInit)
 
FORCEINLINE TVector2 (ENoInit)
 
FORCEINLINE TVector2 (const TVector< T > &V)
 
FORCEINLINE TVector2 (const TVector4< T > &V)
 
FORCEINLINE TVector2< Toperator+ (const TVector2< T > &V) const
 
FORCEINLINE TVector2< Toperator- (const TVector2< T > &V) const
 
FORCEINLINE TVector2< Toperator* (T Scale) const
 
TVector2< Toperator/ (T Scale) const
 
FORCEINLINE TVector2< Toperator+ (T A) const
 
FORCEINLINE TVector2< Toperator- (T A) const
 
FORCEINLINE TVector2< Toperator* (const TVector2< T > &V) const
 
TVector2< Toperator/ (const TVector2< T > &V) const
 
FORCEINLINE T operator| (const TVector2< T > &V) const
 
FORCEINLINE T operator^ (const TVector2< T > &V) const
 
bool operator== (const TVector2< T > &V) const
 
bool operator!= (const TVector2< T > &V) const
 
bool operator< (const TVector2< T > &Other) const
 
bool operator> (const TVector2< T > &Other) const
 
bool operator<= (const TVector2< T > &Other) const
 
bool operator>= (const TVector2< T > &Other) const
 
bool ComponentwiseAllLessThan (const TVector2< T > &Other) const
 
bool ComponentwiseAllGreaterThan (const TVector2< T > &Other) const
 
bool ComponentwiseAllLessOrEqual (const TVector2< T > &Other) const
 
bool ComponentwiseAllGreaterOrEqual (const TVector2< T > &Other) const
 
FORCEINLINE TVector2< Toperator- () const
 
FORCEINLINE TVector2< Toperator+= (const TVector2< T > &V)
 
FORCEINLINE TVector2< Toperator-= (const TVector2< T > &V)
 
FORCEINLINE TVector2< Toperator*= (T Scale)
 
TVector2< Toperator/= (T V)
 
TVector2< Toperator*= (const TVector2< T > &V)
 
TVector2< Toperator/= (const TVector2< T > &V)
 
Toperator[] (int32 Index)
 
T operator[] (int32 Index) const
 
TComponent (int32 Index)
 
T Component (int32 Index) const
 
bool Equals (const TVector2< T > &V, T Tolerance=UE_KINDA_SMALL_NUMBER) const
 
void Set (T InX, T InY)
 
T GetMax () const
 
T GetAbsMax () const
 
T GetMin () const
 
T Size () const
 
FORCEINLINE T Length () const
 
T SizeSquared () const
 
FORCEINLINE T SquaredLength () const
 
T Dot (const TVector2< T > &V2) const
 
TVector2< TGetRotated (T AngleDeg) const
 
TVector2< TGetSafeNormal (T Tolerance=UE_SMALL_NUMBER) const
 
bool Normalize (T Tolerance=UE_SMALL_NUMBER)
 
bool IsNearlyZero (T Tolerance=UE_KINDA_SMALL_NUMBER) const
 
void ToDirectionAndLength (TVector2< T > &OutDir, double &OutLength) const
 
void ToDirectionAndLength (TVector2< T > &OutDir, float &OutLength) const
 
bool IsZero () const
 
FIntPoint IntPoint () const
 
TVector2< TRoundToVector () const
 
TVector2< TClampAxes (T MinAxisVal, T MaxAxisVal) const
 
FORCEINLINE TVector2< TGetSignVector () const
 
FORCEINLINE TVector2< TGetAbs () const
 
FString ToString () const
 
bool InitFromString (const FString &InSourceString)
 
bool Serialize (FArchive &Ar)
 
bool Serialize (FStructuredArchive::FSlot Slot)
 
bool SerializeFromMismatchedTag (FName StructTag, FArchive &Ar)
 
FORCEINLINE void DiagnosticCheckNaN ()
 
FORCEINLINE bool ContainsNaN () const
 
bool NetSerialize (FArchive &Ar, class UPackageMap *Map, bool &bOutSuccess)
 
TVector< TSphericalToUnitCartesian () const
 
template<typename FArg , TEMPLATE_REQUIRES(!std::is_same_v< T, FArg >) >
 TVector2 (const TVector2< FArg > &From)
 

Static Public Member Functions

static TVector2< TZero ()
 
static TVector2< TOne ()
 
static TVector2< TUnitX ()
 
static TVector2< TUnitY ()
 
static FORCEINLINE T DotProduct (const TVector2< T > &A, const TVector2< T > &B)
 
static FORCEINLINE T DistSquared (const TVector2< T > &V1, const TVector2< T > &V2)
 
static FORCEINLINE T Distance (const TVector2< T > &V1, const TVector2< T > &V2)
 
static FORCEINLINE T CrossProduct (const TVector2< T > &A, const TVector2< T > &B)
 
static FORCEINLINE TVector2< TMax (const TVector2< T > &A, const TVector2< T > &B)
 
static FORCEINLINE TVector2< TMin (const TVector2< T > &A, const TVector2< T > &B)
 

Public Attributes

union { 
 
   struct { 
 
      T   X 
 
      T   Y 
 
   }  
 
   T   XY [2] 
 
};  
 

Static Public Attributes

static const TVector2< TZeroVector
 
static const TVector2< TUnitVector
 
static const TVector2< TUnit45Deg
 

Detailed Description

template<typename T>
struct UE::Math::TVector2< T >

Definition at line 31 of file Vector2D.h.

Member Typedef Documentation

◆ FReal

template<typename T >
using UE::Math::TVector2< T >::FReal = T

Definition at line 36 of file Vector2D.h.

Constructor & Destructor Documentation

◆ TVector2() [1/9]

template<typename T >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( )
inline

Default constructor (no initialization).

Definition at line 78 of file Vector2D.h.

◆ TVector2() [2/9]

template<typename T >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( T InX,
T InY )

Constructor using initial values for each component.

Parameters
InXX coordinate.
InYY coordinate.

Definition at line 811 of file Vector2D.h.

◆ TVector2() [3/9]

template<typename T >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( T InF)
explicit

Constructor initializing both components to a single T value.

Parameters
InFValue to set both components to.

Definition at line 816 of file Vector2D.h.

◆ TVector2() [4/9]

template<typename T >
template<typename IntType >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( TIntPoint< IntType > InPos)

Constructs a vector from an FIntPoint.

Parameters
InPosInteger point used to set this vector.

Definition at line 822 of file Vector2D.h.

◆ TVector2() [5/9]

template<typename T >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( EForceInit )
explicit

Constructor which initializes all components to zero.

Parameters
EForceInitForce init enum

Definition at line 829 of file Vector2D.h.

◆ TVector2() [6/9]

template<typename T >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( ENoInit )
inlineexplicit

Constructor that does not initialize. More explicit than the default constructor.

Parameters
ENoInitDon't init

Definition at line 115 of file Vector2D.h.

◆ TVector2() [7/9]

template<typename T >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( const TVector< T > & V)
explicit

Constructs a vector from an FVector. Copies the X and Y components from the FVector.

Parameters
VVector to copy from.

Definition at line 2675 of file Vector.h.

◆ TVector2() [8/9]

template<typename T >
FORCEINLINE UE::Math::TVector2< T >::TVector2 ( const TVector4< T > & V)
explicit

Constructs a vector from an FVector4. Copies the X and Y components from the FVector4.

Parameters
VVector to copy from.

Definition at line 1043 of file Vector4.h.

◆ TVector2() [9/9]

template<typename T >
template<typename FArg , TEMPLATE_REQUIRES(!std::is_same_v< T, FArg >) >
UE::Math::TVector2< T >::TVector2 ( const TVector2< FArg > & From)
inlineexplicit

Definition at line 706 of file Vector2D.h.

Member Function Documentation

◆ ClampAxes()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::ClampAxes ( T MinAxisVal,
T MaxAxisVal ) const

Creates a copy of this vector with both axes clamped to the given range.

Returns
New vector with clamped axes.

Definition at line 1209 of file Vector2D.h.

◆ Component() [1/2]

template<typename T >
FORCEINLINE T & UE::Math::TVector2< T >::Component ( int32 Index)

Gets a specific component of the vector.

Parameters
IndexThe index of the component required.
Returns
Reference to the specified component.

Definition at line 1166 of file Vector2D.h.

◆ Component() [2/2]

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::Component ( int32 Index) const

Gets a specific component of the vector.

Parameters
IndexThe index of the component required.
Returns
Copy of the specified component.

Definition at line 1174 of file Vector2D.h.

◆ ComponentwiseAllGreaterOrEqual()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::ComponentwiseAllGreaterOrEqual ( const TVector2< T > & Other) const

Checks whether both components of this vector are greater than or equal to another.

Parameters
OtherThe vector to compare against.
Returns
true if both components of this are greater than or equal to Other, otherwise false.

Definition at line 962 of file Vector2D.h.

◆ ComponentwiseAllGreaterThan()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::ComponentwiseAllGreaterThan ( const TVector2< T > & Other) const

Checks whether both components of this vector are greater than another.

Parameters
OtherThe vector to compare against.
Returns
true if both components of this are greater than Other, otherwise false.

Definition at line 950 of file Vector2D.h.

◆ ComponentwiseAllLessOrEqual()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::ComponentwiseAllLessOrEqual ( const TVector2< T > & Other) const

Checks whether both components of this vector are less than or equal to another.

Parameters
OtherThe vector to compare against.
Returns
true if both components of this are less than or equal to Other, otherwise false.

Definition at line 956 of file Vector2D.h.

◆ ComponentwiseAllLessThan()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::ComponentwiseAllLessThan ( const TVector2< T > & Other) const

Checks whether both components of this vector are less than another.

Parameters
OtherThe vector to compare against.
Returns
true if both components of this are less than Other, otherwise false.

Definition at line 944 of file Vector2D.h.

◆ ContainsNaN()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::ContainsNaN ( ) const
inline

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

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

Definition at line 669 of file Vector2D.h.

◆ CrossProduct()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::CrossProduct ( const TVector2< T > & A,
const TVector2< T > & B )
static

Calculate the cross product of two vectors.

Parameters
AThe first vector.
BThe second vector.
Returns
The cross product.

Definition at line 914 of file Vector2D.h.

◆ DiagnosticCheckNaN()

template<typename T >
FORCEINLINE void UE::Math::TVector2< T >::DiagnosticCheckNaN ( )
inline

Definition at line 661 of file Vector2D.h.

◆ Distance()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::Distance ( const TVector2< T > & V1,
const TVector2< T > & V2 )
static

Distance between two 2D points.

Parameters
V1The first point.
V2The second point.
Returns
The distance between two 2D points.

Definition at line 908 of file Vector2D.h.

◆ DistSquared()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::DistSquared ( const TVector2< T > & V1,
const TVector2< T > & V2 )
static

Squared distance between two 2D points.

Parameters
V1The first point.
V2The second point.
Returns
The squared distance between two 2D points.

Definition at line 902 of file Vector2D.h.

◆ Dot()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::Dot ( const TVector2< T > & V2) const

Get the dot product of this vector against another.

Parameters
V2The vector to measure dot product against.
Returns
The dot product.

Definition at line 1074 of file Vector2D.h.

◆ DotProduct()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::DotProduct ( const TVector2< T > & A,
const TVector2< T > & B )
static

Calculates the dot product of two vectors.

Parameters
AThe first vector.
BThe second vector.
Returns
The dot product.

Definition at line 896 of file Vector2D.h.

◆ Equals()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::Equals ( const TVector2< T > & V,
T Tolerance = UE_KINDA_SMALL_NUMBER ) const

Checks for equality with error-tolerant comparison.

Parameters
VThe vector to compare.
ToleranceError tolerance.
Returns
true if the vectors are equal within specified tolerance, otherwise false.

Definition at line 968 of file Vector2D.h.

◆ GetAbs()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::GetAbs ( ) const

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

Returns
A copy of this vector with absolute value of each component.

Definition at line 1225 of file Vector2D.h.

◆ GetAbsMax()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::GetAbsMax ( ) const

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

Returns
The maximum absolute value of the vector's components.

Definition at line 1050 of file Vector2D.h.

◆ GetMax()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::GetMax ( ) const

Get the maximum value of the vector's components.

Returns
The maximum value of the vector's components.

Definition at line 1044 of file Vector2D.h.

◆ GetMin()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::GetMin ( ) const

Get the minimum value of the vector's components.

Returns
The minimum value of the vector's components.

Definition at line 1056 of file Vector2D.h.

◆ GetRotated()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::GetRotated ( T AngleDeg) const

Rotates around axis (0,0,1)

Parameters
AngleDegAngle to rotate (in degrees)
Returns
Rotated Vector

Definition at line 1080 of file Vector2D.h.

◆ GetSafeNormal()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::GetSafeNormal ( T Tolerance = UE_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.

Parameters
ToleranceMinimum squared length of vector for normalization.
Returns
A normalized copy of the vector if safe, (0,0) otherwise.

Definition at line 1095 of file Vector2D.h.

◆ GetSignVector()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::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.

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

Definition at line 1215 of file Vector2D.h.

◆ InitFromString()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::InitFromString ( const FString & InSourceString)

Initialize this Vector based on an FString. The String is expected to contain X=, Y=. The TVector2<T> will be bogus when InitFromString returns false.

Parameters
InSourceStringFString containing the vector values.
Returns
true if the X,Y values were read successfully; false otherwise.

Definition at line 1237 of file Vector2D.h.

◆ IntPoint()

template<typename T >
FORCEINLINE FIntPoint UE::Math::TVector2< T >::IntPoint ( ) const

Get this vector as an Int Point.

Returns
New Int Point from this vector.

Definition at line 1182 of file Vector2D.h.

◆ IsNearlyZero()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::IsNearlyZero ( T Tolerance = UE_KINDA_SMALL_NUMBER) const

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

Parameters
ToleranceError tolerance.
Returns
true if vector is in tolerance to zero, otherwise false.

Definition at line 1153 of file Vector2D.h.

◆ IsZero()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::IsZero ( ) const

Checks whether all components of the vector are exactly zero.

Returns
true if vector is exactly zero, otherwise false.

Definition at line 1160 of file Vector2D.h.

◆ Length()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::Length ( ) const
inline

Get the length (magnitude) of this vector.

Returns
The length of this vector.
See also
Size - This function is a synonym for Size()

Definition at line 509 of file Vector2D.h.

◆ Max()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::Max ( const TVector2< T > & A,
const TVector2< T > & B )
static

Returns a vector with the maximum component for each dimension from the pair of vectors.

Parameters
AThe first vector.
BThe second vector.
Returns
The max vector.

Definition at line 920 of file Vector2D.h.

◆ Min()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::Min ( const TVector2< T > & A,
const TVector2< T > & B )
static

Returns a vector with the minimum component for each dimension from the pair of vectors.

Parameters
AThe first vector.
BThe second vector.
Returns
The min vector.

Definition at line 926 of file Vector2D.h.

◆ NetSerialize()

template<typename T >
bool UE::Math::TVector2< T >::NetSerialize ( FArchive & Ar,
class UPackageMap * Map,
bool & bOutSuccess )
inline

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

Definition at line 679 of file Vector2D.h.

◆ Normalize()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::Normalize ( T Tolerance = UE_SMALL_NUMBER)

Normalize this vector in-place if it is large enough, set it to (0,0) otherwise. (Note this is different from TVector<>::Normalize, which leaves the vector unchanged if it is too small to normalize.)

Parameters
ToleranceMinimum squared length of vector for normalization.
See also
GetSafeNormal()
Returns
true if the vector was normalized correctly, false if it was too small and set to zero.

Definition at line 1107 of file Vector2D.h.

◆ One()

template<typename T >
static TVector2< T > UE::Math::TVector2< T >::One ( )
inlinestatic

Definition at line 71 of file Vector2D.h.

◆ operator!=()

template<typename T >
FORCEINLINE bool UE::Math::TVector2< T >::operator!= ( const TVector2< T > & V) const

Compares this vector against another for inequality.

Parameters
VThe vector to compare against.
Returns
true if the two vectors are not equal, otherwise false.

Definition at line 938 of file Vector2D.h.

◆ operator*() [1/2]

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

Parameters
VThe other vector to multiply this by.
Returns
The result of the multiplication.

Definition at line 872 of file Vector2D.h.

◆ operator*() [2/2]

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::operator* ( T Scale) const

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

Parameters
ScaleHow much to scale the vector by.
Returns
The result of scaling this vector.

Definition at line 847 of file Vector2D.h.

◆ operator*=() [1/2]

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

Parameters
VThe vector to multiply with.
Returns
Copy of the vector after multiplication.

Definition at line 1009 of file Vector2D.h.

◆ operator*=() [2/2]

Scales this vector.

Parameters
ScaleThe scale to multiply vector by.
Returns
Copy of the vector after scaling.

Definition at line 994 of file Vector2D.h.

◆ operator+() [1/2]

Gets the result of adding two vectors together.

Parameters
VThe other vector to add to this.
Returns
The result of adding the vectors together.

Definition at line 835 of file Vector2D.h.

◆ operator+() [2/2]

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

Parameters
AT to add to each component.
Returns
The result of adding A to each component.

Definition at line 860 of file Vector2D.h.

◆ operator+=()

Adds another vector to this.

Parameters
VThe other vector to add.
Returns
Copy of the vector after addition.

Definition at line 980 of file Vector2D.h.

◆ operator-() [1/3]

Gets a negated copy of the vector.

Returns
A negated copy of the vector.

Definition at line 974 of file Vector2D.h.

◆ operator-() [2/3]

Gets the result of subtracting a vector from this one.

Parameters
VThe other vector to subtract from this.
Returns
The result of the subtraction.

Definition at line 841 of file Vector2D.h.

◆ operator-() [3/3]

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

Parameters
AT to subtract from each component
Returns
The result of subtracting A from each component.

Definition at line 866 of file Vector2D.h.

◆ operator-=()

Subtracts another vector from this.

Parameters
VThe other vector to subtract.
Returns
Copy of the vector after subtraction.

Definition at line 987 of file Vector2D.h.

◆ operator/() [1/2]

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

Parameters
VThe other vector to divide this by.
Returns
The result of the division.

Definition at line 878 of file Vector2D.h.

◆ operator/() [2/2]

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::operator/ ( T Scale) const

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

Parameters
ScaleHow much to divide the vector by.
Returns
The result of division on this vector.

Definition at line 853 of file Vector2D.h.

◆ operator/=() [1/2]

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

Parameters
VThe vector to divide by.
Returns
Copy of the vector after division.

Definition at line 1016 of file Vector2D.h.

◆ operator/=() [2/2]

Divides this vector.

Parameters
VWhat to divide vector by.
Returns
Copy of the vector after division.

Definition at line 1001 of file Vector2D.h.

◆ operator<()

template<typename T >
bool UE::Math::TVector2< T >::operator< ( const TVector2< T > & Other) const
inline

Deprecated comparison operator. Use ComponentwiseAllLessThan.

Parameters
OtherThe vector to compare against.
Returns
true if this is the smaller vector, otherwise false.

Definition at line 240 of file Vector2D.h.

◆ operator<=()

template<typename T >
bool UE::Math::TVector2< T >::operator<= ( const TVector2< T > & Other) const
inline

Deprecated comparison operator. Use ComponentwiseAllLessOrEqual.

Parameters
OtherThe vector to compare against.
Returns
true if this vector is less than or equal to the other vector, otherwise false.

Definition at line 264 of file Vector2D.h.

◆ operator==()

Compares this vector against another for equality.

Parameters
VThe vector to compare against.
Returns
true if the two vectors are equal, otherwise false.

Definition at line 932 of file Vector2D.h.

◆ operator>()

template<typename T >
bool UE::Math::TVector2< T >::operator> ( const TVector2< T > & Other) const
inline

Deprecated comparison operator. Use ComponentwiseAllGreaterThan.

Parameters
OtherThe vector to compare against.
Returns
true if this is the larger vector, otherwise false.

Definition at line 252 of file Vector2D.h.

◆ operator>=()

template<typename T >
bool UE::Math::TVector2< T >::operator>= ( const TVector2< T > & Other) const
inline

Deprecated comparison operator. Use ComponentwiseAllGreaterOrEqual.

Parameters
OtherThe vector to compare against.
Returns
true if this vector is greater than or equal to the other vector, otherwise false.

Definition at line 276 of file Vector2D.h.

◆ operator[]() [1/2]

Gets specific component of the vector.

Parameters
Indexthe index of vector component
Returns
reference to component.

Definition at line 1023 of file Vector2D.h.

◆ operator[]() [2/2]

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::operator[] ( int32 Index) const

Gets specific component of the vector.

Parameters
Indexthe index of vector component
Returns
copy of component value.

Definition at line 1030 of file Vector2D.h.

◆ operator^()

Calculates cross product of this vector and another.

Parameters
VThe other vector.
Returns
The cross product.

Definition at line 890 of file Vector2D.h.

◆ operator|()

Calculates dot product of this vector and another.

Parameters
VThe other vector.
Returns
The dot product.

Definition at line 884 of file Vector2D.h.

◆ RoundToVector()

template<typename T >
FORCEINLINE TVector2< T > UE::Math::TVector2< T >::RoundToVector ( ) const

Get this vector as a vector where each component has been rounded to the nearest int.

Returns
New TVector2<T> from this vector that is rounded.

Definition at line 1196 of file Vector2D.h.

◆ Serialize() [1/2]

template<typename T >
bool UE::Math::TVector2< T >::Serialize ( FArchive & Ar)
inline

Definition at line 637 of file Vector2D.h.

◆ Serialize() [2/2]

template<typename T >
bool UE::Math::TVector2< T >::Serialize ( FStructuredArchive::FSlot Slot)
inline

Definition at line 643 of file Vector2D.h.

◆ SerializeFromMismatchedTag()

bool FVector2d::SerializeFromMismatchedTag ( FName StructTag,
FArchive & Ar )
inline

Definition at line 1260 of file Vector2D.h.

◆ Set()

template<typename T >
FORCEINLINE void UE::Math::TVector2< T >::Set ( T InX,
T InY )

Set the values of the vector directly.

Parameters
InXNew X coordinate.
InYNew Y coordinate.

Definition at line 1037 of file Vector2D.h.

◆ Size()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::Size ( ) const

Get the length (magnitude) of this vector.

Returns
The length of this vector.
See also
Length - This function is a synonym for Length()

Definition at line 1062 of file Vector2D.h.

◆ SizeSquared()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::SizeSquared ( ) const

Get the squared length of this vector.

Returns
The squared length of this vector.
See also
LengthSquared - This function is a synonym for LengthSquared()

Definition at line 1068 of file Vector2D.h.

◆ SphericalToUnitCartesian()

template<typename T >
TVector< T > UE::Math::TVector2< T >::SphericalToUnitCartesian ( ) const
inline

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

Definition at line 2682 of file Vector.h.

◆ SquaredLength()

template<typename T >
FORCEINLINE T UE::Math::TVector2< T >::SquaredLength ( ) const
inline

Get the squared length of this vector.

Returns
The squared length of this vector.
See also
SizeSquared - This function is a synonym for SizeSquared()

Definition at line 525 of file Vector2D.h.

◆ ToDirectionAndLength() [1/2]

template<typename T >
FORCEINLINE void UE::Math::TVector2< T >::ToDirectionAndLength ( TVector2< T > & OutDir,
double & OutLength ) const

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

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

Definition at line 1123 of file Vector2D.h.

◆ ToDirectionAndLength() [2/2]

template<typename T >
FORCEINLINE void UE::Math::TVector2< T >::ToDirectionAndLength ( TVector2< T > & OutDir,
float & OutLength ) const

Definition at line 1138 of file Vector2D.h.

◆ ToString()

template<typename T >
FORCEINLINE FString UE::Math::TVector2< T >::ToString ( ) const

Get a textual representation of the vector.

Returns
Text describing the vector.

Definition at line 1231 of file Vector2D.h.

◆ UnitX()

template<typename T >
static TVector2< T > UE::Math::TVector2< T >::UnitX ( )
inlinestatic

Definition at line 72 of file Vector2D.h.

◆ UnitY()

template<typename T >
static TVector2< T > UE::Math::TVector2< T >::UnitY ( )
inlinestatic

Definition at line 73 of file Vector2D.h.

◆ Zero()

template<typename T >
static TVector2< T > UE::Math::TVector2< T >::Zero ( )
inlinestatic

Definition at line 70 of file Vector2D.h.

Member Data Documentation

◆ [union]

union { ... } UE::Math::TVector2< T >

◆ Unit45Deg

template<typename T >
const TVector2<T> UE::Math::TVector2< T >::Unit45Deg
static

Global 2D unit vector constant along the 45 degree angle or symmetrical positive axes (sqrt(.5),sqrt(.5)) or (.707,.707). https://en.wikipedia.org/wiki/Unit_vector

Note
The UnitVector above is actually a value with axes of 1 rather than a magnitude of one.

Definition at line 68 of file Vector2D.h.

◆ UnitVector

template<typename T >
const TVector2<T> UE::Math::TVector2< T >::UnitVector
static

Global 2D one vector (poorly named) constant (1,1).

Note
Incorrectly named "unit" vector though its magnitude/length/size is not one. Would fix, though likely used all over the world. Use Unit45Deg below for an actual unit vector.

Definition at line 61 of file Vector2D.h.

◆ X

template<typename T >
T UE::Math::TVector2< T >::X

Vector's X component.

Definition at line 43 of file Vector2D.h.

◆ XY

template<typename T >
T UE::Math::TVector2< T >::XY[2]

Definition at line 50 of file Vector2D.h.

◆ Y

template<typename T >
T UE::Math::TVector2< T >::Y

Vector's Y component.

Definition at line 46 of file Vector2D.h.

◆ ZeroVector

template<typename T >
const TVector2<T> UE::Math::TVector2< T >::ZeroVector
static

Global 2D zero vector constant (0,0)

Definition at line 54 of file Vector2D.h.


The documentation for this struct was generated from the following files: