API Documentation
Loading...
Searching...
No Matches
XRManager.h
Go to the documentation of this file.
1#pragma once
9#include <QObject>
10namespace NDEVR
11{
12 class DistanceMeasureModel;
13 class PointMeasureModel;
14 class XRHand;
15 class XRInputManager;
16 /**--------------------------------------------------------------------------------------------------
17 \brief Manages the OpenXR engine at a high level.
18 **/
20 {
21 public:
23 void getAvialableBlendModes(XrViewConfigurationType type);
28 bool renderLayer(XrTime predictedDisplayTime, Buffer<XrCompositionLayerProjectionView>& projectionLayerViews, XrCompositionLayerProjection& layer);
29 bool isSessionRunning() const { return m_session_running; }
30 bool isSessionFocused() const { return m_session_state == XR_SESSION_STATE_FOCUSED; }
31 XrEnvironmentBlendMode environmentBlendMode() { return m_current_blend_mode; }
33 // Return event if one is available, otherwise return null.
34 const XrEventDataBaseHeader* tryReadNextEvent();
35 void pollEvents(bool* exitRenderLoop, bool* requestRestart);
36 void start();
37 void renderLoop();
38 void HandleSessionStateChangedEvent(const XrEventDataSessionStateChanged& stateChangedEvent, bool* exitRenderLoop, bool* requestRestart);
39 XrInstance xrInstance() const { return m_device->xrInstance(); }
40 XrSystemId xrSystemID() const { return m_device->xrSystemID(); }
41 XrSession xrSession() const { return m_xr_session; }
42 const XrBaseInStructure* graphicsBinding() const { return reinterpret_cast<const XrBaseInStructure*>(&m_device->graphicsBinding()); }
43 XrViewConfigurationType viewConfigType() const { return XR_VIEW_CONFIGURATION_TYPE_PRIMARY_STEREO; }
44 void setSessionEndFunction(std::function<void()> function) { m_session_end_function = function; }
46
48 private:
49
50 XRInputManager* m_input_manager;
51
53 GraphicsUpdater* m_updater = nullptr;
54 DynamicPointer<Camera> m_reference_camera;
55 Buffer<XRCameraView*> m_cameras;
56 QTModelManager* m_manager;
57 Thread* m_thread;
58 std::function<void()> m_session_end_function;
59
61 XrSpace m_appSpace{ XR_NULL_HANDLE };
62
63 Buffer<XrEnvironmentBlendMode> m_available_blend_modes;
64 XrEnvironmentBlendMode m_current_blend_mode;
65
66 XrSession m_xr_session{ XR_NULL_HANDLE };
67 // Application's current lifecycle state according to the runtime
68 XrSessionState m_session_state{ XR_SESSION_STATE_UNKNOWN };
69
70 //Buffer<XrSpace> m_visualizedSpaces;
71 XrEventDataBuffer m_event_data_buffer;
72
73
74 Buffer<XrViewConfigurationView> m_config_views;
75 Buffer<XRVulkanPipeline> m_pipelines;
76 Buffer<XrView> m_views;
77 fltp08 m_camera_speed;
78 Log* m_log = nullptr;
79 Time m_last_update_time;
80 bool m_session_running{ false };
81 };
82}
The equivelent of std::vector but with a bit more control. The basic array unit of the library.
Definition Buffer.hpp:56
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Responsible for updating resources or layouts of data in-between calls to render.
Definition GraphicsUpdater.h:49
Definition Matrix.hpp:176
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
A thread is a single sequence stream within the software.
Definition Thread.h:67
A vertex or point. A specific type of Vector used primarily for spacial location information.
Definition Vertex.hpp:48
Translates input from the OpenXR interface into NDEVR API actions and events.
Definition XRInputManager.h:19
Manages the OpenXR engine at a high level.
Definition XRManager.h:20
void setSessionEndFunction(std::function< void()> function)
Definition XRManager.h:44
bool isSessionRunning() const
Definition XRManager.h:29
XRManager(QTModelManager *manager)
XrSession xrSession() const
Definition XRManager.h:41
XrSystemId xrSystemID() const
Definition XRManager.h:40
void HandleSessionStateChangedEvent(const XrEventDataSessionStateChanged &stateChangedEvent, bool *exitRenderLoop, bool *requestRestart)
void InitializeSession()
XrEnvironmentBlendMode environmentBlendMode()
Definition XRManager.h:31
const XrEventDataBaseHeader * tryReadNextEvent()
XrInstance xrInstance() const
Definition XRManager.h:39
void getAvialableBlendModes(XrViewConfigurationType type)
Matrix< fltp08 > globalTransform() const
bool isSessionFocused() const
Definition XRManager.h:30
void pollEvents(bool *exitRenderLoop, bool *requestRestart)
bool renderLayer(XrTime predictedDisplayTime, Buffer< XrCompositionLayerProjectionView > &projectionLayerViews, XrCompositionLayerProjection &layer)
XrViewConfigurationType viewConfigType() const
Definition XRManager.h:43
const XrBaseInStructure * graphicsBinding() const
Definition XRManager.h:42
Definition ACIColor.h:37
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149
Defines for a given type (such as sint04, fltp08, UUID, etc) a maximum, minimum, and reserved 'invali...
Definition BaseValues.hpp:233