Explorar o código

3dModeling pulic.js 沈瑞清 commit at 2021-03-08

沈瑞清 %!s(int64=4) %!d(string=hai) anos
pai
achega
d184637b05
Modificáronse 1 ficheiros con 22 adicións e 0 borrados
  1. 22 0
      3dModeling/zhhry17/pulic.js

+ 22 - 0
3dModeling/zhhry17/pulic.js

@@ -182,3 +182,25 @@ function stopRotate() {
     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();
+    }
+}