don't put scene commands in the artifact map (#1403)

This commit is contained in:
Kurt Hutten
2024-02-13 18:47:37 +11:00
committed by GitHub
parent e714103655
commit 808830d29e
3 changed files with 70 additions and 12 deletions

View File

@ -481,6 +481,7 @@ class SetupSingleton {
const targetFov = 4
const fovAnimationStep = (currentFov - targetFov) / FRAMES_TO_ANIMATE_IN
let frameWaitOnFinish = 5
const animateFovChange = () => {
if (this.camera instanceof PerspectiveCamera) {
@ -490,14 +491,15 @@ class SetupSingleton {
this.camera.updateProjectionMatrix()
this.dollyZoom(currentFov)
requestAnimationFrame(animateFovChange) // Continue the animation
} else if (frameWaitOnFinish > 0) {
frameWaitOnFinish--
requestAnimationFrame(animateFovChange) // Continue the animation
} else {
setTimeout(() => {
// Once the target FOV is reached, switch to the orthographic camera
// Needs to wait a couple frames after the FOV animation is complete
this.useOrthographicCamera()
this.isFovAnimationInProgress = false
resolve(true)
}, 100)
// Once the target FOV is reached, switch to the orthographic camera
// Needs to wait a couple frames after the FOV animation is complete
this.useOrthographicCamera()
this.isFovAnimationInProgress = false
resolve(true)
}
}
}