clampScalar method

  1. @override
Vector4 clampScalar(
  1. double minVal,
  2. double maxVal
)
override

Implementation

@override
Vector4 clampScalar(double minVal, double 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;
}