2
0
Эх сурвалжийг харах

BufferGeometry: Removed unused closure in computeBoundingBox.

Mr.doob 9 жил өмнө
parent
commit
195ba9cf6a
1 өөрчлөгдсөн 15 нэмэгдсэн , 21 устгасан
  1. 15 21
      src/core/BufferGeometry.js

+ 15 - 21
src/core/BufferGeometry.js

@@ -552,40 +552,34 @@ THREE.BufferGeometry.prototype = {
 
 	computeBoundingBox: function () {
 
-		var vector = new THREE.Vector3();
-
-		return function () {
+		if ( this.boundingBox === null ) {
 
-			if ( this.boundingBox === null ) {
+			this.boundingBox = new THREE.Box3();
 
-				this.boundingBox = new THREE.Box3();
-
-			}
-
-			var positions = this.attributes.position.array;
+		}
 
-			if ( positions ) {
+		var positions = this.attributes.position.array;
 
-				this.boundingBox.setFromArray( positions );
+		if ( positions ) {
 
-			}
+			this.boundingBox.setFromArray( positions );
 
-			if ( positions === undefined || positions.length === 0 ) {
+		}
 
-				this.boundingBox.min.set( 0, 0, 0 );
-				this.boundingBox.max.set( 0, 0, 0 );
+		if ( positions === undefined || positions.length === 0 ) {
 
-			}
+			this.boundingBox.min.set( 0, 0, 0 );
+			this.boundingBox.max.set( 0, 0, 0 );
 
-			if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {
+		}
 
-				console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
+		if ( isNaN( this.boundingBox.min.x ) || isNaN( this.boundingBox.min.y ) || isNaN( this.boundingBox.min.z ) ) {
 
-			}
+			console.error( 'THREE.BufferGeometry.computeBoundingBox: Computed min/max have NaN values. The "position" attribute is likely to have NaN values.', this );
 
-		};
+		}
 
-	}(),
+	},
 
 	computeBoundingSphere: function () {