Skip to content

tes3vector4⚓︎

A set of 4 floating-point numbers.

Properties⚓︎

w⚓︎

The 1st value in the vector.

Returns:

  • result (number)

x⚓︎

The 2nd value in the vector.

Returns:

  • result (number)

y⚓︎

The 3rd value in the vector.

Returns:

  • result (number)

z⚓︎

The 4th value in the vector.

Returns:

  • result (number)

Methods⚓︎

__tostring⚓︎

Converts the vector to a string with 2 decimal places.

local result = myObject:__tostring()

Returns:

  • result (string)

copy⚓︎

Creates a copy of the vector.

local result = myObject:copy()

Returns:


length⚓︎

Calculates the length of the vector.

local result = myObject:length()

Returns:

  • result (number)

Functions⚓︎

new⚓︎

Creates a new vector. If no parameters are provided, an empty set will be constructed.

local vector = tes3vector4.new(x, y, z, w)

Parameters:

  • x (number): Default: 0.
  • y (number): Default: 0.
  • z (number): Default: 0.
  • w (number): Default: 0.

Returns:


Math Operations⚓︎

Addition (+)⚓︎

Left operand type Right operand type Result type Description
tes3vector4 tes3vector4 tes3vector4 Standard vector addition.

Division (/)⚓︎

Left operand type Right operand type Result type Description
tes3vector4 number tes3vector4 Divides the vector by a scalar.

Length (#)⚓︎

Result type Description
number Evaluates to the vector's length in game units.

Multiplication (*)⚓︎

Left operand type Right operand type Result type Description
tes3vector4 tes3vector4 tes3vector4 The per-element multiplication of two vectors.
tes3vector4 number tes3vector4 Multiplies the vector by a scalar.

Subtraction (-)⚓︎

Left operand type Right operand type Result type Description
tes3vector4 tes3vector4 tes3vector4 Standard vector subtraction.