|
@@ -308,10 +308,12 @@ Object.assign( Box3.prototype, {
|
|
|
|
|
|
intersectsSphere: ( function () {
|
|
intersectsSphere: ( function () {
|
|
|
|
|
|
- var closestPoint = new Vector3();
|
|
|
|
|
|
+ var closestPoint;
|
|
|
|
|
|
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 );
|
|
|
|
|