diff options
author | Dan Goodliffe <dan@randomdan.homeip.net> | 2022-12-11 14:22:57 +0000 |
---|---|---|
committer | Dan Goodliffe <dan.goodliffe@octal.co.uk> | 2022-12-12 09:17:38 +0000 |
commit | 379b07fa1fb953cc175028fcb95dfbb64c392451 (patch) | |
tree | a299bb5118612a308f2404638e24d3b4184a78d7 /ui/manualCameraController.cpp | |
parent | Fix case of GetViewProjection (diff) | |
download | ilt-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.cpp | 5 |
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))); } |