Handle invalid camera when moving.

This commit is contained in:
Viktor Kovacs 2021-04-20 15:20:11 +02:00
parent 615bab3c4d
commit 2740de7098
2 changed files with 5 additions and 3 deletions

View File

@ -308,6 +308,10 @@ OV.Navigation = class
}
}
if (newCamera === null) {
return;
}
if (stepCount === 0) {
this.SetCamera (newCamera);
return;

View File

@ -155,9 +155,7 @@ OV.Viewer = class
let fov = this.camera.fov;
if (animation) {
let newCamera = this.navigation.GetFitToSphereCamera (center, radius, fov);
if (newCamera !== null) {
this.navigation.MoveCamera (newCamera, this.settings.animationSteps);
}
this.navigation.MoveCamera (newCamera, this.settings.animationSteps);
} else {
this.navigation.FitToSphere (center, radius, fov);
}