clampScalar method

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

Implementation

@override
Vector3 clampScalar(minVal, 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));

  return this;
}