clamp method

Vector3D clamp(
  1. Vector3D min,
  2. Vector3D max
)

Implementation

Vector3D clamp(Vector3D min, Vector3D max) => .vec3(
  math.min(max.x, math.max(min.x, x)),
  math.min(max.y, math.max(min.y, y)),
  math.min(max.z, math.max(min.z, z)),
);