Переглянути джерело

3dModeling buildingCreate.js 袁明明 commit at 2020-12-07

袁明明 4 роки тому
батько
коміт
fe7bb82d24
1 змінених файлів з 73 додано та 0 видалено
  1. 73 0
      3dModeling/zhhry10/buildingCreate.js

+ 73 - 0
3dModeling/zhhry10/buildingCreate.js

@@ -302,3 +302,76 @@ function registerEvent() {
             fullScreen();
             fullScreenState = true;
         } else {
+            $('.btn-full-screen').css('display', 'block');
+            $('.btn-narrow').css('display', 'none');
+            $('#fullScreen span').text('全屏');
+            exitFullScreen();
+            fullScreenState = false;
+            if ($('#mapBg').hasClass('active')) {
+                destoryMiniMap();
+                createMiniMap();
+            }
+        }
+        checkBtnActives(['#mapBg', '#sceneSetting']);
+    });
+    // 鼠标键按下事件,功能按钮隐藏
+    app.on(THING.EventType.MouseDown, function () {
+        app.pauseEvent(THING.EventType.CameraZoom, null, '摄像机前后滚动,功能图片隐藏');
+        if (showControlTimer != null) {
+            clearTimeout(showControlTimer);
+            showControlTimer = null;
+        }
+        stopRotate();
+        if (hiddenControlTimer == null) {
+            clearTimeout(showControlTimer);
+            hiddenControlTimer = setTimeout(function () {
+                $('#all-controls').css('display', 'none');
+                clearTimeout(hiddenControlTimer);
+                hiddenControlTimer = null;
+            }, 300);
+        }
+    });
+    // 鼠标键抬起事件,功能按钮显示
+    app.on(THING.EventType.MouseUp, function () {
+        app.resumeEvent(THING.EventType.CameraZoom, null, '摄像机前后滚动,功能图片隐藏');
+        if (hiddenControlTimer != null) {
+            clearTimeout(hiddenControlTimer);
+            hiddenControlTimer = null;
+        }
+        if (showControlTimer == null) {
+            showControlTimer = setTimeout(function () {
+                $('#all-controls').css('display', 'block');
+                clearTimeout(showControlTimer);
+                showControlTimer = null;
+                restarRotate();
+            }, 300);
+        }
+    });
+    let count = 0;
+    // 鼠标滑轮滚动
+    app.on(THING.EventType.CameraZoom, function () {
+        if (showControlTimer != null) {
+            count = 0;
+            return;
+        }
+        stopRotate();
+        if (showControlTimer == null) {
+            $('#all-controls').css('display', 'none');
+            showControlTimer = setInterval(function () {
+                count++;
+                if (count >= 2) {
+                    $('#all-controls').css('display', 'block');
+                    restarRotate();
+                    clearInterval(showControlTimer);
+                    showControlTimer = null;
+                }
+            }, 300);
+        }
+    }, '摄像机前后滚动,功能图片隐藏');
+
+    // 鼠标移动事件,已创建的红色胶囊跟随鼠标移动
+    app.on(THING.EventType.MouseMove, function (ev) {
+        if (box != null) {
+            if (ev.picked) {
+                box.position = ev.pickedPosition;
+            }