Thrive
Classes | Public Member Functions | Static Public Member Functions | List of all members
thrive::Mouse Class Reference

Handles mouse events. More...

#include <mouse.h>

Classes

struct  Implementation
 

Public Member Functions

 Mouse ()
 Constructor.
 
 ~Mouse ()
 Destructor.
 
void init (OIS::InputManager *inputManager, CEGUI::InputAggregator *aggregator)
 Initializes the mouse. More...
 
bool isButtonDown (OIS::MouseButtonID button) const
 Checks whether a mouse button is pressed Note that unlike wasButtonPressed this is not affected by CEGUI. More...
 
bool wasButtonPressed (OIS::MouseButtonID button) const
 Checks whether a mouse button was pressed since last update frame Note that this only returns true if CEGUI did not handle the event. More...
 
Ogre::Vector3 normalizedPosition () const
 The mouse position in coordinates ranging from 0.0 to 1.0. More...
 
Ogre::Vector3 position () const
 The mouse position in pixels, relative to the top-right window corner. More...
 
int scrollChange () const
 The scrollvalue since last update. More...
 
void setWindowSize (int width, int height)
 Updates the window size. More...
 
void shutdown ()
 Shuts down the mouse.
 
void update ()
 Updates the queue with new events.
 

Static Public Member Functions

static luabind::scope luaBindings ()
 Lua bindings. More...
 

Detailed Description

Handles mouse events.

Member Function Documentation

void Mouse::init ( OIS::InputManager *  inputManager,
CEGUI::InputAggregator *  aggregator 
)

Initializes the mouse.

Parameters
inputManagerThe input manager to use
bool Mouse::isButtonDown ( OIS::MouseButtonID  button) const

Checks whether a mouse button is pressed Note that unlike wasButtonPressed this is not affected by CEGUI.

Parameters
buttonThe button to check for
Returns
true if the mouse button is pressed down, false otherwise
luabind::scope Mouse::luaBindings ( )
static
Ogre::Vector3 Mouse::normalizedPosition ( ) const

The mouse position in coordinates ranging from 0.0 to 1.0.

Returns
Ogre::Vector3 Mouse::position ( ) const

The mouse position in pixels, relative to the top-right window corner.

Returns
int Mouse::scrollChange ( ) const

The scrollvalue since last update.

Returns
void Mouse::setWindowSize ( int  width,
int  height 
)

Updates the window size.

Used for normalization

Parameters
widthWindow width in pixels
heightWindow height in pixels
bool Mouse::wasButtonPressed ( OIS::MouseButtonID  button) const

Checks whether a mouse button was pressed since last update frame Note that this only returns true if CEGUI did not handle the event.

Parameters
buttonThe button to check for
Returns
true if the mouse button was released since last update, false otherwise

The documentation for this class was generated from the following files: