vector(x: number, y: number, z: number)
How to use vector:
--> Vectors
local new_vec = vector(255, 255, 255)
local sec_vec = vector(2000, 100, 100)
--> Length
local new_vec_length = new_vec:length()
--> Distance
local dist = new_vec:dist_to(sec_vec)
vec_object:length(): number
Returns the length of the vector.
vec_object:length_sqr(): number
Returns the squared length of the vector.
vec_object:length_2d(): number
Returns the length of the vector in two dimensions, without the Z axis.
vec_object:length_2d_sqr(): number
Returns the squared length of the vectors x and y value.
vec_object:is_zero(): boolean
Returns true, if all coordinates of the vector are zero.
vec_object:is_valid(): boolean
Returns true, if the vector is valid.
vec_object:zero(): vector
Sets zero values to the vector.
vec_object:dist_to(vec_end: vector): number
The vector to get the distance to
Returns the distance between the two given vectors.
vec_object:dist_to_sqr(vec_end: vector): number
The vector to get the squared distance to
Returns the squared distance to another vector.
vec_object:cross_product(vec_end: vector): vector
The vector to calculate the cross product with
Returns the cross product of two given vectors.
vec_object:normalize(): number
Normalizes the vector and returns the length of the vector.