@@ -28,6 +28,8 @@ var Viewport = function ( editor ) {
//
+ var box = new THREE.Box3();
+
var selectionBox = new THREE.BoxHelper();
selectionBox.material.depthTest = false;
selectionBox.material.transparent = true;
@@ -364,9 +366,11 @@ var Viewport = function ( editor ) {
if ( object !== null ) {
- if ( object.geometry !== undefined ) {
+ box.setFromObject( object );
+ if ( box.isEmpty() === false ) {
- selectionBox.update( object );
+ selectionBox.update( box );
selectionBox.visible = true;
}
@@ -3,7 +3,7 @@
*/
THREE.BoxHelper = function ( object, color ) {
-
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 ] );