VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtOculusProvider.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
14 
15 #include <vrvUtil/DtQuat.h>
16 #include <matrix/vlVector.h>
17 
18 #include <osg/Matrixd>
19 
20 #include <string>
21 
22 #include "OVR_CAPI.h"
23 
24 
25 namespace makVrv
26 {
29 
31  {
32  private:
35 
38 
40  DtOculusProvider& operator=(const DtOculusProvider&);
41 
42  public:
45  static bool isVrAvailable();
46 
47 
48  public:
51 
53  virtual ~DtOculusProvider();
54 
56  virtual DtSubmitOverlayCallback* createOverlayCallback(osg::Texture* tex, DtDe& de, DtVirtualRealityDriver& driver);
57 
60 
62  virtual const std::string& providerName();
63 
65  virtual const std::string& deviceName();
66 
68  virtual bool initializeVR();
69 
71  virtual bool hasFocusViews();
72 
74  virtual bool useVrs();
75 
77  virtual DtVariableRateShadingImageUpdater* findVrsUpdater(DtVirtualRealityChannel* channel);
78 
80  virtual void getRecommendedRenderTargetSize(int& width, int& height, vrvVirtualReality::DtEye whichEye);
81 
83  virtual void getProjectionAngles(vrvVirtualReality::DtEye eye, double& left, double& right, double& bottom, double& top, double znear, double zfar);
84 
86  virtual osg::Matrixd getEyeToHeadTransform(vrvVirtualReality::DtEye eye);
87 
89  virtual void tick();
90 
92  virtual bool getHmdPose(DtVector& pos, DtQuat& ori);
93 
95  virtual void setHmdPoseOffset(const DtVector& pos, const DtQuat& ori);
96 
98  virtual bool getTrackedPose(DtVector& pos, DtQuat& ori, int index);
99 
101  virtual bool reset();
102 
104  virtual bool shutdown();
105 
107  virtual bool hasTrackedCamera();
108 
110  virtual DtTrackedCamera* findTrackedCamera();
111 
113  virtual DtMixedRealityMask* findMixedRealityMask();
114 
116  virtual bool supportsDepthBufferSubmission();
117 
119 
121  ovrSession findOculusSystem() const;
122 
124  ovrTrackingState getTrackingState();
125 
127  ovrInputState getInputState();
128 
130  void setHudOffset(const ovrPosef& pose);
131 
133  void setOverlayEnabled(bool enabled);
134 
136  void commitEyeTexture(vrvVirtualReality::DtEye eye, ovrTextureSwapChain swapChain, ovrTextureSwapChain depthSwapChain);
137 
139  void commitHudTexture(ovrTextureSwapChain swapChain);
140 
142  void eyeCreated();
143 
144  protected:
145  void beginFrame();
146  void beginRendering();
147  void endRendering();
148  void errorAndStop();
149 
150  //Oculus Structs
151  ovrSession mySession;
152  ovrHmdDesc myHmdDesc;
153  ovrEyeRenderDesc myEyeRenderDesc[2];
154 
155  int myWidth;
156  int myHeight;
157  long long myFrameIndex;
160 
162 
163  ovrLayerHeader* myLayers[2];
164  ovrLayerEyeFovDepth myViewLayer;
165  ovrLayerQuad myHudLayer;
166 
167  std::string myDeviceName;
168 
171  };
172 }
ovrHmdDesc myHmdDesc
Definition: DtOculusProvider.h:152
Diagonal crossing liens.
Definition: DtTacticalGraphicUtilities.h:93
int myEyesCreated
Definition: DtOculusProvider.h:159
long long myFrameIndex
Definition: DtOculusProvider.h:157
bool myFrameBegan
Definition: DtOculusProvider.h:158
Contains DLL export macros.
DtVirtualRealityDriver * myDriverHandle
store a handle to the driver to avoid repeated lookup
Definition: DtOculusProvider.h:170
int myHeight
Definition: DtOculusProvider.h:156
An abstract interface that provides VR System API services.
A Tracked camera is typically attached to the HMD and can provide position and orientation data in ad...
Definition: DtTrackedCamera.h:27
Base class for GPU updates of the variable rate shading image Draw a full screen quad using a shader ...
Definition: DtVariableRateShadingImageUpdater.h:26
ovrLayerEyeFovDepth myViewLayer
Definition: DtOculusProvider.h:164
bool myHudEnabled
Definition: DtOculusProvider.h:161
A driver that manages virtual reality HMD and input devices.
Definition: DtVirtualRealityDriver.h:51
#define DT_DLL_VRVVR
Definition: vrvVirtualReality.h:19
std::string myDeviceName
Definition: DtOculusProvider.h:167
DtEye
A virtual reality eye.
Definition: vrvVirtualReality.h:38
int myWidth
Definition: DtOculusProvider.h:155
ovrLayerQuad myHudLayer
Definition: DtOculusProvider.h:165
An Oculus implementation of the DtVirtualRealityProvider abstract base class.
Definition: DtOculusProvider.h:30
An abstract interface that provides VR System API services.
Definition: DtVirtualRealityProvider.h:45
Contains makVrv::DtQuat class.
A VRV channel that represents the eyes of the HMD A Virtual Reality channel can render in a few diffe...
Definition: DtVirtualRealityChannel.h:29
Object to handle rendering a mixed reality mask object into the scene.
Definition: DtMixedRealityMask.h:38
An OSG camera callback that will submit the channel to the underlying VR system as an overlay channel...
Definition: DtSubmitOverlayCallback.h:26
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
A utility Quaternion class.
Definition: DtQuat.h:19
A post processing effect responsible for submitting and mirroring the eye views to the VR subsystem...
Definition: DtVirtualRealityPostProcessor.h:34
An OSG camera callback that will submit the channel to the underlying VR system as an overlay channel...
Definition: DtSubmitViewCallback.h:29
ovrSession mySession
Definition: DtOculusProvider.h:151

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)