|
@@ -6,10 +6,13 @@ import { BufferGeometry } from '../core/BufferGeometry';
|
|
|
|
|
|
/**
|
|
|
* @author mrdoob / http://mrdoob.com/
|
|
|
+ * @author Mugen87 / http://github.com/Mugen87
|
|
|
*/
|
|
|
|
|
|
function BoxHelper( object, color ) {
|
|
|
|
|
|
+ this.object = object;
|
|
|
+
|
|
|
if ( color === undefined ) color = 0xffff00;
|
|
|
|
|
|
var indices = new Uint16Array( [ 0, 1, 1, 2, 2, 3, 3, 0, 4, 5, 5, 6, 6, 7, 7, 4, 0, 4, 1, 5, 2, 6, 3, 7 ] );
|
|
@@ -21,11 +24,9 @@ function BoxHelper( object, color ) {
|
|
|
|
|
|
LineSegments.call( this, geometry, new LineBasicMaterial( { color: color } ) );
|
|
|
|
|
|
- if ( object !== undefined ) {
|
|
|
-
|
|
|
- this.update( object );
|
|
|
+ this.matrixAutoUpdate = false;
|
|
|
|
|
|
- }
|
|
|
+ this.update();
|
|
|
|
|
|
}
|
|
|
|
|
@@ -38,15 +39,15 @@ BoxHelper.prototype.update = ( function () {
|
|
|
|
|
|
return function update( object ) {
|
|
|
|
|
|
- if ( object && object.isBox3 ) {
|
|
|
+ if ( object !== undefined ) {
|
|
|
|
|
|
- box.copy( object );
|
|
|
+ console.warn( 'THREE.BoxHelper: .update() has no longer arguments.' );
|
|
|
|
|
|
- } else {
|
|
|
+ }
|
|
|
|
|
|
- box.setFromObject( object );
|
|
|
+ this.object.updateMatrixWorld( true );
|
|
|
|
|
|
- }
|
|
|
+ box.setFromObject( this.object );
|
|
|
|
|
|
if ( box.isEmpty() ) return;
|
|
|
|
|
@@ -83,7 +84,7 @@ BoxHelper.prototype.update = ( function () {
|
|
|
|
|
|
position.needsUpdate = true;
|
|
|
|
|
|
- this.geometry.computeBoundingSphere();
|
|
|
+ return this;
|
|
|
|
|
|
};
|
|
|
|