transformMat4 function

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

Transforms the vec2 with a mat4 3rd vector component is implicitly '0' 4th vector component is implicitly '1'

@param {vec2} out the receiving vector @param {ReadonlyVec2} a the vector to transform @param {ReadonlyMat4} m matrix to transform with @returns {vec2} out

Implementation

List<double> transformMat4(List<double> out, List<double> a, List<double> m) {
  final x = a[0];
  final y = a[1];
  out[0] = m[0] * x + m[4] * y + m[12];
  out[1] = m[1] * x + m[5] * y + m[13];
  return out;
}