Explorar o código

Merge pull request #10547 from fictiv/fix_box_sphere_dep

Patch over circular dep between Box3 and Sphere
Mr.doob %!s(int64=8) %!d(string=hai) anos
pai
achega
95c3521160
Modificáronse 1 ficheiros con 3 adicións e 1 borrados
  1. 3 1
      src/math/Sphere.js

+ 3 - 1
src/math/Sphere.js

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