Explorar o código

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

Mr.doob %!s(int64=9) %!d(string=hai) anos
pai
achega
0330ed8587
Modificáronse 1 ficheiros con 1 adicións e 9 borrados
  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