|
@@ -160,8 +160,7 @@ class Box2 {
|
|
|
|
|
|
distanceToPoint( point ) {
|
|
distanceToPoint( point ) {
|
|
|
|
|
|
- const clampedPoint = _vector.copy( point ).clamp( this.min, this.max );
|
|
|
|
- return clampedPoint.sub( point ).length();
|
|
|
|
|
|
+ return this.clampPoint( point, _vector ).distanceTo( point );
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|