tes3matrix44⚓︎
A 4 by 4 matrix.
Properties⚓︎
w⚓︎
The 1st row of the matrix.
Returns:
result(tes3vector4)
x⚓︎
The 2nd row of the matrix.
Returns:
result(tes3vector4)
y⚓︎
The 3rd row of the matrix.
Returns:
result(tes3vector4)
z⚓︎
The 4th row of the matrix.
Returns:
result(tes3vector4)
Methods⚓︎
__tostring⚓︎
Converts the matrix to a string with 2 decimal places.
local result = myObject:__tostring()
Returns:
result(string)
copy⚓︎
Creates a copy of the matrix.
local result = myObject:copy()
Returns:
result(tes3matrix44)
toZero⚓︎
Zeroes out all values in the matrix.
myObject:toZero()
Functions⚓︎
identity⚓︎
Creates a new identity matrix.
local matrix = tes3matrix44.identity()
Returns:
matrix(tes3matrix44)
new⚓︎
Creates a new 4 by 4 matrix from 4 provided vectors or 16 numbers. Creates an empty matrix if nothing is provided.
local matrix = tes3matrix44.new(w0, x0, y0, z0, w1, x1, y1, z1, w2, x2, y2, z2, w3, x3, y3, z3)
Parameters:
w0(number, tes3vector4): Default:0.x0(number, tes3vector4): Default:0.y0(number, tes3vector4): Default:0.z0(number, tes3vector4): Default:0.w1(number): Default:0.x1(number): Default:0.y1(number): Default:0.z1(number): Default:0.w2(number): Default:0.x2(number): Default:0.y2(number): Default:0.z2(number): Default:0.w3(number): Default:0.x3(number): Default:0.y3(number): Default:0.z3(number): Default:0.
Returns:
matrix(tes3matrix44)
Math Operations⚓︎
Addition (+)⚓︎
| Left operand type | Right operand type | Result type | Description |
|---|---|---|---|
| tes3matrix44 | tes3matrix44 | tes3matrix44 | The matrix addition. |
Equality (==)⚓︎
| Left operand type | Right operand type | Result type | Description |
|---|---|---|---|
| tes3matrix44 | tes3matrix33 | boolean | True if both matrices are equal. |
Multiplication (*)⚓︎
| Left operand type | Right operand type | Result type | Description |
|---|---|---|---|
| tes3matrix44 | tes3matrix44 | tes3matrix44 | The matrix multiplication. Geometrically, this will concatenate the transformations of both matrices in the resulting matrix. |
| tes3matrix44 | number | tes3matrix44 | Multiplies the matrix by a scalar. |
Subtraction (-)⚓︎
| Left operand type | Right operand type | Result type | Description |
|---|---|---|---|
| tes3matrix44 | tes3matrix44 | tes3matrix44 | The matrix subtraction. |