clampScalar method

Vector4 clampScalar(
  1. num minVal,
  2. num maxVal
)

Implementation

Vector4 clampScalar(num minVal, num maxVal) {
  x = Math.max(minVal, Math.min(maxVal, x));
  y = Math.max(minVal, Math.min(maxVal, y));
  z = Math.max(minVal, Math.min(maxVal, z));
  w = Math.max(minVal, Math.min(maxVal, w));

  return this;
}