summaryrefslogtreecommitdiff
path: root/ui/manualCameraController.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2022-12-11 14:22:57 +0000
committerDan Goodliffe <dan.goodliffe@octal.co.uk>2022-12-12 09:17:38 +0000
commit379b07fa1fb953cc175028fcb95dfbb64c392451 (patch)
treea299bb5118612a308f2404638e24d3b4184a78d7 /ui/manualCameraController.cpp
parentFix case of GetViewProjection (diff)
downloadilt-379b07fa1fb953cc175028fcb95dfbb64c392451.tar.bz2
ilt-379b07fa1fb953cc175028fcb95dfbb64c392451.tar.xz
ilt-379b07fa1fb953cc175028fcb95dfbb64c392451.zip
Make Camera members private with accessors and helpful setters
Diffstat (limited to 'ui/manualCameraController.cpp')
-rw-r--r--ui/manualCameraController.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/ui/manualCameraController.cpp b/ui/manualCameraController.cpp
index 74b526b..6d4a22a 100644
--- a/ui/manualCameraController.cpp
+++ b/ui/manualCameraController.cpp
@@ -78,7 +78,6 @@ ManualCameraController::render(const UIShader &, const Position &) const
void
ManualCameraController::updateCamera(Camera * camera) const
{
- camera->forward = glm::normalize(sincosf(direction) ^ -sin(pitch));
- camera->pos = !focus + up * 3.F - (camera->forward * std::pow(dist, 1.3F));
- camera->up = up;
+ camera->setView(!focus + up * 3.F - (camera->getForward() * std::pow(dist, 1.3F)),
+ glm::normalize(sincosf(direction) ^ -sin(pitch)));
}