ogre_oculus.h
Go to the documentation of this file.
00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
00012 
00013 
00014 #pragma once
00015 
00016 #include "OGRE/OgreQuaternion.h"
00017 #include "OGRE/OgreVector3.h"
00018 
00019 #include <string>
00020 
00021 namespace OVR
00022 {
00023 class HMDDevice;
00024 class SensorFusion;
00025 class DeviceManager;
00026 class SensorDevice;
00027 
00028 namespace Util
00029 {
00030 class MagCalibration;
00031 namespace Render
00032 {
00033 class StereoConfig;
00034 }
00035 }
00036 }
00037 
00038 namespace Ogre
00039 {
00040 class SceneManager;
00041 class RenderWindow;
00042 class Camera;
00043 class SceneNode;
00044 class Viewport;
00045 class CompositorInstance;
00046 }
00047 
00048 namespace oculus_rviz_plugins
00049 {
00050 
00051 class Oculus
00052 {
00053 public:
00054   Oculus(void);
00055   ~Oculus(void);
00056   bool setupOculus();
00057   bool setupOgre(Ogre::SceneManager *sm, Ogre::RenderWindow *win, Ogre::SceneNode *parent = 0);
00058   void shutDownOculus();
00059   void shutDownOgre();
00060   bool isOgreReady() const;
00061   bool isOculusReady() const;
00062 
00064   void update();
00065 
00067   void resetOrientation();
00068 
00070   Ogre::SceneNode *getCameraNode();
00071 
00073   Ogre::Quaternion getOrientation() const;
00074 
00076   Ogre::CompositorInstance *getCompositor(unsigned int i);
00077 
00079   Ogre::Camera *getCamera(unsigned int i)
00080   {
00081     return m_cameras[i % 2];
00082   }
00083 
00085   Ogre::Viewport *getViewport(unsigned int i)
00086   {
00087     return m_viewports[i % 2];
00088   }
00089 
00091   float getCentreOffset() const;
00092 
00093   const OVR::HMDDevice *getHMDDevice()
00094   {
00095     return m_hmd;
00096   }
00097 
00099   void updateProjectionMatrices();
00100 
00102   void setPredictionDt(float dt);
00103 
00105   bool isMagCalibrated();
00106 
00107 protected:
00108   OVR::DeviceManager *m_deviceManager;
00109   OVR::HMDDevice *m_hmd;
00110   OVR::Util::Render::StereoConfig *m_stereoConfig;
00111   OVR::Util::MagCalibration *m_magCalibration;
00112   OVR::SensorDevice *m_sensor;
00113   OVR::SensorFusion *m_sensorFusion;
00114   bool m_oculusReady; 
00115   bool m_ogreReady; 
00116   Ogre::SceneManager *m_sceneManager;
00117   Ogre::RenderWindow *m_window;
00118   Ogre::SceneNode *m_cameraNode;
00119   Ogre::Quaternion m_orientation;
00120   float m_centreOffset; 
00121   Ogre::Camera *m_cameras[2];
00122   Ogre::Viewport *m_viewports[2];
00123   Ogre::CompositorInstance *m_compositors[2];
00124 };
00125 
00126 }


oculus_rviz_plugins
Author(s): David Gossow
autogenerated on Mon Oct 6 2014 03:00:55