mulScale method

Mat33 mulScale(
  1. Mat33 m,
  2. double sx,
  3. double sy,
  4. double sz, [
  5. bool prepend = false,
])

Scale matrix m by new x,y,z scales and replace this matrix

Implementation

Mat33 mulScale(Mat33  m,double sx,double sy, double sz, [bool prepend = false]) {
  List<double> te = elements, tm = m.elements;
  if(prepend){
    te[0] = sx*tm[0]; te[1] = sx*tm[1]; te[2] = sx*tm[2];
    te[3] = sy*tm[3]; te[4] = sy*tm[4]; te[5] = sy*tm[5];
    te[6] = sz*tm[6]; te[7] = sz*tm[7]; te[8] = sz*tm[8];
  }else{
    te[0] = tm[0]*sx; te[1] = tm[1]*sy; te[2] = tm[2]*sz;
    te[3] = tm[3]*sx; te[4] = tm[4]*sy; te[5] = tm[5]*sz;
    te[6] = tm[6]*sx; te[7] = tm[7]*sy; te[8] = tm[8]*sz;
  }
  return this;
}