clamp method
V2
clamp(
- V2 min,
- V2 max
Clamps each component of this vector between the corresponding components of min and max.
Implementation
V2 clamp(V2 min, V2 max) => _v2(
math.min(max.x, math.max(min.x, x)),
math.min(max.y, math.max(min.y, y)),
);