From 1c2bc2e661ec4a95fb2a48f8a945409420e66349 Mon Sep 17 00:00:00 2001 From: xuhuajiao <13476289682@163.com> Date: Fri, 25 Apr 2025 15:00:17 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=8B=E8=BD=AC=E5=8A=9F=E8=83=BD=E5=AE=8C?= =?UTF-8?q?=E5=96=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/webThird/index.js | 18 +++++++++++++----- public/webWater/index.js | 14 ++++++++++---- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/public/webThird/index.js b/public/webThird/index.js index 30b99e3..27cf7e6 100644 --- a/public/webThird/index.js +++ b/public/webThird/index.js @@ -20,6 +20,7 @@ var drag = null // var showdd = 50 var isRotating = true +var clickParentRotate = false var camera BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function() { if (document.getElementById('customLoadingScreenDiv')) { @@ -105,9 +106,9 @@ function prepareGroupButton2(transformNodex, color, qu) { // // alert(error) // } // } + isRotating = false camera.useAutoRotationBehavior = isRotating - // } } ) ) @@ -133,8 +134,12 @@ function prepareGroupButton2(transformNodex, color, qu) { // } // } // clickbegin = false - isRotating = true - camera.useAutoRotationBehavior = isRotating + + if (clickParentRotate) { + isRotating = true + camera.useAutoRotationBehavior = isRotating + } + // } } ) @@ -253,8 +258,10 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() { } } // clickbegin = false - isRotating = true - camera.useAutoRotationBehavior = isRotating + if (clickParentRotate) { + isRotating = true + camera.useAutoRotationBehavior = isRotating + } // } } ) @@ -575,6 +582,7 @@ window.addEventListener( function toggleAutoRotation(isAutoRotating) { var camera = scene.activeCamera + clickParentRotate = !isAutoRotating if (!isAutoRotating) { // 启用自动旋转 camera.useAutoRotationBehavior = true diff --git a/public/webWater/index.js b/public/webWater/index.js index 8162e3b..184928e 100644 --- a/public/webWater/index.js +++ b/public/webWater/index.js @@ -20,6 +20,7 @@ var drag = null // var showdd = 50 var isRotating = true +var clickParentRotate = false var camera BABYLON.DefaultLoadingScreen.prototype.displayLoadingUI = function() { @@ -141,8 +142,10 @@ function prepareGroupButton2(transformNodex, color, qu) { // } // } // clickbegin = false - isRotating = true - camera.useAutoRotationBehavior = isRotating + if (clickParentRotate) { + isRotating = true + camera.useAutoRotationBehavior = isRotating + } // } } ) @@ -262,8 +265,10 @@ BABYLON.DefaultLoadingScreen.prototype.hideLoadingUI = function() { } } // clickbegin = false - isRotating = true - camera.useAutoRotationBehavior = isRotating + if (clickParentRotate) { + isRotating = true + camera.useAutoRotationBehavior = isRotating + } // } } ) @@ -594,6 +599,7 @@ window.addEventListener( function toggleAutoRotation(isAutoRotating) { var camera = scene.activeCamera + clickParentRotate = !isAutoRotating if (!isAutoRotating) { // 启用自动旋转 camera.useAutoRotationBehavior = true