NDEVR
API Documentation
XRInputManager.h
1#pragma once
2#include "NDEVR/Headers/QTModelManager.h"
3#include "NDEVR/Headers/WindowManager3D.h"
4#include "Design/Headers/CameraManager.h"
5#include "XRInterface/Headers/XRInstance.h"
6#include "XRInterface/Headers/XRErrorHandling.h"
7#include "XRInterface/Headers/XRVulkanPipeline.h"
8#include "XRInterface/Headers/XRCameraView.h"
9#include <QObject>
10namespace NDEVR
11{
12 class XRHand;
13 class DistanceMeasureModel;
14 class PointMeasureModel;
18 class XRInputManager
19 {
20 struct InputState {
21 XrActionSet actionSet{ XR_NULL_HANDLE };
22 XrAction triggerAAction{ XR_NULL_HANDLE };
23 XrAction triggerBAction{ XR_NULL_HANDLE };
24 XrAction poseAction{ XR_NULL_HANDLE };
25 XrAction joystickAction{ XR_NULL_HANDLE };
26 XrAction vibrateAction{ XR_NULL_HANDLE };
27 XrAction quitAction{ XR_NULL_HANDLE };
28 std::array<XrPath, XRSide::COUNT> handSubactionPath;
29 std::array<XrSpace, XRSide::COUNT> handSpace;
30 std::array<float, XRSide::COUNT> handScale = { {1.0f, 1.0f} };
31 std::array<XrBool32, XRSide::COUNT> handActive;
32 };
33 public:
34 XRInputManager(QTModelManager* manager, const DynamicPointer<VulkanXRDevice>& device, XrSession xr_session);
35 void initializeActions();
36 void initializeHands();
37 Vector<2, Vector<2, fltp04>> getJoystickLocation();
38 void updateHandLocation(const Matrix<fltp08>& global_transform, XrTime predictedDisplayTime, XrSpace app_space);
39 void pollActions();
40 protected:
41 void triggerAPulled(uint01 hand, fltp08 percent);
42 void triggerBPulled(uint01 hand, fltp08 percent);
43 XrInstance xrInstance() const { return m_device->xrInstance(); }
44 XrSystemId xrSystemID() const { return m_device->xrSystemID(); }
45 XrSession xrSession() const { return m_xr_session; }
46 protected:
48 XrSession m_xr_session{ XR_NULL_HANDLE };
49 QTModelManager* m_manager;
50 Vector<2, XRHand*> m_hands;
51 InputState m_input;
52 Vector<2, DistanceMeasureModel*> m_distance_measure_models;
53 Vector<2, PointMeasureModel*> m_point_measure_models;
54 };
55}
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:356
Templated logic for doing matrix multiplication.
Definition Matrix.hpp:182
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
A fixed-size array with N dimensions used as the basis for geometric and mathematical types.
Definition Vector.hpp:62
Support for a virtual hand, typically mirroring a user hand in the OpenXR space.
Definition XRHand.h:18
The primary namespace for the NDEVR SDK.
double fltp08
Defines an alias representing an 8 byte floating-point number.
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...