βš™οΈvec3

math.vec3

Variables

  • x - number

  • y - number

  • z - number

Supported operators:

+, -, /, *

Functions

unpack

local vector = math.vec3(1, 2, 3)
local x, y, z = vector:unpack()

Returns:

x

number

y

number

z

number

length

Returns:

the length of the vector

number

length2d

Returns:

the two dimensional length of the vector

number

dist

other vector

math.vec3

vector to calculate distance

Returns:

distance

number

dist2d

other vector

math.vec3

vector to calculate distance

Returns:

2-dimensional distance

number

to2d

Returns:

the original vector with the z component set to 0

math.vec3

cross

other vector

math.vec3

vector to cross with

Returns:

the cross product of the two vectors

math.vec3

normalize

Returns:

dot

other vector

math.vec3

vector to calculate dot product with

Returns:

the two vectors dot product

number

calc_angle

other vector

math.vec3

vector to calculate angle with

Returns:

the angle between the two vectors

math.vec3

Last updated