VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtVirtualRealityProvider.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2024 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
13 
14 #include <vrvUtil/DtQuat.h>
15 #include <matrix/vlVector.h>
16 
18 
19 #include <osg/Matrixd>
20 #include <osg/Group>
21 
22 #include <string>
23 #include <unordered_map>
24 
25 namespace osg
26 {
27  class Texture2D;
28 }
29 
30 namespace makVrv
31 {
32  class DtDe;
33  class DtVirtualRealityPostProcessor;
34  class DtVirtualRealityDriver;
35  class DtSubmitOverlayCallback;
36  class DtSubmitViewCallback;
37  class DtBeginRenderingCallback;
38  class DtTrackedCamera;
39  class DtVariableRateShadingImageUpdater;
40  class DtVirtualRealityChannel;
41  class DtSwapChain;
42 
48  {
49  private:
52 
54  DtVirtualRealityProvider& operator=(const DtVirtualRealityProvider& other);
55 
56  public:
59 
61  virtual ~DtVirtualRealityProvider();
62 
64  virtual DtSubmitOverlayCallback* createOverlayCallback(osg::Texture* tex, DtDe& de, DtVirtualRealityDriver& driver) = 0;
65 
68 
70  virtual DtBeginRenderingCallback* createBeginRenderingCallback(DtVirtualRealityDriver& driver, vrvVirtualReality::DtEye eye);
71 
73  virtual const std::string& providerName() = 0;
74 
76  virtual const std::string& deviceName() = 0;
77 
79  virtual bool initializeVR() = 0;
80 
82  virtual bool hasFocusViews() = 0;
83 
85  virtual bool useVrs() = 0;
86 
88  virtual DtVariableRateShadingImageUpdater* findVrsUpdater(DtVirtualRealityChannel* channel) = 0;
89 
91  virtual void getRecommendedRenderTargetSize(int& width, int& height, vrvVirtualReality::DtEye whichEye) = 0;
92 
94  virtual DtSwapChain* allocateSwapChain(vrvVirtualReality::DtEye whichEye, bool isOverlay) = 0;
95 
97  virtual void getProjectionAngles(vrvVirtualReality::DtEye eye, double& left, double& right, double& bottom, double& top, double znear, double zfar) = 0;
98 
100  virtual osg::Matrixd getEyeToHeadTransform(vrvVirtualReality::DtEye eye) = 0;
101 
103  virtual void commitEyeTexture(osg::RenderInfo& renderInfo, DtSwapChain* swapChain) = 0;
104 
106  virtual void commitHudTexture(osg::RenderInfo& renderInfo, DtSwapChain* swapChain) = 0;
107 
109  virtual void updateOverlayDimensions(float width, float height, float distance, int pixWidth, int pixHeight) = 0;
110 
112  virtual void tick() = 0;
113 
115  virtual void beginFrame() = 0;
116 
118  virtual void beginRendering() = 0;
119 
121  virtual void endRendering() = 0;
122 
124  virtual bool getHmdPose(DtVector& pos, DtQuat& ori) = 0;
125 
127  virtual void setHmdPoseOffset(const DtVector& pos, const DtQuat& ori) = 0;
128 
130  virtual bool getTrackedPose(DtVector& pos, DtQuat& ori, int index) = 0;
131 
133  virtual bool reset() = 0;
134 
136  virtual void triggerAction1();
137 
139  virtual bool shutdown() = 0;
140 
142  virtual bool hasTrackedCamera() = 0;
143 
145  virtual DtTrackedCamera* findTrackedCamera() = 0;
146 
149  virtual DtMixedRealityMask* findMixedRealityMask() = 0;
150 
152  virtual bool mixedRealityRunning() const;
153 
155  virtual void startMixedReality();
156 
158  virtual void stopMixedReality();
159 
161  virtual bool supportsMixedReality();
162 
164  virtual bool supportsDepthBufferSubmission();
165 
167  virtual bool supportsRealWorldDepthTesting();
168 
170  virtual bool realWorldDepthTestingEnabled() const;
171 
173  virtual void startRealWorldDepthTesting();
174 
176  virtual void stopRealWorldDepthTesting();
177 
179  virtual vrvVirtualReality::DtVrOverlayMode overlayMode();
180 
181  protected:
184 
189 
191  std::map<DtVirtualRealityChannel*, osg::ref_ptr<DtVariableRateShadingImageUpdater> > myChannelVrsUpdaters;
192  };
193 }
bool myRealWorldDepthTestingEnabled
Definition: DtVirtualRealityProvider.h:188
Contains DLL export macros.
bool myMixedRealityRunning
Definition: DtVirtualRealityProvider.h:187
DtVirtualRealityDriver * myDriverHandle
Definition: DtVirtualRealityProvider.h:183
Object used for mixed reality masking. Handles installing object into scene and syncing position with...
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
A driver that manages virtual reality HMD and input devices.
Definition: DtVirtualRealityDriver.h:54
#define DT_DLL_VRVVR
Definition: vrvVirtualReality.h:19
DtEye
A virtual reality eye.
Definition: vrvVirtualReality.h:37
std::map< DtVirtualRealityChannel *, osg::ref_ptr< DtVariableRateShadingImageUpdater > > myChannelVrsUpdaters
out vrs updater
Definition: DtVirtualRealityProvider.h:191
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
DtMixedRealityMask * myMixedRealityMask
Definition: DtVirtualRealityProvider.h:186
An abstract interface that provides VR System API services. Providers are created and provided to the...
Definition: DtVirtualRealityProvider.h:47
Contains makVrv::DtQuat class.
DtTrackedCamera * myTrackedCamera
Definition: DtVirtualRealityProvider.h:185
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
DtDe & myDe
Definition: DtVirtualRealityProvider.h:182
An OSG camera callback that will submit the channel to the underlying VR system as an overlay channel...
Definition: DtSubmitOverlayCallback.h:32
An OSG camera predraw callback, can be used as a sync point.
Definition: DtBeginRenderingCallback.h:23
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:76
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

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)