Răsfoiți Sursa

Revert "Improve Sphere closure performance"

This reverts commit c60105d93a38430debb9888fea94581a378c8122.
Joe Fox 8 ani în urmă
părinte
comite
c168f5d983
1 a modificat fișierele cu 3 adăugiri și 1 ștergeri
  1. 3 1
      src/math/Sphere.js

+ 3 - 1
src/math/Sphere.js

@@ -26,10 +26,12 @@ Object.assign( Sphere.prototype, {
 
 	setFromPoints: function () {
 
-		var box = new Box3();
+		var box;
 
 		return function setFromPoints( points, optionalCenter ) {
 
+			if ( box === undefined ) box = new Box3(); // see #10547
+
 			var center = this.center;
 
 			if ( optionalCenter !== undefined ) {