matrix4 static method

Matrix4 matrix4({
  1. Vector3? position,
  2. Quaternion? rotation,
  3. Vector3? scale,
})

Creates a transform-3d-type Matrix4 from the given broken down parameters and sensible defaults:

  • position defaults to no translation;
  • rotation defaults to no rotation;
  • scale defaults to no scaling.

Implementation

static Matrix4 matrix4({
  Vector3? position,
  Quaternion? rotation,
  Vector3? scale,
}) {
  return Matrix4.compose(
    position ?? Vector3.zero(),
    rotation ?? Quaternion.identity(),
    scale ?? Vector3.all(1),
  );
}