-
Notifications
You must be signed in to change notification settings - Fork 230
Vector2
Adrien GIVRY edited this page Sep 26, 2020
·
4 revisions
Mathematic representation of a 2D vector of floats
- C++ related class:
OvMaths::FVector2
Name | Type | Description |
---|---|---|
x | number |
X component of the Vector2 |
y | number |
Y component of the Vector2 |
Name | Input | Output | Description |
---|---|---|---|
new | Vector2 |
Creates an instance of Vector2 with x and y equals to zero | |
new |
number : xnumber : y |
Vector2 |
Creates an instance of Vector2 with the given values |
Name | Input | Output | Description |
---|---|---|---|
One | Vector2 |
Returns a (1,1) Vector2 | |
Zero | Vector |
Returns a (0,0) Vector2 | |
Length |
Vector2 : instance |
number |
Returns the length of the given Vector2 |
Dot |
Vector2 : aVector2 : b |
number |
Returns the dot product of the two given Vector2 |
Normalize |
Vector2 : instance |
Vector2 |
Returns the normalized version of the given Vector2 |
Lerp |
Vector2 : aVector2 : bnumber : t |
Vector2 |
Calculates the linear interpolation between two Vector2 using the given alpha |
AngleBetween |
Vector2 : aVector2 : b |
number |
Calculates the angle between two Vector2 |
Operation | Description |
---|---|
Vector2 + Vector2 |
Adds two Vector2 |
Vector2 - Vector2 |
Substracts two Vector2 |
-Vector2 |
Multiplies each components of a Vector2 by -1 |
Vector2 * number |
Multiplies each component of a Vector2 by a number |
Vector2 / number |
Divides each component of a Vector2 by a number |
to_string(Vector2) |
Converts a Vector2 to a string |