From dd236a39906de5855fdd1252b17a7337f0c7b052 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sun, 28 Feb 2021 23:29:37 +0000 Subject: Vastly improved manual camera controller --- gfx/manualCameraController.h | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'gfx/manualCameraController.h') diff --git a/gfx/manualCameraController.h b/gfx/manualCameraController.h index 465f31f..f2141a4 100644 --- a/gfx/manualCameraController.h +++ b/gfx/manualCameraController.h @@ -5,12 +5,15 @@ #include "inputHandler.h" #include #include -#include +#include +#include class Camera; class ManualCameraController : public CameraController, public InputHandler { public: + explicit ManualCameraController(glm::vec2 f) : focus {f} { } + bool handleInput(SDL_Event & e) override; void tick(TickDuration) override { } @@ -19,6 +22,8 @@ public: private: bool ctrl {false}, mrb {false}; - mutable std::optional motion; + glm::vec2 focus; + float direction {quarter_pi}; + float dist {40}, pitch {quarter_pi}; }; #endif -- cgit v1.2.3