scaleByVector method

Matrix4 scaleByVector(
  1. Vector v
)

Implementation

Matrix4 scaleByVector(Vector v) {
  final te = storage;
  final x = v.x;
  final y = v.y;
  double z = 1;

  if(v is Vector3){
    z = v.z;
  }
  else if(v is Vector4){
    z = v.z;
  }

  te[0] *= x;
  te[4] *= y;
  te[8] *= z;
  te[1] *= x;
  te[5] *= y;
  te[9] *= z;
  te[2] *= x;
  te[6] *= y;
  te[10] *= z;
  te[3] *= x;
  te[7] *= y;
  te[11] *= z;

  return this;
}