compose static method

Matrix4? compose(
  1. Matrix4? matrix,
  2. Matrix4? translation,
  3. Matrix4? scale,
  4. Matrix4? rotation,
)

Composes multiple transformation matrices

Implementation

static Matrix4? compose(
  Matrix4? matrix,
  Matrix4? translation,
  Matrix4? scale,
  Matrix4? rotation,
) {
  matrix ??= Matrix4.identity();
  if (translation != null) matrix = translation * matrix;
  if (scale != null) matrix = scale * matrix;
  if (rotation != null) matrix = rotation * matrix;
  return matrix;
}