compose static method

Matrix4 compose(
  1. Matrix4 matrix,
  2. Matrix4? translationMatrix,
  3. Matrix4? scaleMatrix,
  4. Matrix4? rotationMatrix,
)

Compose the matrix from translation, scale and rotation matrices - you can pass a null to skip any matrix from composition.

If matrix is not null the result of the composing will be concatenated to that matrix, otherwise the identity matrix will be used.

Implementation

static Matrix4  compose(Matrix4 matrix, Matrix4? translationMatrix,
    Matrix4? scaleMatrix, Matrix4? rotationMatrix) {
  if (matrix == null) matrix = Matrix4.identity();
  if (translationMatrix != null) matrix = translationMatrix * matrix;
  if (scaleMatrix != null) matrix = scaleMatrix * matrix;
  if (rotationMatrix != null) matrix = rotationMatrix * matrix;
  return matrix;
}