clampPoint method

Vector3 clampPoint(
  1. Vector3 point,
  2. Vector3 target
)

point - Vector3 to clamp.

target — the result will be copied into this Vector3.

Clamps the point within the bounds of this box.

Implementation

Vector3 clampPoint(Vector3 point, Vector3 target) {
  return target.setFrom(point).clamp(min, max);
}