summaryrefslogtreecommitdiff
path: root/ui/manualCameraController.h
blob: d3bf0c4f0c11fd1798b049069e7894ec85880cc0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#pragma once

#include "uiComponent.h"
#include <SDL2/SDL.h>
#include <gfx/camera_controller.h>
#include <glm/glm.hpp>
#include <maths.h>

class Camera;

class ManualCameraController : public CameraController, public UIComponent {
public:
	explicit ManualCameraController(GlobalPosition2D f) : focus {f} { }

	bool handleInput(const SDL_Event & e) override;
	void render() const override;

	void updateCamera(Camera * camera) const override;

private:
	bool ctrl {false}, mrb {false};
	GlobalPosition2D focus;
	float direction {quarter_pi};
	float dist {4000}, pitch {quarter_pi};
};