Passer au contenu principal
Version: bleeding-edge 🩸

🧮 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.


🎒 Exemples​

-- 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

TypeNameDefaultDescription
Rotatorrotation Required parameter La rotation de la matrice
Vectororigin Required parameter L'origine de la matrice

🦠 Fonctions​

ReturnsNameDescription
VectorTransformVectorRotates the Vector by this Matrix rotation (the origin is not applied)
MatrixGetTransposedRenvoie une nouvelle matrice transposée (Wikipedia)

Optimal

TransformVector​

Rotates the Vector by this Matrix rotation (the origin is not applied)
local ret = my_matrix:TransformVector(vector)

Parameters

TypeParameterDefaultDescription
Vectorvector Required parameter The Vector to be transformed

Returns

TypeDescription
Vector Le nouveau vecteur

Optimal

GetTransposed​

Renvoie une nouvelle matrice transposée (Wikipedia)
local ret = my_matrix:GetTransposed()

Returns

TypeDescription
MatrixThe transposed matrix