scale method
Implementation
void scale(dynamic x, [double? y, double? z]) {
double sx;
double sy;
double sz;
final sw = x is Vector4 ? x.w : 1.0;
if (x is Vector3) {
sx = x.x;
sy = x.y;
sz = x.z;
} else if (x is Vector4) {
sx = x.x;
sy = x.y;
sz = x.z;
} else if (x is double) {
sx = x;
sy = y ?? x;
sz = z ?? x;
} else {
throw UnimplementedError();
}
_m4storage[0] *= sx;
_m4storage[1] *= sx;
_m4storage[2] *= sx;
_m4storage[3] *= sx;
_m4storage[4] *= sy;
_m4storage[5] *= sy;
_m4storage[6] *= sy;
_m4storage[7] *= sy;
_m4storage[8] *= sz;
_m4storage[9] *= sz;
_m4storage[10] *= sz;
_m4storage[11] *= sz;
_m4storage[12] *= sw;
_m4storage[13] *= sw;
_m4storage[14] *= sw;
_m4storage[15] *= sw;
}