Просмотр исходного кода

Allow lazy loading of the Box3 constructor, so that webpack can load three js source files directly instead of requiring all of the THREE.

Charles Covey-Brandt 9 лет назад
Родитель
Сommit
2cde08bc81
1 измененных файлов с 3 добавлено и 1 удалено
  1. 3 1
      src/math/Sphere.js

+ 3 - 1
src/math/Sphere.js

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

粤ICP备19079148号