Ark Server API (ASE) - Wiki
|
#include <Vector2D.h>
Public Member Functions | |
FORCEINLINE | FVector2D () |
FORCEINLINE | FVector2D (float InX, float InY) |
FORCEINLINE | FVector2D (FIntPoint InPos) |
FORCEINLINE | FVector2D (EForceInit) |
FORCEINLINE FVector2D | operator+ (const FVector2D &V) const |
FORCEINLINE FVector2D | operator- (const FVector2D &V) const |
FORCEINLINE FVector2D | operator* (float Scale) const |
FVector2D | operator/ (float Scale) const |
FORCEINLINE FVector2D | operator+ (float A) const |
FORCEINLINE FVector2D | operator- (float A) const |
FORCEINLINE FVector2D | operator* (const FVector2D &V) const |
FVector2D | operator/ (const FVector2D &V) const |
FORCEINLINE float | operator| (const FVector2D &V) const |
FORCEINLINE float | operator^ (const FVector2D &V) const |
bool | operator== (const FVector2D &V) const |
bool | operator!= (const FVector2D &V) const |
bool | operator< (const FVector2D &Other) const |
bool | operator> (const FVector2D &Other) const |
bool | operator<= (const FVector2D &Other) const |
bool | operator>= (const FVector2D &Other) const |
FORCEINLINE FVector2D | operator- () const |
FORCEINLINE FVector2D | operator+= (const FVector2D &V) |
FORCEINLINE FVector2D | operator-= (const FVector2D &V) |
FORCEINLINE FVector2D | operator*= (float Scale) |
FVector2D | operator/= (float V) |
FVector2D | operator*= (const FVector2D &V) |
FVector2D | operator/= (const FVector2D &V) |
float & | operator[] (int32 Index) |
float | operator[] (int32 Index) const |
float & | Component (int32 Index) |
float | Component (int32 Index) const |
bool | Equals (const FVector2D &V, float Tolerance=KINDA_SMALL_NUMBER) const |
void | Set (float InX, float InY) |
float | GetMax () const |
float | GetAbsMax () const |
float | GetMin () const |
float | Size () const |
float | SizeSquared () const |
FVector2D | GetRotated (float AngleDeg) const |
FVector2D | GetSafeNormal (float Tolerance=SMALL_NUMBER) const |
void | Normalize (float Tolerance=SMALL_NUMBER) |
bool | IsNearlyZero (float Tolerance=KINDA_SMALL_NUMBER) const |
void | ToDirectionAndLength (FVector2D &OutDir, float &OutLength) const |
bool | IsZero () const |
FIntPoint | IntPoint () const |
FVector2D | RoundToVector () const |
FVector2D | ClampAxes (float MinAxisVal, float MaxAxisVal) const |
FORCEINLINE FVector2D | GetSignVector () const |
FORCEINLINE FVector2D | GetAbs () const |
FORCEINLINE bool | ContainsNaN () const |
Static Public Member Functions | |
static FORCEINLINE float | DotProduct (const FVector2D &A, const FVector2D &B) |
static FORCEINLINE float | DistSquared (const FVector2D &V1, const FVector2D &V2) |
static FORCEINLINE float | Distance (const FVector2D &V1, const FVector2D &V2) |
static FORCEINLINE float | CrossProduct (const FVector2D &A, const FVector2D &B) |
Public Attributes | |
float | X |
float | Y |
Static Public Attributes | |
static const FVector2D | ZeroVector |
static const FVector2D | UnitVector |
A vector in 2-D space composed of components (X, Y) with floating point precision.
Definition at line 16 of file Vector2D.h.
|
inline |
Default constructor (no initialization).
Definition at line 35 of file Vector2D.h.
FORCEINLINE FVector2D::FVector2D | ( | float | InX, |
float | InY ) |
Constructor using initial values for each component.
InX | X coordinate. |
InY | Y coordinate. |
Definition at line 475 of file Vector2D.h.
FORCEINLINE FVector2D::FVector2D | ( | FIntPoint | InPos | ) |
Constructs a vector from an FIntPoint.
InPos | Integer point used to set this vector. |
Definition at line 480 of file Vector2D.h.
|
explicit |
Constructor which initializes all components to zero.
EForceInit | Force init enum |
Definition at line 487 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::ClampAxes | ( | float | MinAxisVal, |
float | MaxAxisVal ) const |
Creates a copy of this vector with both axes clamped to the given range.
Definition at line 811 of file Vector2D.h.
FORCEINLINE float & FVector2D::Component | ( | int32 | Index | ) |
Gets a specific component of the vector.
Index | The index of the component required. |
Definition at line 789 of file Vector2D.h.
FORCEINLINE float FVector2D::Component | ( | int32 | Index | ) | const |
Gets a specific component of the vector.
Index | The index of the component required. |
Definition at line 795 of file Vector2D.h.
|
inline |
Utility to check if there are any non-finite values (NaN or Inf) in this vector.
Definition at line 457 of file Vector2D.h.
Calculate the cross product of two vectors.
A | The first vector. |
B | The second vector. |
Definition at line 571 of file Vector2D.h.
Distance between two 2D points.
V1 | The first point. |
V2 | The second point. |
Definition at line 565 of file Vector2D.h.
Squared distance between two 2D points.
V1 | The first point. |
V2 | The second point. |
Definition at line 559 of file Vector2D.h.
Calculates the dot product of two vectors.
A | The first vector. |
B | The second vector. |
Definition at line 553 of file Vector2D.h.
FORCEINLINE bool FVector2D::Equals | ( | const FVector2D & | V, |
float | Tolerance = KINDA_SMALL_NUMBER ) const |
Checks for equality with error-tolerant comparison.
V | The vector to compare. |
Tolerance | Error tolerance. |
Definition at line 613 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::GetAbs | ( | ) | const |
Get a copy of this vector with absolute value of each component.
Definition at line 826 of file Vector2D.h.
FORCEINLINE float FVector2D::GetAbsMax | ( | ) | const |
Get the maximum absolute value of the vector's components.
Definition at line 695 of file Vector2D.h.
FORCEINLINE float FVector2D::GetMax | ( | ) | const |
Get the maximum value of the vector's components.
Definition at line 689 of file Vector2D.h.
FORCEINLINE float FVector2D::GetMin | ( | ) | const |
Get the minimum value of the vector's components.
Definition at line 701 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::GetRotated | ( | float | AngleDeg | ) | const |
Rotates around axis (0,0,1)
AngleDeg | Angle to rotate (in degrees) |
Definition at line 719 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::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 length of vector for normalization. |
Definition at line 734 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::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.
A | copy of the vector with each component set to +1 or -1 |
Definition at line 817 of file Vector2D.h.
FORCEINLINE FIntPoint FVector2D::IntPoint | ( | ) | const |
Get this vector as an Int Point.
Definition at line 801 of file Vector2D.h.
FORCEINLINE bool FVector2D::IsNearlyZero | ( | float | Tolerance = KINDA_SMALL_NUMBER | ) | const |
Checks whether vector is near to zero within a specified tolerance.
Tolerance | Error tolerance. |
Definition at line 776 of file Vector2D.h.
FORCEINLINE bool FVector2D::IsZero | ( | ) | const |
Checks whether all components of the vector are exactly zero.
Definition at line 783 of file Vector2D.h.
FORCEINLINE void FVector2D::Normalize | ( | float | Tolerance = SMALL_NUMBER | ) |
Normalize this vector in-place if it is large enough, set it to (0,0) otherwise.
Tolerance | Minimum squared length of vector for normalization. |
Definition at line 746 of file Vector2D.h.
FORCEINLINE bool FVector2D::operator!= | ( | const FVector2D & | V | ) | const |
Compares this vector against another for inequality.
V | The vector to compare against. |
Definition at line 583 of file Vector2D.h.
Gets the result of component-wise multiplication of this vector by another.
V | The other vector to multiply this by. |
Definition at line 529 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::operator* | ( | float | Scale | ) | const |
Gets the result of scaling the vector (multiplying each component by a value).
Scale | How much to scale the vector by. |
Definition at line 504 of file Vector2D.h.
Multiplies this vector with another vector, using component-wise multiplication.
V | The vector to multiply with. |
Definition at line 654 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::operator*= | ( | float | Scale | ) |
Scales this vector.
Scale | The scale to multiply vector by. |
Definition at line 639 of file Vector2D.h.
Gets the result of adding two vectors together.
V | The other vector to add to this. |
Definition at line 492 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::operator+ | ( | float | A | ) | const |
Gets the result of this vector + float A.
A | Float to add to each component. |
Definition at line 517 of file Vector2D.h.
Adds another vector to this.
V | The other vector to add. |
Definition at line 625 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::operator- | ( | ) | const |
Gets a negated copy of the vector.
Definition at line 619 of file Vector2D.h.
Gets the result of subtracting a vector from this one.
V | The other vector to subtract from this. |
Definition at line 498 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::operator- | ( | float | A | ) | const |
Gets the result of subtracting from each component of the vector.
A | Float to subtract from each component |
Definition at line 523 of file Vector2D.h.
Subtracts another vector from this.
V | The other vector to subtract. |
Definition at line 632 of file Vector2D.h.
Gets the result of component-wise division of this vector by another.
V | The other vector to divide this by. |
Definition at line 535 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::operator/ | ( | float | Scale | ) | const |
Gets the result of dividing each component of the vector by a value.
Scale | How much to divide the vector by. |
Definition at line 510 of file Vector2D.h.
Divides this vector by another vector, using component-wise division.
V | The vector to divide by. |
Definition at line 661 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::operator/= | ( | float | V | ) |
Divides this vector.
V | What to divide vector by. |
Definition at line 646 of file Vector2D.h.
FORCEINLINE bool FVector2D::operator< | ( | const FVector2D & | Other | ) | const |
Checks whether both components of this vector are less than another.
Other | The vector to compare against. |
Definition at line 589 of file Vector2D.h.
FORCEINLINE bool FVector2D::operator<= | ( | const FVector2D & | Other | ) | const |
Checks whether both components of this vector are less than or equal to another.
Other | The vector to compare against. |
Definition at line 601 of file Vector2D.h.
FORCEINLINE bool FVector2D::operator== | ( | const FVector2D & | V | ) | const |
Compares this vector against another for equality.
V | The vector to compare against. |
Definition at line 577 of file Vector2D.h.
FORCEINLINE bool FVector2D::operator> | ( | const FVector2D & | Other | ) | const |
Checks whether both components of this vector are greater than another.
Other | The vector to compare against. |
Definition at line 595 of file Vector2D.h.
FORCEINLINE bool FVector2D::operator>= | ( | const FVector2D & | Other | ) | const |
Checks whether both components of this vector are greater than or equal to another.
Other | The vector to compare against. |
Definition at line 607 of file Vector2D.h.
FORCEINLINE float & FVector2D::operator[] | ( | int32 | Index | ) |
Gets specific component of the vector.
Index | the index of vector component |
Definition at line 668 of file Vector2D.h.
FORCEINLINE float FVector2D::operator[] | ( | int32 | Index | ) | const |
Gets specific component of the vector.
Index | the index of vector component |
Definition at line 675 of file Vector2D.h.
FORCEINLINE float FVector2D::operator^ | ( | const FVector2D & | V | ) | const |
Calculates cross product of this vector and another.
V | The other vector. |
Definition at line 547 of file Vector2D.h.
FORCEINLINE float FVector2D::operator| | ( | const FVector2D & | V | ) | const |
Calculates dot product of this vector and another.
V | The other vector. |
Definition at line 541 of file Vector2D.h.
FORCEINLINE FVector2D FVector2D::RoundToVector | ( | ) | const |
Get this vector as a vector where each component has been rounded to the nearest int.
Definition at line 806 of file Vector2D.h.
FORCEINLINE void FVector2D::Set | ( | float | InX, |
float | InY ) |
Set the values of the vector directly.
InX | New X coordinate. |
InY | New Y coordinate. |
Definition at line 682 of file Vector2D.h.
FORCEINLINE float FVector2D::Size | ( | ) | const |
Get the length (magnitude) of this vector.
Definition at line 707 of file Vector2D.h.
FORCEINLINE float FVector2D::SizeSquared | ( | ) | const |
Get the squared length of this vector.
Definition at line 713 of file Vector2D.h.
FORCEINLINE void FVector2D::ToDirectionAndLength | ( | FVector2D & | OutDir, |
float & | OutLength ) const |
Util to convert this vector into a unit direction vector and its original length.
OutDir | Reference passed in to store unit direction vector. |
OutLength | Reference passed in to store length of the vector. |
Definition at line 761 of file Vector2D.h.
|
static |
Global 2D unit vector constant (1,1)
Definition at line 30 of file Vector2D.h.
float FVector2D::X |
Vector's X component.
Definition at line 19 of file Vector2D.h.
float FVector2D::Y |
Vector's Y component.
Definition at line 22 of file Vector2D.h.
|
static |
Global 2D zero vector constant (0,0)
Definition at line 27 of file Vector2D.h.