TDME2
1.9.200
src
tdme
tools
editor
misc
CameraRotationInputHandler.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/primitives/BoundingBox.h
>
6
#include <
tdme/engine/Transform.h
>
7
#include <
tdme/gui/events/GUIInputEventHandler.h
>
8
#include <
tdme/tools/editor/misc/fwd-tdme.h
>
9
10
using
tdme::engine::primitives::BoundingBox
;
11
using
tdme::engine::Engine
;
12
using
tdme::engine::Transform
;
13
using
tdme::gui::events::GUIInputEventHandler
;
14
using
tdme::tools::editor::misc::CameraRotationInputHandlerEventHandler
;
15
16
/**
17
* Camera Rotation Input Handler
18
* @author Andreas Drewke
19
*/
20
class
tdme::tools::editor::misc::CameraRotationInputHandler
final
21
:
public
GUIInputEventHandler
22
{
23
private
:
24
Engine
*
engine
{
nullptr
};
25
bool
mouseDragging
;
26
bool
keyLeft
;
27
bool
keyRight
;
28
bool
keyUp
;
29
bool
keyDown
;
30
bool
keyPeriod
;
31
bool
keyComma
;
32
bool
keyPlus
;
33
bool
keyMinus
;
34
bool
keyR
;
35
int
mouseLastX
;
36
int
mouseLastY
;
37
Transform
lookFromRotations
;
38
float
defaultScale
;
39
float
scale
;
40
bool
resetRequested
;
41
BoundingBox
worldBoundingBox
;
42
CameraRotationInputHandlerEventHandler
*
eventHandler
{
nullptr
};
43
44
public
:
45
// forbid class copy
46
FORBID_CLASS_COPY
(
CameraRotationInputHandler
)
47
48
/**
49
* Public constructor
50
* @param engine engine
51
* @param eventHandler event handler
52
*/
53
CameraRotationInputHandler
(
Engine
*
engine
,
CameraRotationInputHandlerEventHandler
*
eventHandler
=
nullptr
);
54
55
/**
56
* Destructor
57
*/
58
~CameraRotationInputHandler
();
59
60
/**
61
* @return look from rotation
62
*/
63
const
Transform
&
getLookFromRotations
();
64
65
/**
66
* @return default scale
67
*/
68
inline
float
getDefaultScale
() {
69
return
defaultScale
;
70
}
71
72
/**
73
* Set default scale
74
* @param scale default scale
75
*/
76
inline
void
setDefaultScale
(
float
defaultScale
) {
77
this->defaultScale =
defaultScale
;
78
}
79
80
/**
81
* @return scale
82
*/
83
inline
float
getScale
() {
84
return
scale
;
85
}
86
87
/**
88
* Set scale
89
* @param scale scale
90
*/
91
inline
void
setScale
(
float
scale
) {
92
this->scale =
scale
;
93
}
94
95
/**
96
* Reset
97
*/
98
void
reset
();
99
100
// overridden methods
101
void
handleInputEvents
()
override
;
102
103
};
BoundingBox.h
GUIInputEventHandler.h
Transform.h
tdme::engine::Engine
Engine main class.
Definition:
Engine.h:131
tdme::engine::Transform
Transform which contain scale, rotations and translation.
Definition:
Transform.h:29
tdme::engine::primitives::BoundingBox
Axis aligned bounding box used for frustum, this is not directly connectable with physics engine.
Definition:
BoundingBox.h:26
tdme::tools::editor::misc::CameraRotationInputHandler
Camera Rotation Input Handler.
Definition:
CameraRotationInputHandler.h:22
tdme::tools::editor::misc::CameraRotationInputHandler::engine
Engine * engine
Definition:
CameraRotationInputHandler.h:24
tdme::tools::editor::misc::CameraRotationInputHandler::keyPeriod
bool keyPeriod
Definition:
CameraRotationInputHandler.h:30
tdme::tools::editor::misc::CameraRotationInputHandler::getDefaultScale
float getDefaultScale()
Definition:
CameraRotationInputHandler.h:68
tdme::tools::editor::misc::CameraRotationInputHandler::scale
float scale
Definition:
CameraRotationInputHandler.h:39
tdme::tools::editor::misc::CameraRotationInputHandler::worldBoundingBox
BoundingBox worldBoundingBox
Definition:
CameraRotationInputHandler.h:41
tdme::tools::editor::misc::CameraRotationInputHandler::eventHandler
CameraRotationInputHandlerEventHandler * eventHandler
Definition:
CameraRotationInputHandler.h:42
tdme::tools::editor::misc::CameraRotationInputHandler::getLookFromRotations
const Transform & getLookFromRotations()
Definition:
CameraRotationInputHandler.cpp:59
tdme::tools::editor::misc::CameraRotationInputHandler::getScale
float getScale()
Definition:
CameraRotationInputHandler.h:83
tdme::tools::editor::misc::CameraRotationInputHandler::~CameraRotationInputHandler
~CameraRotationInputHandler()
Destructor.
Definition:
CameraRotationInputHandler.cpp:56
tdme::tools::editor::misc::CameraRotationInputHandler::mouseLastX
int mouseLastX
Definition:
CameraRotationInputHandler.h:35
tdme::tools::editor::misc::CameraRotationInputHandler::handleInputEvents
void handleInputEvents() override
Handle input events that have not yet been processed.
Definition:
CameraRotationInputHandler.cpp:69
tdme::tools::editor::misc::CameraRotationInputHandler::defaultScale
float defaultScale
Definition:
CameraRotationInputHandler.h:38
tdme::tools::editor::misc::CameraRotationInputHandler::keyMinus
bool keyMinus
Definition:
CameraRotationInputHandler.h:33
tdme::tools::editor::misc::CameraRotationInputHandler::mouseDragging
bool mouseDragging
Definition:
CameraRotationInputHandler.h:25
tdme::tools::editor::misc::CameraRotationInputHandler::setDefaultScale
void setDefaultScale(float defaultScale)
Set default scale.
Definition:
CameraRotationInputHandler.h:76
tdme::tools::editor::misc::CameraRotationInputHandler::keyUp
bool keyUp
Definition:
CameraRotationInputHandler.h:28
tdme::tools::editor::misc::CameraRotationInputHandler::keyComma
bool keyComma
Definition:
CameraRotationInputHandler.h:31
tdme::tools::editor::misc::CameraRotationInputHandler::keyPlus
bool keyPlus
Definition:
CameraRotationInputHandler.h:32
tdme::tools::editor::misc::CameraRotationInputHandler::keyRight
bool keyRight
Definition:
CameraRotationInputHandler.h:27
tdme::tools::editor::misc::CameraRotationInputHandler::keyDown
bool keyDown
Definition:
CameraRotationInputHandler.h:29
tdme::tools::editor::misc::CameraRotationInputHandler::resetRequested
bool resetRequested
Definition:
CameraRotationInputHandler.h:40
tdme::tools::editor::misc::CameraRotationInputHandler::mouseLastY
int mouseLastY
Definition:
CameraRotationInputHandler.h:36
tdme::tools::editor::misc::CameraRotationInputHandler::reset
void reset()
Reset.
Definition:
CameraRotationInputHandler.cpp:64
tdme::tools::editor::misc::CameraRotationInputHandler::lookFromRotations
Transform lookFromRotations
Definition:
CameraRotationInputHandler.h:37
tdme::tools::editor::misc::CameraRotationInputHandler::setScale
void setScale(float scale)
Set scale.
Definition:
CameraRotationInputHandler.h:91
tdme::tools::editor::misc::CameraRotationInputHandler::CameraRotationInputHandler
CameraRotationInputHandler(Engine *engine, CameraRotationInputHandlerEventHandler *eventHandler=nullptr)
Public constructor.
Definition:
CameraRotationInputHandler.cpp:31
tdme::tools::editor::misc::CameraRotationInputHandler::keyR
bool keyR
Definition:
CameraRotationInputHandler.h:34
tdme::tools::editor::misc::CameraRotationInputHandler::keyLeft
bool keyLeft
Definition:
CameraRotationInputHandler.h:26
fwd-tdme.h
tdme::gui::events::GUIInputEventHandler
GUI input event handler interface.
Definition:
GUIInputEventHandler.h:11
tdme::tools::editor::misc::CameraRotationInputHandlerEventHandler
Camera Rotation Input Handler Event Handler.
Definition:
CameraRotationInputHandlerEventHandler.h:11
tdme.h
FORBID_CLASS_COPY
#define FORBID_CLASS_COPY(CLASS)
Definition:
tdme.h:6
fwd-tdme.h
Generated by
1.9.1