TDME2
1.9.121
src
tdme
tools
editor
misc
CameraInputHandler.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
tdme/tdme.h
>
4
#include <
tdme/engine/fwd-tdme.h
>
5
#include <
tdme/engine/Rotation.h
>
6
#include <
tdme/gui/events/GUIInputEventHandler.h
>
7
#include <
tdme/math/Vector3.h
>
8
#include <
tdme/tools/editor/misc/fwd-tdme.h
>
9
10
using
tdme::engine::Engine
;
11
using
tdme::engine::Rotation
;
12
using
tdme::gui::events::GUIInputEventHandler
;
13
using
tdme::math::Vector3
;
14
using
tdme::tools::editor::misc::CameraInputHandlerEventHandler
;
15
16
/**
17
* Camera Input Handler
18
* @author Andreas Drewke
19
* @version $Id$
20
*/
21
class
tdme::tools::editor::misc::CameraInputHandler
final
22
:
public
GUIInputEventHandler
23
{
24
private
:
25
Engine
*
engine
{
nullptr
};
26
CameraInputHandlerEventHandler
*
eventHandler
{
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 };
46
int
mouseDownLastX
{
MOUSE_DOWN_LAST_POSITION_NONE
};
47
int
mouseDownLastY
{
MOUSE_DOWN_LAST_POSITION_NONE
};
48
bool
mouseDragging
{
false
};
49
50
float
camScale
{ 1.0f };
51
float
camScaleMax
{ 15.0f };
52
float
camScaleMin
{ 0.05f };
53
54
Rotation
camLookRotationX
;
55
Rotation
camLookRotationY
;
56
57
Vector3
sceneCenter
;
58
59
bool
resetRequested
{
false
};
60
61
public
:
62
/**
63
* Public constructor
64
* @param engine engine
65
* @param eventHandler event handler
66
*/
67
CameraInputHandler
(
Engine
*
engine
,
CameraInputHandlerEventHandler
*
eventHandler
=
nullptr
);
68
69
/**
70
* Destructor
71
*/
72
~CameraInputHandler
();
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
};
GUIInputEventHandler.h
Rotation.h
Vector3.h
tdme::engine::Engine
Engine main class.
Definition:
Engine.h:122
tdme::engine::Rotation
Rotation representation.
Definition:
Rotation.h:18
tdme::math::Vector3
3D vector 3 class
Definition:
Vector3.h:22
tdme::tools::editor::misc::CameraInputHandler
Camera Input Handler.
Definition:
CameraInputHandler.h:23
tdme::tools::editor::misc::CameraInputHandler::getSceneCenter
const Vector3 & getSceneCenter()
Definition:
CameraInputHandler.h:77
tdme::tools::editor::misc::CameraInputHandler::engine
Engine * engine
Definition:
CameraInputHandler.h:25
tdme::tools::editor::misc::CameraInputHandler::camScaleMin
float camScaleMin
Definition:
CameraInputHandler.h:52
tdme::tools::editor::misc::CameraInputHandler::mouseRotationY
int mouseRotationY
Definition:
CameraInputHandler.h:45
tdme::tools::editor::misc::CameraInputHandler::sceneCenter
Vector3 sceneCenter
Definition:
CameraInputHandler.h:57
tdme::tools::editor::misc::CameraInputHandler::keyW
bool keyW
Definition:
CameraInputHandler.h:34
tdme::tools::editor::misc::CameraInputHandler::keyD
bool keyD
Definition:
CameraInputHandler.h:33
tdme::tools::editor::misc::CameraInputHandler::mouseRotationX
int mouseRotationX
Definition:
CameraInputHandler.h:44
tdme::tools::editor::misc::CameraInputHandler::MOUSE_ROTATION_NONE
static constexpr int MOUSE_ROTATION_NONE
Definition:
CameraInputHandler.h:42
tdme::tools::editor::misc::CameraInputHandler::handleInputEvents
void handleInputEvents() override
Handle input events that have not yet been processed.
Definition:
CameraInputHandler.cpp:51
tdme::tools::editor::misc::CameraInputHandler::camScale
float camScale
Definition:
CameraInputHandler.h:50
tdme::tools::editor::misc::CameraInputHandler::MOUSE_PANNING_NONE
static constexpr int MOUSE_PANNING_NONE
Definition:
CameraInputHandler.h:41
tdme::tools::editor::misc::CameraInputHandler::keyMinus
bool keyMinus
Definition:
CameraInputHandler.h:37
tdme::tools::editor::misc::CameraInputHandler::mouseDragging
bool mouseDragging
Definition:
CameraInputHandler.h:48
tdme::tools::editor::misc::CameraInputHandler::CameraInputHandler
CameraInputHandler(Engine *engine, CameraInputHandlerEventHandler *eventHandler=nullptr)
Public constructor.
Definition:
CameraInputHandler.cpp:29
tdme::tools::editor::misc::CameraInputHandler::keyS
bool keyS
Definition:
CameraInputHandler.h:35
tdme::tools::editor::misc::CameraInputHandler::MOUSE_DOWN_LAST_POSITION_NONE
static constexpr int MOUSE_DOWN_LAST_POSITION_NONE
Definition:
CameraInputHandler.h:40
tdme::tools::editor::misc::CameraInputHandler::keyUp
bool keyUp
Definition:
CameraInputHandler.h:30
tdme::tools::editor::misc::CameraInputHandler::camScaleMax
float camScaleMax
Definition:
CameraInputHandler.h:51
tdme::tools::editor::misc::CameraInputHandler::keyPlus
bool keyPlus
Definition:
CameraInputHandler.h:36
tdme::tools::editor::misc::CameraInputHandler::eventHandler
CameraInputHandlerEventHandler * eventHandler
Definition:
CameraInputHandler.h:26
tdme::tools::editor::misc::CameraInputHandler::keyRight
bool keyRight
Definition:
CameraInputHandler.h:29
tdme::tools::editor::misc::CameraInputHandler::keyDown
bool keyDown
Definition:
CameraInputHandler.h:31
tdme::tools::editor::misc::CameraInputHandler::resetRequested
bool resetRequested
Definition:
CameraInputHandler.h:59
tdme::tools::editor::misc::CameraInputHandler::mouseDownLastY
int mouseDownLastY
Definition:
CameraInputHandler.h:47
tdme::tools::editor::misc::CameraInputHandler::camLookRotationX
Rotation camLookRotationX
Definition:
CameraInputHandler.h:54
tdme::tools::editor::misc::CameraInputHandler::reset
void reset()
Reset.
Definition:
CameraInputHandler.cpp:42
tdme::tools::editor::misc::CameraInputHandler::mouseDownLastX
int mouseDownLastX
Definition:
CameraInputHandler.h:46
tdme::tools::editor::misc::CameraInputHandler::camLookRotationY
Rotation camLookRotationY
Definition:
CameraInputHandler.h:55
tdme::tools::editor::misc::CameraInputHandler::setSceneCenter
void setSceneCenter(const Vector3 &sceneCenter)
Set scene center.
Definition:
CameraInputHandler.h:85
tdme::tools::editor::misc::CameraInputHandler::keyA
bool keyA
Definition:
CameraInputHandler.h:32
tdme::tools::editor::misc::CameraInputHandler::keyR
bool keyR
Definition:
CameraInputHandler.h:38
tdme::tools::editor::misc::CameraInputHandler::keyLeft
bool keyLeft
Definition:
CameraInputHandler.h:28
tdme::tools::editor::misc::CameraInputHandler::~CameraInputHandler
~CameraInputHandler()
Destructor.
Definition:
CameraInputHandler.cpp:38
fwd-tdme.h
tdme::gui::events::GUIInputEventHandler
GUI input event handler interface.
Definition:
GUIInputEventHandler.h:12
tdme::tools::editor::misc::CameraInputHandlerEventHandler
Camera Input Handler Event Handler.
Definition:
CameraInputHandlerEventHandler.h:12
tdme.h
fwd-tdme.h
Generated by
1.9.3