BGE/Math/BGE/Math/Matrix44
Alias: BGE.Math.BGE.Math.Matrix44
Static Methods
create(values?: dynamic): dynamic
Parameters
values(dynamic, optional, default: "invalid")
Returns
dynamic
copy(mat: dynamic): dynamic
Parameters
mat(dynamic)
Returns
dynamic
setFrom(mat: dynamic, b: dynamic): dynamic
Parameters
mat(dynamic)b(dynamic)
Returns
dynamic
equals(mat: dynamic, b: dynamic): boolean
Parameters
mat(dynamic)b(dynamic)
Returns
boolean
multiply(mat: dynamic, operand: dynamic): dynamic
Parameters
mat(dynamic)operand(dynamic)
Returns
dynamic
transposed(mat: dynamic): dynamic
Returns the transposed version of this Matrix
Parameters
mat(dynamic)
Returns
dynamic
multVecMatrix(
srcVect: BGE.Math.Vector,
mat: dynamic,
): BGE.Math.Vector
The coordinate w more often than not equals 1, but it can be different than 1 especially when the matrix is projective matrix (perspective projection matrix).
Parameters
srcVect(BGE.Math.Vector)mat(dynamic)
Returns
BGE.Math.Vector
multDirMatrix(
srcVect: BGE.Math.Vector,
mat: dynamic,
): BGE.Math.Vector
This method needs to be used for vector-matrix multiplication. Look at the differences with the previous method (to compute a point-matrix multiplication). We don't use the coefficients in the matrix that account for translation (x[3][0], x[3][1], x[3][2]) and we don't compute w.
Parameters
srcVect(BGE.Math.Vector)mat(dynamic)
Returns
BGE.Math.Vector
inverse(mat: dynamic): dynamic
Compute the inverse of the matrix using the Gauss-Jordan (or reduced row) elimination method. We didn't explain in the lesson on Geometry how the inverse of matrix can be found. Don't worry at this point if you don't understand how this works. But we will need to be able to compute the inverse of matrices in the first lessons of the "Foundation of 3D Rendering" section, which is why we've added this code. For now, you can just use it and rely on it for doing what it's supposed to do. If you want to learn how this works though, check the lesson on called Matrix Inverse in the "Mathematics and Physics of Computer Graphics" section.
Parameters
mat(dynamic)
Returns
dynamic
invert(mat: dynamic): void
Set current matrix to its inverse
Parameters
mat(dynamic)
Returns
void
toStr(mat: dynamic): string
Parameters
mat(dynamic)
Returns
string