API Documentation
Loading...
Searching...
No Matches
XRInputManager.h
Go to the documentation of this file.
1#pragma once
9#include <QObject>
10namespace NDEVR
11{
12 class XRHand;
13 class DistanceMeasureModel;
14 class PointMeasureModel;
15 /**--------------------------------------------------------------------------------------------------
16 \brief Translates input from the OpenXR interface into NDEVR API actions and events.
17 **/
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);
38 void updateHandLocation(const Matrix<fltp08>& global_transform, XrTime predictedDisplayTime, XrSpace app_space);
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 };
51 InputState m_input;
54 };
55}
Provides a modifiable pointer that has shared ownership of a dynamically allocated object.
Definition Pointer.hpp:320
Definition Matrix.hpp:176
A wrapper around DesignObjectLookup that provides signal and slot functionality and adds rendering ca...
Definition QTModelManager.h:105
A fixed-size array with better performance compared to dynamic containers.
Definition Vector.hpp:60
Translates input from the OpenXR interface into NDEVR API actions and events.
Definition XRInputManager.h:19
DynamicPointer< VulkanXRDevice > m_device
Definition XRInputManager.h:47
Vector< 2, DistanceMeasureModel * > m_distance_measure_models
Definition XRInputManager.h:52
XrSession xrSession() const
Definition XRInputManager.h:45
XrSystemId xrSystemID() const
Definition XRInputManager.h:44
void triggerAPulled(uint01 hand, fltp08 percent)
Vector< 2, XRHand * > m_hands
Definition XRInputManager.h:50
InputState m_input
Definition XRInputManager.h:51
void updateHandLocation(const Matrix< fltp08 > &global_transform, XrTime predictedDisplayTime, XrSpace app_space)
void triggerBPulled(uint01 hand, fltp08 percent)
Vector< 2, PointMeasureModel * > m_point_measure_models
Definition XRInputManager.h:53
XrInstance xrInstance() const
Definition XRInputManager.h:43
QTModelManager * m_manager
Definition XRInputManager.h:49
Vector< 2, Vector< 2, fltp04 > > getJoystickLocation()
XRInputManager(QTModelManager *manager, const DynamicPointer< VulkanXRDevice > &device, XrSession xr_session)
XrSession m_xr_session
Definition XRInputManager.h:48
Definition ACIColor.h:37
uint8_t uint01
-Defines an alias representing a 1 byte, unsigned integer -Can represent exact integer values 0 throu...
Definition BaseValues.hpp:80
double fltp08
Defines an alias representing an 8 byte floating-point number.
Definition BaseValues.hpp:149