VR-Forces Developer's Guide
 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) 2022 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 DtSwapChain* allocateSwapChain(vrvVirtualReality::DtEye whichEye, bool isOverlay);
84 
86  virtual void getProjectionAngles(vrvVirtualReality::DtEye eye, double& left, double& right, double& bottom, double& top, double znear, double zfar);
87 
89  virtual osg::Matrixd getEyeToHeadTransform(vrvVirtualReality::DtEye eye);
90 
92  virtual void commitEyeTexture(osg::RenderInfo& renderInfo, DtSwapChain* swapChain);
93 
95  virtual void commitHudTexture(osg::RenderInfo& renderInfo, DtSwapChain* swapChain);
96 
98  virtual void updateOverlayDimensions(float width, float height, float distance, int pixWidth, int pixHeight);
99 
101  virtual void tick();
102 
104  virtual void beginFrame();
105 
107  virtual void beginRendering();
108 
110  virtual void endRendering();
111 
113  virtual bool getHmdPose(DtVector& pos, DtQuat& ori);
114 
116  virtual void setHmdPoseOffset(const DtVector& pos, const DtQuat& ori);
117 
119  virtual bool getTrackedPose(DtVector& pos, DtQuat& ori, int index);
120 
122  virtual bool reset();
123 
125  virtual bool shutdown();
126 
128  virtual bool hasTrackedCamera();
129 
131  virtual DtTrackedCamera* findTrackedCamera();
132 
134  virtual DtMixedRealityMask* findMixedRealityMask();
135 
137  virtual bool supportsDepthBufferSubmission();
138 
140  virtual vrvVirtualReality::DtVrOverlayMode overlayMode();
141 
143 
145  ovrSession findOculusSystem() const;
146 
148  ovrTrackingState getTrackingState();
149 
151  ovrInputState getInputState();
152 
154  void setHudOffset(const ovrPosef& pose);
155 
157  void setOverlayEnabled(bool enabled);
158 
160  void eyeCreated();
161 
162  protected:
163  void errorAndStop();
164 
165  //Oculus Structs
166  ovrSession mySession;
167  ovrHmdDesc myHmdDesc;
168  ovrEyeRenderDesc myEyeRenderDesc[2];
169 
170  int myWidth;
171  int myHeight;
172  long long myFrameIndex;
175 
177 
178  ovrLayerHeader* myLayers[2];
179  ovrLayerEyeFovDepth myViewLayer;
180  ovrLayerQuad myHudLayer;
181 
182  std::string myDeviceName;
183  };
184 }
ovrHmdDesc myHmdDesc
Definition: DtOculusProvider.h:167
int myEyesCreated
Definition: DtOculusProvider.h:174
long long myFrameIndex
Definition: DtOculusProvider.h:172
bool myFrameBegan
Definition: DtOculusProvider.h:173
Contains DLL export macros.
int myHeight
Definition: DtOculusProvider.h:171
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:179
bool myHudEnabled
Definition: DtOculusProvider.h:176
A driver that manages virtual reality HMD and input devices.
Definition: DtVirtualRealityDriver.h:54
#define DT_DLL_VRVVR
Definition: vrvVirtualReality.h:19
std::string myDeviceName
Definition: DtOculusProvider.h:182
DtEye
A virtual reality eye.
Definition: vrvVirtualReality.h:37
int myWidth
Definition: DtOculusProvider.h:170
ovrLayerQuad myHudLayer
Definition: DtOculusProvider.h:180
DT_DLL_VRVCORE double distance(const makVrv::DtCoordinateSystem &, const DtVector &from, const DtVector &to)
Returns the distance from the two points. Coordinates are in local database coordinates The coordinat...
Base implementation of a texture swapchain.
Definition: DtSwapChain.h:37
An Oculus implementation of the DtVirtualRealityProvider abstract base class.
Definition: DtOculusProvider.h:30
An abstract interface that provides VR System API services. Providers are created and provided to the...
Definition: DtVirtualRealityProvider.h:47
Contains makVrv::DtQuat class.
DtVrOverlayMode
Virtual reality render mode.
Definition: vrvVirtualReality.h:63
A VRV channel that represents the eyes of the HMD A Virtual Reality channel can render in a few diffe...
Definition: DtVirtualRealityChannel.h:30
Object to handle rendering a mixed reality mask object into the scene. Typically the it renders an ob...
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:32
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:72
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:30
ovrSession mySession
Definition: DtOculusProvider.h:166

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)