|
@@ -194,7 +194,8 @@ export default class App {
|
|
if(!this.lastDirc) this.lastDirc = 0
|
|
if(!this.lastDirc) this.lastDirc = 0
|
|
|
|
|
|
// 一般来说瞬时距离不会超过100,定100时转180度
|
|
// 一般来说瞬时距离不会超过100,定100时转180度
|
|
- let alphaOffset = pointerOffset / 100 * Math.PI
|
|
|
|
|
|
+ // let alphaOffset = Math.max(Math.floor((pointerOffset / 100 * Math.PI / (Math.PI / 30)) * (Math.PI / 30) + Math.PI / 60), Math.PI / 30)
|
|
|
|
+ let alphaOffset = Math.max(pointerOffset / 100 * Math.PI, Math.PI / 30)
|
|
alphaOffset *= dirc
|
|
alphaOffset *= dirc
|
|
|
|
|
|
if(charactor.actionType.split("-")[1] == "Walking") {
|
|
if(charactor.actionType.split("-")[1] == "Walking") {
|
|
@@ -220,6 +221,7 @@ export default class App {
|
|
this.lastDirc = dirc
|
|
this.lastDirc = dirc
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ // async
|
|
rotateCamera(alphaOffset, func) {
|
|
rotateCamera(alphaOffset, func) {
|
|
// todo
|
|
// todo
|
|
let video0 = document.getElementById("houseTexture0")
|
|
let video0 = document.getElementById("houseTexture0")
|
|
@@ -228,9 +230,6 @@ export default class App {
|
|
let durtime = Math.abs(alphaOffset / (Math.PI * 2) * video0.duration)
|
|
let durtime = Math.abs(alphaOffset / (Math.PI * 2) * video0.duration)
|
|
|
|
|
|
if(video0.paused) {
|
|
if(video0.paused) {
|
|
- video0.currentTime = startTime
|
|
|
|
- video0.play()
|
|
|
|
-
|
|
|
|
// if(dirc * this.lastDirc < 0) {
|
|
// if(dirc * this.lastDirc < 0) {
|
|
// 清除已有动画再播新动画
|
|
// 清除已有动画再播新动画
|
|
this.scene.stopAnimation(this.camera, "rotateCamera")
|
|
this.scene.stopAnimation(this.camera, "rotateCamera")
|
|
@@ -250,6 +249,10 @@ export default class App {
|
|
|
|
|
|
rotateAni.setKeys(rotateFrames);
|
|
rotateAni.setKeys(rotateFrames);
|
|
|
|
|
|
|
|
+ video0.currentTime = startTime
|
|
|
|
+ // await
|
|
|
|
+ video0.play()
|
|
|
|
+
|
|
this.scene.beginDirectAnimation(this.camera, [rotateAni], 0, rotateCameraFrameNum, false, 1,
|
|
this.scene.beginDirectAnimation(this.camera, [rotateAni], 0, rotateCameraFrameNum, false, 1,
|
|
() => {
|
|
() => {
|
|
this.lastDirc = 0
|
|
this.lastDirc = 0
|
|
@@ -259,14 +262,14 @@ export default class App {
|
|
|
|
|
|
} else {
|
|
} else {
|
|
// console.error("-------------")
|
|
// console.error("-------------")
|
|
- video0.pause()
|
|
|
|
|
|
+ // video0.pause()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
lockCamera(isTrue) {
|
|
lockCamera(isTrue) {
|
|
this.cameraControlEnable = isTrue
|
|
this.cameraControlEnable = isTrue
|
|
- // this.camera.lowerAlphaLimit = isTrue ? this.camera.alpha : null
|
|
|
|
- // this.camera.upperAlphaLimit = isTrue ? this.camera.alpha : null
|
|
|
|
|
|
+ this.camera.lowerAlphaLimit = isTrue ? this.camera.alpha : null
|
|
|
|
+ this.camera.upperAlphaLimit = isTrue ? this.camera.alpha : null
|
|
}
|
|
}
|
|
|
|
|
|
updateHouseVideo(video) {
|
|
updateHouseVideo(video) {
|