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