ronaldo9Zhang 2 роки тому
батько
коміт
172adb5c8b

+ 6 - 6
src/views/modelLibrary/common/coordinateAxes.js

@@ -67,8 +67,8 @@ export default class CoordinateAxes extends THREE.Object3D {
                 var meshX = new THREE.Mesh(geometryX, matX);
                 meshX.rotation.y = -Math.PI / 2
                 // meshX.rotation.z = Math.PI / 10
-                // meshX.position.set(0, 0, 160);
-                meshX.position.set(0, 0, 36);
+                meshX.position.set(0, 0, 160);
+                // meshX.position.set(0, 0, 36);
                 that.add(meshX);
 
                 const geometryY = new TextGeometry('Z', {
@@ -87,8 +87,8 @@ export default class CoordinateAxes extends THREE.Object3D {
                 });
                 var meshY = new THREE.Mesh(geometryY, matY);
                 meshY.rotation.y = Math.PI / 4.5
-                // meshY.position.set(0, 160, 0);
-                meshY.position.set(0, 36, 0);
+                meshY.position.set(0, 160, 0);
+                // meshY.position.set(0, 36, 0);
                 that.add(meshY);
 
                 const geometryZ = new TextGeometry('Y', {
@@ -109,8 +109,8 @@ export default class CoordinateAxes extends THREE.Object3D {
                 // meshZ.rotation.y = Math.PI / 5
                 // meshZ.rotation.x = -Math.PI / 6
                 // meshZ.rotation.z = Math.PI / 6
-                // meshZ.position.set(160, 0, 0);
-                meshZ.position.set(36, 0, 0);
+                meshZ.position.set(160, 0, 0);
+                // meshZ.position.set(36, 0, 0);
                 that.add(meshZ);
             },
 

+ 4 - 15
src/views/modelLibrary/components/threeAxesHelper.vue

@@ -49,19 +49,6 @@ export default {
         ...mapState(["scale"]),
     },
 
-    props: {
-        controlsCanMove: {
-            type: Boolean,
-            default: true,
-        },
-    },
-
-    watch: {
-        controlsCanMove(newVal, oldVal) {
-            if (this.controls) this.controls.enabled = newVal;
-        },
-    },
-
     methods: {
         // 场景
         initScene() {
@@ -178,9 +165,10 @@ export default {
             ); //创建控件对象
             this.controls.minDistance = 30;
             this.controls.maxDistance = 600;
-            // this.controls.autoRotate=true;
+
+            this.controls.enableZoom = false;
+
             this.controls.update();
-            // this.controls.target = this.cube.position
         },
         animate() {
             this.raf = requestAnimationFrame(this.animate);
@@ -244,6 +232,7 @@ export default {
     mounted() {
         this.go();
     },
+
     destroyed() {
         window.removeEventListener("resize", this.onWindowResize);
         cancelAnimationFrame(this.raf);

+ 2 - 2
src/views/modelLibrary/components/threeVehicleConfiguration.vue

@@ -399,11 +399,11 @@ export default {
             });
             this.transformControls.addEventListener("mouseDown", (e) => {
                 this.controls.enabled = false;
-                this.$emit("controlsEnabled", false);
+                // this.$emit("controlsEnabled", false);
             });
             this.transformControls.addEventListener("mouseUp", (e) => {
                 this.controls.enabled = true;
-                this.$emit("controlsEnabled", true);
+                // this.$emit("controlsEnabled", true);
             });
             this.scene.add(this.transformControls);
         },

+ 0 - 2
src/views/modelLibrary/vehicleConfigurationDetail.vue

@@ -162,7 +162,6 @@
                 <div class="axesBox">
                     <three-axes-helper
                         ref="threeSensor1"
-                        :controlsCanMove="controlsCanMove"
                     ></three-axes-helper>
                 </div>
 
@@ -179,7 +178,6 @@
                     :configList="configList"
                     :allSensor="allSensor"
                     @posChange="posChange"
-                    @controlsEnabled="controlsEnabled"
                 ></three-sensor>
 
                 <div v-show="configBox" class="conditions">