clampPoint method
Implementation
Vector3 clampPoint(Vector3 point, Vector3 target) {
var deltaLengthSq = center.distanceToSquared(point);
target.copy(point);
if (deltaLengthSq > (radius * radius)) {
target.sub(center).normalize();
target.multiplyScalar(radius).add(center);
}
return target;
}