๐งฎ Matrix
A 4x4 transformation Matrix built from a rotation and an origin, which can be used for geometric and positional calculations. This is mainly used internally.
๐ Examplesโ
-- Builds a matrix rotated 90 degrees in Yaw, placed at (100, 0, 0)
local matrix = Matrix(Rotator(0, 90, 0), Vector(100, 0, 0))
-- Rotates a direction by the matrix rotation (the origin is not applied)
local rotated_direction = matrix:TransformVector(Vector(50, 0, 0))
๐ Constructorsโ
Default Constructorโ
No description provided
local my_matrix = Matrix(rotation, origin)
Parameters
| Type | Name | Default | Description |
|---|---|---|---|
| Rotator | rotation | Required parameter | The rotation of the matrix |
| Vector | origin | Required parameter | The origin of the matrix |
๐ฆ Functionsโ
| Returns | Name | Description | |
|---|---|---|---|
| Vector | TransformVector | Rotates the Vector by this Matrix rotation (the origin is not applied) | |
| Matrix | GetTransposed | Returns a new matrix transposed (Wikipedia) |
Optimal
TransformVectorโ
Rotates the Vector by this Matrix rotation (the origin is not applied)
local ret = my_matrix:TransformVector(vector)
Parameters
| Type | Parameter | Default | Description |
|---|---|---|---|
| Vector | vector | Required parameter | The Vector to be transformed |
Returns
| Type | Description |
|---|---|
| Vector | The new vector |
Optimal
GetTransposedโ
Returns a new matrix transposed (Wikipedia)
local ret = my_matrix:GetTransposed()
Returns
| Type | Description |
|---|---|
| Matrix | The transposed matrix |
