Thrive
mouse.h
1 #pragma once
2 
3 #include <list>
4 #include <memory>
5 #include <OISMouse.h>
6 
7 namespace luabind {
8 class scope;
9 }
10 
11 namespace Ogre {
12 class Vector3;
13 }
14 
15 namespace OIS {
16 class InputManager;
17 }
18 
19 namespace CEGUI {
20  class InputAggregator;
21 }
22 
23 namespace thrive {
24 
28 class Mouse {
29 
30 public:
31 
42  static luabind::scope
43  luaBindings();
44 
48  Mouse();
49 
53  ~Mouse();
54 
61  void
62  init(
63  OIS::InputManager* inputManager,
64  CEGUI::InputAggregator* aggregator
65  );
66 
77  bool
79  OIS::MouseButtonID button
80  ) const;
81 
92  bool
94  OIS::MouseButtonID button
95  ) const;
96 
102  Ogre::Vector3
103  normalizedPosition() const;
104 
110  Ogre::Vector3
111  position() const;
112 
118  int
119  scrollChange() const;
120 
132  void
134  int width,
135  int height
136  );
137 
141  void
142  shutdown();
143 
147  void
148  update();
149 
150 private:
151 
152  struct Implementation;
153  std::unique_ptr<Implementation> m_impl;
154 };
155 
156 }
157 
bool wasButtonPressed(OIS::MouseButtonID button) const
Checks whether a mouse button was pressed since last update frame Note that this only returns true if...
Definition: mouse.cpp:148
Definition: engine.h:30
Definition: script_wrappers.h:5
Ogre::Vector3 position() const
The mouse position in pixels, relative to the top-right window corner.
Definition: mouse.cpp:178
void shutdown()
Shuts down the mouse.
Definition: mouse.cpp:206
int scrollChange() const
The scrollvalue since last update.
Definition: mouse.cpp:187
Handles mouse events.
Definition: mouse.h:28
Mouse()
Constructor.
Definition: mouse.cpp:114
Ogre::Vector3 normalizedPosition() const
The mouse position in coordinates ranging from 0.0 to 1.0.
Definition: mouse.cpp:167
static luabind::scope luaBindings()
Lua bindings.
Definition: mouse.cpp:92
~Mouse()
Destructor.
Definition: mouse.cpp:120
Definition: bullet_to_ogre_system.h:5
Definition: bullet_ogre_conversion.h:6
void update()
Updates the queue with new events.
Definition: mouse.cpp:214
Definition: debug_drawing.h:8
void init(OIS::InputManager *inputManager, CEGUI::InputAggregator *aggregator)
Initializes the mouse.
Definition: mouse.cpp:123
bool isButtonDown(OIS::MouseButtonID button) const
Checks whether a mouse button is pressed Note that unlike wasButtonPressed this is not affected by CE...
Definition: mouse.cpp:141
void setWindowSize(int width, int height)
Updates the window size.
Definition: mouse.cpp:192