|
@@ -84,13 +84,13 @@ THREE.BufferGeometry.prototype = {
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if ( this.boundingBox instanceof THREE.Box3 ) {
|
|
|
|
|
|
+ if ( this.boundingBox !== null ) {
|
|
|
|
|
|
this.computeBoundingBox();
|
|
this.computeBoundingBox();
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
- if ( this.boundingSphere instanceof THREE.Sphere ) {
|
|
|
|
|
|
+ if ( this.boundingSphere !== null ) {
|
|
|
|
|
|
this.computeBoundingSphere();
|
|
this.computeBoundingSphere();
|
|
|
|
|
|
@@ -100,7 +100,13 @@ THREE.BufferGeometry.prototype = {
|
|
|
|
|
|
center: function () {
|
|
center: function () {
|
|
|
|
|
|
- // TODO
|
|
|
|
|
|
+ this.computeBoundingBox();
|
|
|
|
+
|
|
|
|
+ var offset = this.boundingBox.center().negate();
|
|
|
|
+
|
|
|
|
+ this.applyMatrix( new THREE.Matrix4().setPosition( offset ) );
|
|
|
|
+
|
|
|
|
+ return offset;
|
|
|
|
|
|
},
|
|
},
|
|
|
|
|