From 72b0aa91933a57de2cf556e209c2274e19dea7f2 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Fri, 16 Dec 2022 19:19:06 +0000 Subject: Manual Camera Controller should not refer to current properties --- ui/manualCameraController.cpp | 4 ++-- 1 file 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); } -- cgit v1.2.3