VR-Forces 4.7 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVirtualRealityDriver.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2018 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #include <vrvCore/DtDriver.h>
16 #include <vrvCore/DtDe.h>
17 #include <vrvCore/DtAgentManager.h>
18 
20 #include <vrvUtil/DtQuat.h>
21 
22 #include <matrix/vlVector.h>
23 
24 #include <osg/ref_ptr>
25 #include <osg/Texture2D>
26 #include <osg/Camera>
27 
28 #include <boost/signal.hpp>
29 
30 #include <list>
31 
32 namespace vr
33 {
34  class IVRSystem;
35  struct TrackedDevicePose_t;
36 }
37 
38 namespace osg
39 {
40  class RenderInfo;
41 }
42 
43 namespace makVrv
44 {
45  class DtObserver;
46  class DtOsgChannel;
47  class DtWindow;
48  class DtSubmitOverlayCallback;
49 
52  {
53  private:
56 
59 
62 
63  public:
64  enum DtEye {Left, Right};
65 
68 
70  virtual ~DtVirtualRealityDriver();
71 
73  virtual const std::string& className() const;
74 
77  virtual bool onStart();
78 
80  virtual bool onStop();
81 
83  virtual bool onTick();
84 
87  static bool isVrAvailable();
88 
90  virtual void resetHmd();
91 
94  virtual void setMirroring(makArchives::DtVirtualRealitySettingsRecord::DtMirroring val);
95 
98 
101  virtual void setMirrorChannel(std::string val);
102 
106  virtual osg::Texture2D* findMirrorTexture() const;
107 
110  virtual void setMirrorTexture(makArchives::DtVirtualRealitySettingsRecord::DtMirroring eye, osg::Texture2D* tex);
111 
114  virtual DtSubmitOverlayCallback* findOverlayCallback();
115 
118  virtual bool getHmdPose(DtVector& pos, DtQuat& ori) const;
119 
121  virtual DtOsgChannel* findEyeChannel(DtEye whichEye);
122 
125  virtual DtObserver* findHmdObserver() const;
126 
129  virtual void setObserverForHmd(const std::string& obsName);
130 
132  virtual vr::IVRSystem* findVrSystem() const;
133 
136  boost::signal<void()> signal_postTick;
137 
139  boost::signal<void()> signal_reset;
140 
141  protected:
144  virtual void createHmdWindow(DtDisplayConfiguration* prototypeConfig);
145 
148  virtual makVrv::DtOsgChannel* createEyeChannel(int eye, DtDisplayConfiguration* prototypeConfig);
149 
151  virtual void initializeOverlay(DtOsgChannel* channel);
152 
154  virtual void uninstallOverlay(DtOsgChannel* channel);
155 
158  void installResetKeyMap();
159 
161  virtual void handleEnabledChanged(bool val);
162 
164  virtual void handleObserverLost(DtObserver* obs);
165 
167  virtual void updateMirroring(makArchives::DtVirtualRealitySettingsRecord::DtMirroring mirrorType, std::string channelName);
168 
171  virtual bool getPose(osg::Vec3d& position, osg::Quat& orienation, int index) const;
172 
174  virtual void updatePoseInformation();
175 
177 
178  //OpenVR Structs
179  vr::IVRSystem* myVrSystem;
180  vr::TrackedDevicePose_t* myTrackedPoses;
181 
182  //HMD observer, offscreen window and eye channels
187 
188  //main 2d overlay
189  osg::ref_ptr<osg::Texture2D> myOverlayTexture;
190  osg::ref_ptr<osg::Texture2D> myOverlayDepthTexture;
191  osg::ref_ptr<DtSubmitOverlayCallback> myOverlaySubmitCallback;
192 
193  //mirroring structs
195  std::string myMirrorChannelName;
197  osg::ref_ptr<osg::Texture2D> myMirrorTexture;
199 
201  };
202 
203 }

Document ID: Generated on Fri Apr 26 21:53:14 EDT 2019 from SVN revision 197883
Copyright © 2005-2019 VT MAK. All Rights Reserved (www.mak.com)