Buy Me a Coffee at ko-fi.com

A global API which provides functions dedicated to creating and otherwise manipulating vectors
Accessed using the name "vectors"

Converts a pitch/yaw angle (in degrees) into a direction vector

overload 1:
VectorsAPI.angleToDir(vec: Vector2): Vector3
typings.2002444079typings.2002444080
Method PropertyFluent DescriptionRepresentation
vec accepts
Return Value
overload 2:
VectorsAPI.angleToDir(pitch: Number, yaw: Number): Vector3
typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
pitch accepts
yaw accepts
Return Value

Parses a Hex string color into an RGB format vector
The hex "#" is optional, and it can have any length, however only the first 6 hex digits are evaluated, short hex (length 3) is also supported
For example, "#42" is the same as "420000", and "F0B" is the same as "FF00BB"

overload 1:
VectorsAPI.hexToRGB(hex: String): Vector3
typings.-1808118735typings.2002444080
Method PropertyFluent DescriptionRepresentation
hex accepts
Return Value

Converts the given color from HSV format to RGB format

overload 1:
VectorsAPI.hsvToRGB(hsv: Vector3): Vector3
typings.2002444080typings.2002444080
Method PropertyFluent DescriptionRepresentation
hsv accepts
Return Value
overload 2:
VectorsAPI.hsvToRGB(h: Number, s: Number, v: Number): Vector3
typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
h accepts
s accepts
v accepts
Return Value

Converts the given color from Integer format to RGB format

overload 1:
VectorsAPI.intToRGB(color: Integer): Vector3
typings.-672261858typings.2002444080
Method PropertyFluent DescriptionRepresentation
color accepts
Return Value

Converts the given color from RGB format to HSV format

overload 1:
VectorsAPI.rgbToHSV(rgb: Vector3): Vector3
typings.2002444080typings.2002444080
Method PropertyFluent DescriptionRepresentation
rgb accepts
Return Value
overload 2:
VectorsAPI.rgbToHSV(r: Number, g: Number, b: Number): Vector3
typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
r accepts
g accepts
b accepts
Return Value

Converts the given color from RGB format to Hex format
The "#" is not included on the return value

overload 1:
VectorsAPI.rgbToHex(rgb: Vector3): String
typings.2002444080typings.-1808118735
Method PropertyFluent DescriptionRepresentation
rgb accepts
Return Value
overload 2:
VectorsAPI.rgbToHex(r: Number, g: Number, b: Number): String
typings.-1950496919typings.-1950496919typings.-1950496919typings.-1808118735
Method PropertyFluent DescriptionRepresentation
r accepts
g accepts
b accepts
Return Value

Converts the given color from RGB format to Integer format

overload 1:
VectorsAPI.rgbToInt(rgb: Vector3): Integer
typings.2002444080typings.-672261858
Method PropertyFluent DescriptionRepresentation
rgb accepts
Return Value
overload 2:
VectorsAPI.rgbToInt(r: Number, g: Number, b: Number): Integer
typings.-1950496919typings.-1950496919typings.-1950496919typings.-672261858
Method PropertyFluent DescriptionRepresentation
r accepts
g accepts
b accepts
Return Value

Rotates a vector relative to a rotation vector

overload 1:
VectorsAPI.rotateAroundAxis(angle: Number, vec: Vector3, axis: Vector3): Vector3
typings.-1950496919typings.2002444080typings.2002444080typings.2002444080
Method PropertyFluent DescriptionRepresentation
angle accepts
vec accepts
axis accepts
Return Value
overload 2:
VectorsAPI.rotateAroundAxis(angle: Number, x: Number, y: Number, z: Number, axis: Vector3): Vector3
typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080typings.2002444080
Method PropertyFluent DescriptionRepresentation
angle accepts
x accepts
y accepts
z accepts
axis accepts
Return Value
overload 3:
VectorsAPI.rotateAroundAxis(angle: Number, vec: Vector3, axisX: Number, axisY: Number, axisZ: Number): Vector3
typings.-1950496919typings.2002444080typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
angle accepts
vec accepts
axisX accepts
axisY accepts
axisZ accepts
Return Value
overload 4:
VectorsAPI.rotateAroundAxis(angle: Number, x: Number, y: Number, z: Number, axisX: Number, axisY: Number, axisZ: Number): Vector3
typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
angle accepts
x accepts
y accepts
z accepts
axisX accepts
axisY accepts
axisZ accepts
Return Value

Converts a position in the world into a position relative to the viewer's camera

overload 1:
VectorsAPI.toCameraSpace(vec: Vector3): Vector3
typings.2002444080typings.2002444080
Method PropertyFluent DescriptionRepresentation
vec accepts
Return Value
overload 2:
VectorsAPI.toCameraSpace(x: Number, y: Number, z: Number): Vector3
typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
z accepts
Return Value

Creates and returns a vector of the appropriate size to hold the arguments passed in
For example; if you call vec(3, 4, 0, 2), then the function will return a Vector4 containing those values
There is a global alias "vec" for this function, meaning the "vectors." can be omitted

overload 1:
VectorsAPI.vec(x: Number, y: Number): Vector2
typings.-1950496919typings.-1950496919typings.2002444079
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
Return Value
overload 2:
VectorsAPI.vec(x: Number, y: Number, z: Number): Vector3
typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
z accepts
Return Value
overload 3:
VectorsAPI.vec(x: Number, y: Number, z: Number, w: Number): Vector4
typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444081
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
z accepts
w accepts
Return Value

Creates and returns a Vector2 with the given values
Nil values become zero

overload 1:
VectorsAPI.vec2(x: Number, y: Number): Vector2
typings.-1950496919typings.-1950496919typings.2002444079
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
Return Value

Creates and returns a Vector3 with the given values
Nil values become zero

overload 1:
VectorsAPI.vec3(x: Number, y: Number, z: Number): Vector3
typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444080
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
z accepts
Return Value

Creates and returns a Vector4 with the given values
Nil values become zero

overload 1:
VectorsAPI.vec4(x: Number, y: Number, z: Number, w: Number): Vector4
typings.-1950496919typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444081
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
z accepts
w accepts
Return Value

Converts a position in the world into a position relative to the viewer's screen

overload 1:
VectorsAPI.worldToScreenSpace(vec: Vector3): Vector4
typings.2002444080typings.2002444081
Method PropertyFluent DescriptionRepresentation
vec accepts
Return Value
overload 2:
VectorsAPI.worldToScreenSpace(x: Number, y: Number, z: Number): Vector4
typings.-1950496919typings.-1950496919typings.-1950496919typings.2002444081
Method PropertyFluent DescriptionRepresentation
x accepts
y accepts
z accepts
Return Value