|
@@ -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 () {
|
|
|
|