-
Notifications
You must be signed in to change notification settings - Fork 227
Vector3
Adrien GIVRY edited this page Sep 26, 2020
·
3 revisions
Mathematic representation of a 3D vector of floats
- C++ related class:
OvMaths::FVector3
Name | Type | Description |
---|---|---|
x | number |
X component of the Vector3 |
y | number |
Y component of the Vector3 |
z | number |
Z component of the Vector3 |
Name | Input | Output | Description |
---|---|---|---|
new | Vector3 |
Create an instance of Vector3 with x, y and z equals to zero | |
new |
number : xnumber : ynumber : z |
Vector3 |
Create an instance of Vector3 with the given values |
Name | Input | Output | Description |
---|---|---|---|
One | Vector3 |
Returns a (1,1,1) Vector3 | |
Zero | Vector3 |
Returns a (0,0,0) Vector3 | |
Forward | Vector3 |
Returns a (0,0,1) Vector3 | |
Up | Vector3 |
Returns a (0,1,0) Vector3 | |
Right | Vector3 |
Returns a (1,0,0) Vector3 | |
Backward | Vector3 |
Returns a (0,0,-1) Vector3 | |
Down | Vector3 |
Returns a (0,-1,0) Vector3 | |
Left | Vector3 |
Returns a (-1,0,0) Vector3 | |
Length |
Vector3 : instance |
number |
Returns the length of the given Vector3 |
Dot |
Vector3 : aVector3 : b |
number |
Returns the dot product of the two given Vector3 |
Cross |
Vector3 : aVector3 : b |
Vector3 |
Returns the cross product of the two given Vector3 |
Normalize |
Vector3 : instance |
Vector3 |
Returns the normalized version of the given Vector3 |
Lerp |
Vector3 : aVector3 : instancenumber : t |
Vector3 |
Calculates the linear interpolation between two Vector3 using the given alpha |
AngleBetween |
Vector3 : aVector3 : b |
number |
Calculates the angle between two Vector3 |
Distance |
Vector3 : ab : instance |
number |
Returns the distance between the given Vector3 |
Operation | Description |
---|---|
Vector3 + Vector3 |
Adds two Vector3 |
Vector3 - Vector3 |
Substracts two Vector3 |
-Vector3 |
Multiplies each components of a Vector3 by -1 |
Vector3 * number |
Multiplies each component of a Vector3 by a number |
Vector3 / Vector3 |
Divides each component of a Vector3 by a number |
to_string(Vector3) |
Converts a Vector3 to a string |