Browse Source

adopt Box3 in BufferGeometry.

Ben Houston 12 years ago
parent
commit
d782e3a17e
1 changed files with 4 additions and 7 deletions
  1. 4 7
      src/core/BufferGeometry.js

+ 4 - 7
src/core/BufferGeometry.js

@@ -71,12 +71,7 @@ THREE.BufferGeometry.prototype = {
 
 		if ( ! this.boundingBox ) {
 
-			this.boundingBox = {
-
-				min: new THREE.Vector3( Infinity, Infinity, Infinity ),
-				max: new THREE.Vector3( -Infinity, -Infinity, -Infinity )
-
-			};
+			this.boundingBox = new THREE.Box3();
 
 		}
 
@@ -140,7 +135,9 @@ THREE.BufferGeometry.prototype = {
 
 	computeBoundingSphere: function () {
 
-		if ( ! this.boundingSphere ) this.boundingSphere = { radius: 0 };
+		if ( ! this.boundingSphere ) {
+			this.boundingSphere = new THREE.Sphere();
+		}
 
 		var positions = this.attributes[ "position" ].array;