Przeglądaj źródła

3dModeling pulic.js 王隽 commit at 2021-03-29

王隽 4 lat temu
rodzic
commit
8cf3c38496
1 zmienionych plików z 24 dodań i 0 usunięć
  1. 24 0
      3dModeling/zhhry11/pulic.js

+ 24 - 0
3dModeling/zhhry11/pulic.js

@@ -180,3 +180,27 @@ function startRotate() {
 function stopRotate() {
     app.camera.enableRotate = true;  // 开启默认的旋转操作
     app.camera.enablePan = true;  // 开启默认的平移操作
+    app.camera.enableZoom = true;  // 开启默认的缩放操作
+    app.camera.stopRotateAround();
+    if (rotateTimer) {
+        clearTimeout(rotateTimer);
+        rotateTimer = null;
+    }
+}
+/**
+ * 说明:重新开始转动,未进行任何操作5s后开始自动旋转
+ */
+function restarRotate() {
+    if (fpsCtrl != null || !$('#sceneSetting .control-menu-pane li.autoRotate').hasClass('selected')) {
+        return;
+    }
+    if (rotateTimer == null) {
+        rotateTimer = setTimeout(function () {
+            //  startRotate();
+        }, restartTime);
+    } else {
+        clearTimeout(rotateTimer);
+        rotateTimer = null;
+        restarRotate();
+    }
+}