lovr.math.vec3

Creates a new vec3.

Note that this function is also a table containing the __index key of the vec3 metatable. This means that you can add your own functions onto the lovr.math.vec3 table to extend the built-in functionality.

v = lovr.math.vec3(x, y, z)

Arguments

NameTypeDefaultDescription
xnumber0The x value of the vector.
ynumberxThe y value of the vector.
znumberxThe z value of the vector.

Returns

NameTypeDescription
vvec3The new vector.

v = lovr.math.vec3(u)

Arguments

NameTypeDescription
uvec3The vector to copy the values from.

Returns

NameTypeDescription
vvec3The new vector.

Notes

This function takes the same arguments as vec3:set.

See also