voxelTerrain
 All Classes Functions Variables Typedefs Enumerations Pages
Public Types | Public Member Functions | Public Attributes | Protected Attributes | List of all members
Handler Class Reference

The Handler class initialises Ogre3d (graphics) and OIS (input) and derives their callbacks. Class shall simplify the examples. More...

#include <Handler.hpp>

Inheritance diagram for Handler:

Public Types

typedef blub::signal< void(blub::real)> t_sigFrame
 
typedef blub::signal< void(OIS::KeyEvent,
bool pressed)> 
t_sigKeyGotPressed
 
typedef blub::signal< void(bool
left)> 
t_sigMouseGotPressed
 

Public Member Functions

 Handler ()
 Handler constructor.
 
virtual ~Handler ()
 ~Handler destructor.
 
bool initialiseOgre ()
 initialiseOgre initialises ogre3d, including scene and camera. More...
 
bool initialiseOIS ()
 initialiseOIS initialises OIS More...
 
bool frameStarted (const Ogre::FrameEvent &evt)
 frameStarted gets called after every rendered frame by ogre3d. Method calls the graphic dispatcher used by OgreTile and the signal signalFrame(). More...
 
bool mouseMoved (const OIS::MouseEvent &arg)
 mouseMoved gets called by OIS. Calculates the camera orientation and sets the results. More...
 
bool mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID)
 mousePressed Checks if mouse button "left" or "right" got pressed and calls the signal signalKeyGotPressed() More...
 
bool mouseReleased (const OIS::MouseEvent &, OIS::MouseButtonID)
 mouseReleased Does nothing. Must get implemented because pure virtual in OIS::KeyListener More...
 
bool keyPressed (const OIS::KeyEvent &arg)
 keyPressed gets calles by OIS. If key F11 got pressed rendering mode gets changed to wireframe. More...
 
bool keyReleased (const OIS::KeyEvent &arg)
 keyReleased Does nothing. Must get implemented because pure virtual in OIS::KeyListener More...
 
bool handleKeyPress (const OIS::KeyEvent &arg, const bool &pressed)
 handleKeyPress checks if WSAD or LShift gets pressed and moves the camera. More...
 
t_sigFramesignalFrame ()
 
t_sigKeyGotPressedsignalKeyGotPressed ()
 
t_sigMouseGotPressedsignalMouseGotPressed ()
 

Public Attributes

blub::scopedPointer< Ogre::Root > renderSystem
 
Ogre::SceneManager * renderScene
 
Ogre::Camera * camera
 
OIS::InputManager * inputManager
 
OIS::Keyboard * keyboard
 
OIS::Mouse * mouse
 
blub::async::dispatcher graphicDispatcher
 

Protected Attributes

blub::real m_lookVert
 
blub::real m_lookHor
 
bool m_forward
 
bool m_backwards
 
bool m_left
 
bool m_right
 
bool m_fast
 
bool m_lookLeft
 
bool m_lookRight
 
bool m_lookUp
 
bool m_lookDown
 
t_sigFrame m_sigFrame
 
t_sigKeyGotPressed m_sigKeyGotPressed
 
t_sigMouseGotPressed m_sigMouseGotPressed
 

Detailed Description

The Handler class initialises Ogre3d (graphics) and OIS (input) and derives their callbacks. Class shall simplify the examples.

Examples:
customVertexInformation.cpp, mesh.cpp, noise.cpp, and primitives.cpp.

Member Function Documentation

bool Handler::frameStarted ( const Ogre::FrameEvent &  evt)
inline

frameStarted gets called after every rendered frame by ogre3d. Method calls the graphic dispatcher used by OgreTile and the signal signalFrame().

Parameters
evtContains timeSinceLastFrame
Returns
Returns false if render window got closed.
bool Handler::handleKeyPress ( const OIS::KeyEvent &  arg,
const bool &  pressed 
)
inline

handleKeyPress checks if WSAD or LShift gets pressed and moves the camera.

Parameters
arg
pressed
Returns
bool Handler::initialiseOgre ( )
inline

initialiseOgre initialises ogre3d, including scene and camera.

Returns
Returns false if window for graphic settings got cancelled by user.
Examples:
customVertexInformation.cpp, mesh.cpp, noise.cpp, and primitives.cpp.
bool Handler::initialiseOIS ( )
inline

initialiseOIS initialises OIS

Returns
Always true.
Examples:
customVertexInformation.cpp, mesh.cpp, noise.cpp, and primitives.cpp.
bool Handler::keyPressed ( const OIS::KeyEvent &  arg)
inline

keyPressed gets calles by OIS. If key F11 got pressed rendering mode gets changed to wireframe.

Parameters
arg
Returns
bool Handler::keyReleased ( const OIS::KeyEvent &  arg)
inline

keyReleased Does nothing. Must get implemented because pure virtual in OIS::KeyListener

Parameters
arg
Returns
bool Handler::mouseMoved ( const OIS::MouseEvent &  arg)
inline

mouseMoved gets called by OIS. Calculates the camera orientation and sets the results.

Parameters
arg
Returns
bool Handler::mousePressed ( const OIS::MouseEvent &  arg,
OIS::MouseButtonID   
)
inline

mousePressed Checks if mouse button "left" or "right" got pressed and calls the signal signalKeyGotPressed()

Parameters
arg
Returns
bool Handler::mouseReleased ( const OIS::MouseEvent &  ,
OIS::MouseButtonID   
)
inline

mouseReleased Does nothing. Must get implemented because pure virtual in OIS::KeyListener

Returns

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