|
@@ -300,12 +300,10 @@ Object.assign( Box3.prototype, {
|
|
|
|
|
|
intersectsSphere: ( function () {
|
|
intersectsSphere: ( function () {
|
|
|
|
|
|
- var closestPoint;
|
|
|
|
|
|
+ var closestPoint = new Vector3();
|
|
|
|
|
|
return function intersectsSphere( sphere ) {
|
|
return function intersectsSphere( sphere ) {
|
|
|
|
|
|
- if ( closestPoint === undefined ) closestPoint = new Vector3();
|
|
|
|
-
|
|
|
|
// Find the point on the AABB closest to the sphere center.
|
|
// Find the point on the AABB closest to the sphere center.
|
|
this.clampPoint( sphere.center, closestPoint );
|
|
this.clampPoint( sphere.center, closestPoint );
|
|
|
|
|