vmult method

Vec3 vmult(
  1. Vec3 v,
  2. Vec3? target
)

Matrix-Vector multiplication @param v The vector to multiply with @param target Optional, target to save the result in.

Implementation

Vec3 vmult(Vec3 v, Vec3? target){
  target ??= Vec3();
  final e = elements;
  final x = v.x;
  final y = v.y;
  final z = v.z;
  target.x = e[0] * x + e[1] * y + e[2] * z;
  target.y = e[3] * x + e[4] * y + e[5] * z;
  target.z = e[6] * x + e[7] * y + e[8] * z;

  return target;
}