Transform3D.compose constructor

Transform3D.compose({
  1. Vector3? position,
  2. Quaternion? rotation,
  3. Vector3? scale,
})

Creates a Transform3D 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

factory Transform3D.compose({
  Vector3? position,
  Quaternion? rotation,
  Vector3? scale,
}) {
  final matrix = matrix4(
    position: position,
    rotation: rotation,
    scale: scale,
  );
  return Transform3D.fromMatrix4(matrix);
}