Vector3

A vector that holds 3 numbers
Can be created using functions in the "vectors" api
Meta name Allowed other parameters Meta execution method
__le
  • Vector3
x <= y
__lt
  • Vector3
x < y
__len
#x
__unm
-x
__eq
  • Vector3
x == y
__mod
  • Number
  • Vector3
x % y
__div
  • Number
  • Vector3
x / y
__mul
  • Number
  • Vector3
  • Matrix3
x * y
__add
  • Vector3
  • Number
x + y
__sub
  • Vector3
  • Number
x - y

Vector3.add

Adds the given vector or values to this one, and returns self for chaining
overload 1:
Vector3:add(vec)
Method Property Fluent Description Representation
vec accepts a Vector3
Return Value a Vector3
overload 2:
Vector3:add(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Vector3

Vector3.length

Returns the length of this vector
overload 1:
Vector3:length()
Method Property Fluent Description Representation
Return Value a Number

Vector3.floor

Returns a copy of this vector with its values rounded down
overload 1:
Vector3:floor()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.ceil

Returns a copy of this vector with its values rounded up
overload 1:
Vector3:ceil()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.scale

Scales this vector by the given factor, and returns self for chaining
overload 1:
Vector3:scale(factor)
Method Property Fluent Description Representation
factor accepts a Number
Return Value a Vector3

Vector3.offset

Offsets this vector by the given factor, adding the factor to all components, and returns self for chaining
overload 1:
Vector3:offset(factor)
Method Property Fluent Description Representation
factor accepts a Number
Return Value a Vector3

Vector3.transform

Transforms this vector by the given matrix, and returns self for chaining
overload 1:
Vector3:transform(mat)
Method Property Fluent Description Representation
mat accepts a Matrix3
Return Value a Vector3

Vector3.dot

Returns the dot product of this vector with the other
overload 1:
Vector3:dot(vec)
Method Property Fluent Description Representation
vec accepts a Vector3
Return Value a Number

Vector3.set

Sets this vector to have the given values
Nil values are treated as zero
Returns self for chaining
overload 1:
Vector3:set(vec)
Method Property Fluent Description Representation
vec accepts a Vector3
Return Value a Vector3
overload 2:
Vector3:set(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Vector3

Vector3.copy

Creates and returns a copy of this vector
overload 1:
Vector3:copy()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.normalize

Modifies this vector so that its length is 1 unless its length was originally 0
Returns self for chaining
overload 1:
Vector3:normalize()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.reset

Resets this vector back to being all zeroes, and returns itself for chaining
overload 1:
Vector3:reset()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.reduce

Reduces this vector modulo the given vector or values, and returns self for chaining
overload 1:
Vector3:reduce(vec)
Method Property Fluent Description Representation
vec accepts a Vector3
Return Value a Vector3
overload 2:
Vector3:reduce(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Vector3

Vector3.normalized

Returns a copy of this vector with length 1 unless its length was originally 0
overload 1:
Vector3:normalized()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.sub

Subtracts the given vector or values from this one, and returns self for chaining
overload 1:
Vector3:sub(vec)
Method Property Fluent Description Representation
vec accepts a Vector3
Return Value a Vector3
overload 2:
Vector3:sub(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Vector3

Vector3.mul

Multiplies the given vector or values into this one, and returns self for chaining
overload 1:
Vector3:mul(vec)
Method Property Fluent Description Representation
vec accepts a Vector3
Return Value a Vector3
overload 2:
Vector3:mul(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Vector3

Vector3.div

Divides this vector by the given vector or values, and returns self for chaining
overload 1:
Vector3:div(vec)
Method Property Fluent Description Representation
vec accepts a Vector3
Return Value a Vector3
overload 2:
Vector3:div(x, y, z)
Method Property Fluent Description Representation
x accepts a Number
y accepts a Number
z accepts a Number
Return Value a Vector3

Vector3.lengthSquared

Returns the length of this vector squared
Suitable when you only care about relative lengths,
because it avoids a square root
overload 1:
Vector3:lengthSquared()
Method Property Fluent Description Representation
Return Value a Number

Vector3.toRad

Returns a copy of this vector, in radians
overload 1:
Vector3:toRad()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.applyFunc

Calls the given function on each element of this vector, and sets the values of the vector to the returns
The current index and its value is given as arguments of the function
Returns self for chaining
overload 1:
Vector3:applyFunc(func)
Method Property Fluent Description Representation
func accepts a function that takes a Number and an Integer and will return a Number
Return Value a Vector3

Vector3.clampLength

Modifies this vector so that its length is between minLength and maxLength
If the vector has length zero,
it is unmodified
Returns self for chaining
overload 1:
Vector3:clampLength(minLength, maxLength)
Method Property Fluent Description Representation
minLength accepts a Number
maxLength accepts a Number
Return Value a Vector3

Vector3.crossed

Returns a new vector which is the cross product of this and the other one
overload 1:
Vector3:crossed(other)
Method Property Fluent Description Representation
other accepts a Vector3
Return Value a Vector3

Vector3.toDeg

Returns a copy of this vector, in degrees
overload 1:
Vector3:toDeg()
Method Property Fluent Description Representation
Return Value a Vector3

Vector3.augmented

figura.docs.vector3.augmented
overload 1:
Vector3:augmented()
Method Property Fluent Description Representation
Return Value a Vector4

Vector3.unpack

Returns this vector's values as separate numbers
overload 1:
Vector3:unpack()
Method Property Fluent Description Representation
Return Value a Varargs

Vector3.clamped

Returns a modified copy of this vector, with its length clamped from minLength to maxLength
If the vector has length zero,
then the copy does too
overload 1:
Vector3:clamped(minLength, maxLength)
Method Property Fluent Description Representation
minLength accepts a Number
maxLength accepts a Number
Return Value a Vector3

Vector3.cross

Sets this vector to the cross product of itself and the other vector
Returns self for chaining
overload 1:
Vector3:cross(other)
Method Property Fluent Description Representation
other accepts a Vector3
Return Value a Vector3

Vector3.x

The first coordinate of this vector
Can also be gotten with the indices "r" and [1]
field signature:
x
Method Property Fluent Description Representation
Field Type a Number

Vector3.y

The second coordinate of this vector
Can also be gotten with the indices "g" and [2]
field signature:
y
Method Property Fluent Description Representation
Field Type a Number

Vector3.z

The third coordinate of this vector
Can also be gotten with the indices "b" and [3]
field signature:
z
Method Property Fluent Description Representation
Field Type a Number
a a