|
@@ -5,6 +5,7 @@ import { Loader } from './Loader.js';
|
|
|
import { History as _History } from './History.js';
|
|
|
import { Strings } from './Strings.js';
|
|
|
import { Storage as _Storage } from './Storage.js';
|
|
|
+import { SelectionHelper } from './Viewport.SelectionHelper.js';
|
|
|
|
|
|
var _DEFAULT_CAMERA = new THREE.PerspectiveCamera( 50, 1, 0.01, 1000 );
|
|
|
_DEFAULT_CAMERA.name = 'Camera';
|
|
@@ -13,7 +14,7 @@ _DEFAULT_CAMERA.lookAt( new THREE.Vector3() );
|
|
|
|
|
|
function Editor() {
|
|
|
|
|
|
- var Signal = signals.Signal;
|
|
|
+ const Signal = signals.Signal; // eslint-disable-line no-undef
|
|
|
|
|
|
this.signals = {
|
|
|
|
|
@@ -84,7 +85,9 @@ function Editor() {
|
|
|
refreshSidebarObject3D: new Signal(),
|
|
|
historyChanged: new Signal(),
|
|
|
|
|
|
- viewportCameraChanged: new Signal()
|
|
|
+ viewportCameraChanged: new Signal(),
|
|
|
+
|
|
|
+ intersectionsDetected: new Signal(),
|
|
|
|
|
|
};
|
|
|
|
|
@@ -92,6 +95,7 @@ function Editor() {
|
|
|
this.history = new _History( this );
|
|
|
this.storage = new _Storage();
|
|
|
this.strings = new Strings( this.config );
|
|
|
+ this.selectionHelper = new SelectionHelper( this );
|
|
|
|
|
|
this.loader = new Loader( this );
|
|
|
|
|
@@ -535,20 +539,7 @@ Editor.prototype = {
|
|
|
|
|
|
select: function ( object ) {
|
|
|
|
|
|
- if ( this.selected === object ) return;
|
|
|
-
|
|
|
- var uuid = null;
|
|
|
-
|
|
|
- if ( object !== null ) {
|
|
|
-
|
|
|
- uuid = object.uuid;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
- this.selected = object;
|
|
|
-
|
|
|
- this.config.setKey( 'selected', uuid );
|
|
|
- this.signals.objectSelected.dispatch( object );
|
|
|
+ this.selectionHelper.select( object );
|
|
|
|
|
|
},
|
|
|
|
|
@@ -583,7 +574,7 @@ Editor.prototype = {
|
|
|
|
|
|
deselect: function () {
|
|
|
|
|
|
- this.select( null );
|
|
|
+ this.selectionHelper.deselect();
|
|
|
|
|
|
},
|
|
|
|