Set default values for starting time and start camera (closes #1981)

This commit is contained in:
Alexander Bock
2022-04-08 16:05:56 +02:00
parent bc470ebed8
commit 5fc5ce318a
3 changed files with 20 additions and 14 deletions

View File

@@ -1659,8 +1659,14 @@ void OpenSpaceEngine::removeModeChangeCallback(CallbackHandle handle) {
void setCameraFromProfile(const Profile& p) {
if (!p.camera.has_value()) {
throw ghoul::RuntimeError("No 'camera' entry exists in the startup profile");
// If the camera is not specified, we want to set it to a sensible default value
interaction::NavigationState nav;
nav.anchor = "Root";
nav.referenceFrame = "Root";
global::navigationHandler->setNavigationStateNextFrame(nav);
return;
}
std::visit(
overloaded{
[](const Profile::CameraNavState& navStateProfile) {