summaryrefslogtreecommitdiff
path: root/ui/manualCameraController.h
diff options
context:
space:
mode:
authorDan Goodliffe <dan@randomdan.homeip.net>2021-12-13 23:47:30 +0000
committerDan Goodliffe <dan@randomdan.homeip.net>2021-12-13 23:47:30 +0000
commit1686a01b6ae7467e71eac247078248de4a3b3423 (patch)
tree53716ce767b1b775dc06f658a41a647bddbbeac1 /ui/manualCameraController.h
parentMove TickDuration to its own files (diff)
downloadilt-1686a01b6ae7467e71eac247078248de4a3b3423.tar.bz2
ilt-1686a01b6ae7467e71eac247078248de4a3b3423.tar.xz
ilt-1686a01b6ae7467e71eac247078248de4a3b3423.zip
Refactor to start splitting out UI components
Diffstat (limited to 'ui/manualCameraController.h')
-rw-r--r--ui/manualCameraController.h26
1 files changed, 26 insertions, 0 deletions
diff --git a/ui/manualCameraController.h b/ui/manualCameraController.h
new file mode 100644
index 0000000..ceff9ac
--- /dev/null
+++ b/ui/manualCameraController.h
@@ -0,0 +1,26 @@
+#ifndef MANUAL_CAMERA_CONTROLLER_H
+#define MANUAL_CAMERA_CONTROLLER_H
+
+#include "inputHandler.h"
+#include <SDL2/SDL.h>
+#include <gfx/camera_controller.h>
+#include <glm/glm.hpp>
+#include <maths.h>
+
+class Camera;
+
+class ManualCameraController : public CameraController, public InputHandler {
+public:
+ explicit ManualCameraController(glm::vec2 f) : focus {f} { }
+
+ bool handleInput(const SDL_Event & e) override;
+
+ void updateCamera(Camera * camera) const override;
+
+private:
+ bool ctrl {false}, mrb {false};
+ glm::vec2 focus;
+ float direction {quarter_pi};
+ float dist {40}, pitch {quarter_pi};
+};
+#endif