Browse Source

Revert "Improve Box3 closure performance"

This reverts commit 7ea7d9db8968e446fff6a92573a4685293b1be70.
Joe Fox 8 years ago
parent
commit
77eacf7cae
1 changed files with 3 additions and 1 deletions
  1. 3 1
      src/math/Box3.js

+ 3 - 1
src/math/Box3.js

@@ -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 );