scale function

List<double> scale(
  1. List<double> out,
  2. List<double> a,
  3. dynamic v
)

Scales the mat4 by the dimensions in the given vec3 not using vectorization

@param {mat4} out the receiving matrix @param {ReadonlyMat4} a the matrix to scale @param {ReadonlyVec3} v the vec3 to scale the matrix by @returns {mat4} out */

Implementation

List<double> scale(List<double> out, List<double> a, v) {
  final x = v[0], y = v[1], z = v[2];

  out[0] = a[0] * x;
  out[1] = a[1] * x;
  out[2] = a[2] * x;
  out[3] = a[3] * x;
  out[4] = a[4] * y;
  out[5] = a[5] * y;
  out[6] = a[6] * y;
  out[7] = a[7] * y;
  out[8] = a[8] * z;
  out[9] = a[9] * z;
  out[10] = a[10] * z;
  out[11] = a[11] * z;
  out[12] = a[12];
  out[13] = a[13];
  out[14] = a[14];
  out[15] = a[15];
  return out;
}