Matrix4.diagonal3 constructor

Matrix4.diagonal3(
  1. Vector3 scale
)

Scale matrix.

Implementation

factory Matrix4.diagonal3(Vector3 scale) {
  final m = Matrix4.zero();
  final mStorage = m._m4storage;
  final scaleStorage = scale._v3storage;
  mStorage[15] = 1.0;
  mStorage[10] = scaleStorage[2];
  mStorage[5] = scaleStorage[1];
  mStorage[0] = scaleStorage[0];
  return m;
}