β‘vector
Variables:
vector(x: number, y: number, z: number)
Name | Type | Description |
---|---|---|
x |
| - |
y |
| - |
z |
| - |
How to use vector:
Functions:
:length
vec_object:length():
number
Returns the length of the vector.
:length_sqr
vec_object:length_sqr():
number
Returns the squared length of the vector.
:length_2d
vec_object:length_2d():
number
Returns the length of the vector in two dimensions, without the Z axis.
:length_2d_sqr
vec_object:length_2d_sqr():
number
Returns the squared length of the vectors x and y value.
:is_zero
vec_object:is_zero():
boolean
Returns true
, if all coordinates of the vector are zero.
:is_valid
vec_object:is_valid():
boolean
Returns true
, if the vector is valid.
:zero
vec_object:zero():
vector
Sets zero values to the vector.
:dist_to
vec_object:dist_to(vec_end: vector):
number
Name | Type | Description |
---|---|---|
vec_end |
| The vector to get the distance to |
Returns the distance between the two given vectors.
:dist_to_sqr
vec_object:dist_to_sqr(vec_end: vector):
number
Name | Type | Description |
---|---|---|
vec_end |
| The vector to get the squared distance to |
Returns the squared distance to another vector.
:cross_product
vec_object:cross_product(vec_end: vector):
vector
Name | Type | Description |
---|---|---|
vec_end |
| The vector to calculate the cross product with |
Returns the cross product of two given vectors.
:normalize
vec_object:normalize():
number
Normalizes the vector and returns the length of the vector.
Last updated