COgreVRApplication Class Referenceabstract

Basic framework to design VR applications. More...

Inheritance diagram for COgreVRApplication:
CHandballBCI CSpaceshipBCI

Public Member Functions

 COgreVRApplication (const char *sResourceRoot)
 Default constructor.
 
virtual ~COgreVRApplication ()
 Destructor.
 
virtual void go (void)
 Launches the application (engine setup, initialization, rendering start).
 

Protected Member Functions

virtual bool setup (void)
 Main Ogre and custom setup steps. More...
 
virtual bool configure (void)
 Configuration management. More...
 
virtual void setupResources (void)
 Parsing of the resource configuration file.
 
virtual bool initialise (void)=0
 Initialize the scene. This function has to be implemented with the specific Ogre code. More...
 
virtual bool process (double timeSinceLastProcess)=0
 Main loop. Developer has to implement this function with the specific behaviour of its a application. More...
 
bool frameStarted (const Ogre::FrameEvent &evt)
 Frame started callback.
 
bool frameEnded (const Ogre::FrameEvent &evt)
 Frame ended callback. More...
 
virtual bool initOIS (void)
 Initialize the OIS plugin. More...
 
bool mouseMoved (const OIS::MouseEvent &arg)
 Mouse moved callback, launched when the mouse is moved. More...
 
bool mousePressed (const OIS::MouseEvent &arg, OIS::MouseButtonID id)
 Mouse pressed callback, launched when a mouse button is pressed. More...
 
bool mouseReleased (const OIS::MouseEvent &arg, OIS::MouseButtonID id)
 Mouse released callback, launched when a mouse button is released. More...
 
bool keyPressed (const OIS::KeyEvent &evt)
 Key pressed callback, launched when a key is pressed. More...
 
bool keyReleased (const OIS::KeyEvent &evt)
 Key released callback, launched when a key is released. More...
 
virtual bool initCEGUI (const char *logFileName)
 Initialize the CEGUI plugin. More...
 

Protected Attributes

bool m_bContinue
 Tells if the rendering process should continue after the current frame.
 
Ogre::Root * m_poRoot
 Ogre root.
 
Ogre::SceneManager * m_poSceneManager
 The scene manager used.
 
Ogre::RenderWindow * m_poWindow
 The render window used.
 
Ogre::Camera * m_poCamera
 The camera used.
 
Ogre::SceneNode * m_poCameraNode
 The camera node.
 
Ogre::String m_sResourcePath
 Path to the file resource.cfg for Ogre.
 
OIS::InputManager * m_poInputManager
 The OIS input manager.
 
OIS::Mouse * m_poMouse
 The mouse.
 
OIS::Keyboard * m_poKeyboard
 The keyboard.
 
CEGUI::OgreRenderer * m_rGUIRenderer
 The CEGUI renderer.
 
CEGUI::WindowManager * m_poGUIWindowManager
 The CEGUI window manager.
 
CEGUI::Window * m_poSheet
 The default sheet.
 
CAbstractVrpnPeripheralm_poVrpnPeripheral
 A VRPN peripheric, handles at most one Analog + one Button server.
 
double m_dClock
 Clock to impose a maximum frequency.
 

Detailed Description

Basic framework to design VR applications.

Author
Laurent Bonnet (INRIA/IRISA)
Date
2010-02-16

This class is based on Ogre3D, and should be derived to design a specific VR application. It handles the rendering engine setup and configuration. Developer has to initialise the right 3D scene, and give the loop code that will be called each time a frame is rendered.

Member Function Documentation

virtual bool setup ( void  )
protectedvirtual

Main Ogre and custom setup steps.

Returns
true if the setup is a success.
virtual bool configure ( void  )
protectedvirtual

Configuration management.

Returns
true if the configuration step is a success.
virtual bool initialise ( void  )
protectedpure virtual

Initialize the scene. This function has to be implemented with the specific Ogre code.

Returns
true if the initialization process is a success.
virtual bool process ( double  timeSinceLastProcess)
protectedpure virtual

Main loop. Developer has to implement this function with the specific behaviour of its a application.

Returns
true if the configuration step is a success.
bool frameEnded ( const Ogre::FrameEvent &  evt)
inlineprotected

Frame ended callback.

Returns
true if the rendering engine should continue.
virtual bool initOIS ( void  )
protectedvirtual

Initialize the OIS plugin.

Returns
true if the setup is a success.
bool mouseMoved ( const OIS::MouseEvent &  arg)
protected

Mouse moved callback, launched when the mouse is moved.

Returns
true if the rendering engine should continue.
bool mousePressed ( const OIS::MouseEvent &  arg,
OIS::MouseButtonID  id 
)
inlineprotected

Mouse pressed callback, launched when a mouse button is pressed.

Returns
true if the rendering engine should continue.
bool mouseReleased ( const OIS::MouseEvent &  arg,
OIS::MouseButtonID  id 
)
inlineprotected

Mouse released callback, launched when a mouse button is released.

Returns
true if the rendering engine should continue.

References COgreVRApplication::keyPressed(), and COgreVRApplication::keyReleased().

bool keyPressed ( const OIS::KeyEvent &  evt)
protected

Key pressed callback, launched when a key is pressed.

Returns
true if the rendering engine should continue.

Referenced by COgreVRApplication::mouseReleased().

bool keyReleased ( const OIS::KeyEvent &  evt)
protected

Key released callback, launched when a key is released.

Returns
true if the rendering engine should continue.

Referenced by COgreVRApplication::mouseReleased().

virtual bool initCEGUI ( const char *  logFileName)
protectedvirtual

Initialize the CEGUI plugin.

Returns
true if the setup is a success.