summaryrefslogtreecommitdiff
path: root/ui/manualCameraController.cpp
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 19:58:06 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2024-01-01 19:59:07 +0000
commitb1ad84be00b9a88af0a9e087f5d5b724a8b3077d (patch)
tree4b58c098772e35ca307148e8a3a36103ec429b23 /ui/manualCameraController.cpp
parentRemove more use of legacy types from asset factory (diff)
downloadilt-b1ad84be00b9a88af0a9e087f5d5b724a8b3077d.tar.bz2
ilt-b1ad84be00b9a88af0a9e087f5d5b724a8b3077d.tar.xz
ilt-b1ad84be00b9a88af0a9e087f5d5b724a8b3077d.zip
Remove more use of legacy types from camera controller
Diffstat (limited to 'ui/manualCameraController.cpp')
-rw-r--r--ui/manualCameraController.cpp5
1 files changed, 3 insertions, 2 deletions
diff --git a/ui/manualCameraController.cpp b/ui/manualCameraController.cpp
index ef26e81..a55b9cc 100644
--- a/ui/manualCameraController.cpp
+++ b/ui/manualCameraController.cpp
@@ -59,7 +59,8 @@ ManualCameraController::handleInput(const SDL_Event & e, const Position &)
pitch = std::clamp(pitch - 0.01F * static_cast<float>(e.motion.yrel), 0.1F, half_pi);
}
else {
- focus += rotate_flat(-direction) * (Position2D {-e.motion.xrel, e.motion.yrel} * dist / 2.0F);
+ focus += rotate_flat(-direction)
+ * (RelativePosition2D {-e.motion.xrel, e.motion.yrel} * dist / 2.0F);
}
}
return true;
@@ -79,5 +80,5 @@ void
ManualCameraController::updateCamera(Camera * camera) const
{
const auto forward = glm::normalize(sincosf(direction) || -sin(pitch));
- camera->setView((focus || 0.F) - forward * 3.F * std::pow(dist, 1.3F), forward);
+ camera->setView((focus || 0) - GlobalPosition3D(forward * 3.F * std::pow(dist, 1.3F)), forward);
}