Handle invalid camera when moving.
This commit is contained in:
parent
615bab3c4d
commit
2740de7098
@ -308,6 +308,10 @@ OV.Navigation = class
|
||||
}
|
||||
}
|
||||
|
||||
if (newCamera === null) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (stepCount === 0) {
|
||||
this.SetCamera (newCamera);
|
||||
return;
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user