summaryrefslogtreecommitdiff
path: root/gfx/followCameraController.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 /gfx/followCameraController.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 'gfx/followCameraController.cpp')
-rw-r--r--gfx/followCameraController.cpp12
1 files changed, 4 insertions, 8 deletions
diff --git a/gfx/followCameraController.cpp b/gfx/followCameraController.cpp
index 42d1666..d15ecda 100644
--- a/gfx/followCameraController.cpp
+++ b/gfx/followCameraController.cpp
@@ -20,20 +20,16 @@ FollowCameraController::updateCamera(Camera * camera) const
switch (mode) {
case Mode::Pan:
- camera->forward = glm::normalize(pos - camera->pos);
- camera->up = up;
+ camera->lookAt(pos);
break;
case Mode::Ride:
- camera->pos = pos + (up * 4.8F);
- camera->forward = !-sincosf(rot.y);
- camera->up = up;
+ camera->setView(pos + (up * 4.8F), !-sincosf(rot.y));
break;
case Mode::ISO:
- camera->pos = pos + ((up + north + east) * 40.F);
- camera->forward = glm::normalize(down + south + west);
- camera->up = glm::normalize(up - north - east);
+ camera->setView(pos + ((up + north + east) * 40.F), glm::normalize(down + south + west),
+ glm::normalize(up - north - east));
break;
}
}