summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-12-16 19:19:06 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2022-12-16 19:19:06 +0000
commit72b0aa91933a57de2cf556e209c2274e19dea7f2 (patch)
tree9b1642191a780d538cd94be382995f977f824bf5
parentAdd Camera method to get the extents of the view frustrum at some distance (diff)
downloadilt-72b0aa91933a57de2cf556e209c2274e19dea7f2.tar.bz2
ilt-72b0aa91933a57de2cf556e209c2274e19dea7f2.tar.xz
ilt-72b0aa91933a57de2cf556e209c2274e19dea7f2.zip
Manual Camera Controller should not refer to current properties
-rw-r--r--ui/manualCameraController.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/manualCameraController.cpp b/ui/manualCameraController.cpp
index 6d4a22a..8e52b0e 100644
--- a/ui/manualCameraController.cpp
+++ b/ui/manualCameraController.cpp
@@ -78,6 +78,6 @@ ManualCameraController::render(const UIShader &, const Position &) const
void
ManualCameraController::updateCamera(Camera * camera) const
{
- camera->setView(!focus + up * 3.F - (camera->getForward() * std::pow(dist, 1.3F)),
- glm::normalize(sincosf(direction) ^ -sin(pitch)));
+ const auto forward = glm::normalize(sincosf(direction) ^ -sin(pitch));
+ camera->setView(!focus - forward * 3.F * std::pow(dist, 1.3F), forward);
}