TDME2 1.9.121
CameraInputHandler.h
Go to the documentation of this file.
1#pragma once
2
3#include <tdme/tdme.h>
7#include <tdme/math/Vector3.h>
9
15
16/**
17 * Camera Input Handler
18 * @author Andreas Drewke
19 * @version $Id$
20 */
23{
24private:
25 Engine* engine { nullptr };
27
28 bool keyLeft { false };
29 bool keyRight { false };
30 bool keyUp { false };
31 bool keyDown { false };
32 bool keyA { false };
33 bool keyD { false };
34 bool keyW { false };
35 bool keyS { false };
36 bool keyPlus { false };
37 bool keyMinus { false };
38 bool keyR { false };
39
40 static constexpr int MOUSE_DOWN_LAST_POSITION_NONE { -1 };
41 static constexpr int MOUSE_PANNING_NONE { 0 };
42 static constexpr int MOUSE_ROTATION_NONE { 0 };
43
44 int mouseRotationX { 0 };
45 int mouseRotationY { 0 };
48 bool mouseDragging { false };
49
50 float camScale { 1.0f };
51 float camScaleMax { 15.0f };
52 float camScaleMin { 0.05f };
53
56
58
59 bool resetRequested { false };
60
61public:
62 /**
63 * Public constructor
64 * @param engine engine
65 * @param eventHandler event handler
66 */
68
69 /**
70 * Destructor
71 */
73
74 /**
75 * @return scene center
76 */
77 inline const Vector3& getSceneCenter() {
78 return sceneCenter;
79 }
80
81 /**
82 * Set scene center
83 * @param sceneCenter scene center
84 */
85 inline void setSceneCenter(const Vector3& sceneCenter) {
86 this->sceneCenter = sceneCenter;
87 }
88
89 /**
90 * Reset
91 */
92 void reset();
93
94 // overriden methods
95 void handleInputEvents() override;
96
97};
Engine main class.
Definition: Engine.h:122
Rotation representation.
Definition: Rotation.h:18
3D vector 3 class
Definition: Vector3.h:22
void handleInputEvents() override
Handle input events that have not yet been processed.
CameraInputHandler(Engine *engine, CameraInputHandlerEventHandler *eventHandler=nullptr)
Public constructor.
CameraInputHandlerEventHandler * eventHandler
void setSceneCenter(const Vector3 &sceneCenter)
Set scene center.
GUI input event handler interface.