We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2012f51 commit 1e5ff25Copy full SHA for 1e5ff25
src/view.cpp
@@ -489,12 +489,13 @@ void updateViewAndChangeUpDir(UpDir newUpDir, bool flyTo) {
489
case NavigateStyle::Arcball:
490
case NavigateStyle::FirstPerson: {
491
glm::vec3 lookDir = getCameraParametersForCurrentView().getLookDir();
492
- if (std::fabs(dot(view::getUpVec(), lookDir) < 0.01)) {
+ if (std::fabs(dot(view::getUpVec(), lookDir)) < 0.01) {
493
// if the new up direction is colinear with the direction we're currently looking
494
lookDir = getFrontVec();
495
}
496
497
- lookAt(getCameraWorldPosition(), lookDir * state::lengthScale, flyTo);
+ glm::vec3 camPos = getCameraWorldPosition();
498
+ lookAt(camPos, camPos + lookDir * state::lengthScale, flyTo);
499
500
break;
501
0 commit comments