Fix navigation state not loading correctly from profile (closes #2143)

Note that the anchor should be used as a reference frame per default. Also, it should always be used, if possible. We have quite some problems when using other reference frames

PR: #2175
This commit is contained in:
Emma Broman
2022-07-04 15:02:06 +02:00
committed by GitHub
parent 74be7f84c6
commit db36b2dec5
2 changed files with 7 additions and 4 deletions

View File

@@ -1715,8 +1715,11 @@ void setCameraFromProfile(const Profile& p) {
if (navStateProfile.aim.has_value()) {
nav.aim = navStateProfile.aim.value();
}
if (nav.referenceFrame.empty()) {
nav.referenceFrame = "Root";
if (navStateProfile.referenceFrame.empty()) {
nav.referenceFrame = nav.anchor;
}
else {
nav.referenceFrame = navStateProfile.referenceFrame;
}
nav.position = navStateProfile.position;
if (navStateProfile.up.has_value()) {