Browse Source

旋转功能完善

master
xuhuajiao 2 months ago
parent
commit
1c2bc2e661
  1. 18
      public/webThird/index.js
  2. 14
      public/webWater/index.js

18
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

14
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

Loading…
Cancel
Save