Browse Source

Merge pull request #8328 from WestLangley/dev-box3

Box3.setFromObject(): handle empty children
Mr.doob 9 years ago
parent
commit
c730cadb85
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/math/Box3.js

+ 7 - 3
src/math/Box3.js

@@ -116,9 +116,13 @@ THREE.Box3.prototype = {
 
 					}
 
-					box.copy( geometry.boundingBox );
-					box.applyMatrix4( node.matrixWorld );
-					scope.union( box );
+					if ( ! geometry.boundingBox.isEmpty() ) {
+
+						box.copy( geometry.boundingBox );
+						box.applyMatrix4( node.matrixWorld );
+						scope.union( box );
+
+					}
 
 				}