clamp method
Implementation
Vector4 clamp(Vector4 min, Vector4 max) {
// assumes min < max, componentwise
x = math.max(min.x, math.min(max.x, x));
y = math.max(min.y, math.min(max.y, y));
z = math.max(min.z, math.min(max.z, z));
w = math.max(min.w, math.min(max.w, w));
return this;
}