|
@@ -22,17 +22,31 @@ THREE.BoxHelper.prototype.constructor = THREE.BoxHelper;
|
|
|
|
|
|
THREE.BoxHelper.prototype.update = function ( object ) {
|
|
|
|
|
|
- var geometry = object.geometry;
|
|
|
-
|
|
|
- if ( geometry.boundingBox === null ) {
|
|
|
-
|
|
|
- geometry.computeBoundingBox();
|
|
|
-
|
|
|
+ var min, max;
|
|
|
+ if ( object.type == 'Mesh') {
|
|
|
+
|
|
|
+ var geometry = object.geometry;
|
|
|
+
|
|
|
+ if ( geometry.boundingBox === null ) {
|
|
|
+
|
|
|
+ geometry.computeBoundingBox();
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ min = geometry.boundingBox.min;
|
|
|
+ max = geometry.boundingBox.max;
|
|
|
+
|
|
|
+ this.matrix = object.matrixWorld;
|
|
|
+ this.matrixAutoUpdate = false;
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ var box = new THREE.Box3().setFromObject(object);
|
|
|
+ min = box.min;
|
|
|
+ max = box.max;
|
|
|
+
|
|
|
}
|
|
|
|
|
|
- var min = geometry.boundingBox.min;
|
|
|
- var max = geometry.boundingBox.max;
|
|
|
-
|
|
|
/*
|
|
|
5____4
|
|
|
1/___0/|
|
|
@@ -95,7 +109,4 @@ THREE.BoxHelper.prototype.update = function ( object ) {
|
|
|
|
|
|
this.geometry.computeBoundingSphere();
|
|
|
|
|
|
- this.matrix = object.matrixWorld;
|
|
|
- this.matrixAutoUpdate = false;
|
|
|
-
|
|
|
};
|