A mat4 is a math type that holds 16 values in a 4x4 grid.


lovr.math.newMat4Create a new Mat4.
lovr.math.mat4Create a temporary Mat4.


Mat4:setSet the components of the matrix.
Mat4:fovSet a projection using raw FoV angles.
Mat4:identityReset the matrix to the identity.
Mat4:invertInvert the matrix.
Mat4:lookAtCreate a view transform that looks from a position to target position.
Mat4:mulMultiply a matrix with another matrix or a vector.
Mat4:orthographicTurn the matrix into an orthographic projection.
Mat4:perspectiveTurn the matrix into a perspective projection.
Mat4:rotateRotate the matrix.
Mat4:scaleScale the matrix.
Mat4:targetCreate a model transform that targets from a position to target position.
Mat4:translateTranslate the matrix.
Mat4:transposeTranspose the matrix.
Mat4:unpackGet the individual components of the matrix.

See also