|
@@ -81,18 +81,21 @@ THREE.Geometry.prototype = {
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( this.boundingBox instanceof THREE.Box3 ) {
|
|
|
+ if ( this.boundingBox !== null ) {
|
|
|
|
|
|
this.computeBoundingBox();
|
|
|
|
|
|
}
|
|
|
|
|
|
- if ( this.boundingSphere instanceof THREE.Sphere ) {
|
|
|
+ if ( this.boundingSphere !== null ) {
|
|
|
|
|
|
this.computeBoundingSphere();
|
|
|
|
|
|
}
|
|
|
|
|
|
+ this.verticesNeedUpdate = true;
|
|
|
+ this.normalsNeedUpdate = true;
|
|
|
+
|
|
|
},
|
|
|
|
|
|
fromBufferGeometry: function ( geometry ) {
|
|
@@ -189,13 +192,9 @@ THREE.Geometry.prototype = {
|
|
|
|
|
|
this.computeBoundingBox();
|
|
|
|
|
|
- var offset = new THREE.Vector3();
|
|
|
-
|
|
|
- offset.addVectors( this.boundingBox.min, this.boundingBox.max );
|
|
|
- offset.multiplyScalar( - 0.5 );
|
|
|
+ var offset = this.boundingBox.center().negate();
|
|
|
|
|
|
- this.applyMatrix( new THREE.Matrix4().makeTranslation( offset.x, offset.y, offset.z ) );
|
|
|
- this.computeBoundingBox();
|
|
|
+ this.applyMatrix( new THREE.Matrix4().setPosition( offset ) );
|
|
|
|
|
|
return offset;
|
|
|
|