|
@@ -43,12 +43,18 @@ export default class Player {
|
|
|
this.matLine = null;
|
|
|
this.lineColor = 0xe44d54;
|
|
|
// 1是画线,2是标方向
|
|
|
- this.mode = 2;
|
|
|
+ this.mode = 0;
|
|
|
this.init();
|
|
|
}
|
|
|
|
|
|
setMode(mode) {
|
|
|
this.mode = mode;
|
|
|
+ if (mode === 1 || mode === 2) {
|
|
|
+ this.setEditMode();
|
|
|
+ }
|
|
|
+ if (mode === 0) {
|
|
|
+ this.setFreeMode();
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
removeMarker() {
|
|
@@ -57,6 +63,23 @@ export default class Player {
|
|
|
this.marker = null;
|
|
|
}
|
|
|
}
|
|
|
+ setFreeMode() {
|
|
|
+ this.floorplanControls.enablePan = true;
|
|
|
+ this.floorplanControls.mouseButtons = {
|
|
|
+ LEFT: THREE.MOUSE.PAN,
|
|
|
+ MIDDLE: THREE.MOUSE.DOLLY,
|
|
|
+ RIGHT: THREE.MOUSE.PAN,
|
|
|
+ };
|
|
|
+ }
|
|
|
+
|
|
|
+ setEditMode() {
|
|
|
+ this.floorplanControls.enablePan = false;
|
|
|
+ this.floorplanControls.mouseButtons = {
|
|
|
+ LEFT: THREE.MOUSE.ROTATE,
|
|
|
+ MIDDLE: THREE.MOUSE.DOLLY,
|
|
|
+ RIGHT: THREE.MOUSE.PAN,
|
|
|
+ };
|
|
|
+ }
|
|
|
|
|
|
init = () => {
|
|
|
// //floorplanControls
|
|
@@ -85,7 +108,7 @@ export default class Player {
|
|
|
// MIDDLE: THREE.MOUSE.DOLLY,
|
|
|
// RIGHT: THREE.MOUSE.PAN
|
|
|
// }
|
|
|
-
|
|
|
+ this.setFreeMode();
|
|
|
this.floorplanControls.enableRotate = false;
|
|
|
this.raycaster = new THREE.Raycaster();
|
|
|
this.onBindEvent();
|