transformMat3 function

List<double> transformMat3(
  1. List<double> out,
  2. List<double> a,
  3. List<double> m
)

Transforms the vec3 with a mat3.

@param {vec3} out the receiving vector @param {ReadonlyVec3} a the vector to transform @param {ReadonlyMat3} m the 3x3 matrix to transform with @returns {vec3} out

Implementation

List<double> transformMat3(List<double> out, List<double> a, List<double> m) {
  final x = a[0], y = a[1], z = a[2];
  out[0] = x * m[0] + y * m[3] + z * m[6];
  out[1] = x * m[1] + y * m[4] + z * m[7];
  out[2] = x * m[2] + y * m[5] + z * m[8];
  return out;
}