Skip to content

Commit

Permalink
Allow lazy loading of the Box3 constructor, so that webpack can load …
Browse files Browse the repository at this point in the history
…three js source files directly instead of requiring all of the THREE.
  • Loading branch information
chazcb committed Jan 9, 2017
1 parent 6457d0a commit 2cde08b
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/math/Sphere.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ) {
Expand Down

0 comments on commit 2cde08b

Please sign in to comment.