浏览代码

BufferGeometry: Use Box3.setFromArray in computeBoundingSphere. See #7974.

Mr.doob 9 年之前
父节点
当前提交
0330ed8587
共有 1 个文件被更改,包括 1 次插入9 次删除
  1. 1 9
      src/core/BufferGeometry.js

+ 1 - 9
src/core/BufferGeometry.js

@@ -598,17 +598,9 @@ THREE.BufferGeometry.prototype = {
 
 			if ( positions ) {
 
-				box.makeEmpty();
-
 				var center = this.boundingSphere.center;
 
-				for ( var i = 0, il = positions.length; i < il; i += 3 ) {
-
-					vector.fromArray( positions, i );
-					box.expandByPoint( vector );
-
-				}
-
+				box.setFromArray( positions );
 				box.center( center );
 
 				// hoping to find a boundingSphere with a radius smaller than the