48 void updatePoses(XrTime predictedDisplayTime, XrSpace appSpace);
49 void updateHandtracking(XrTime predictedDisplayTime, XrSpace appSpace,
bool aimExtensionEnabled);
72 XrHandTrackerEXT
handTracker[2] = {XR_NULL_HANDLE, XR_NULL_HANDLE};
81 void setupHandTracking();
82 bool queryHandMesh(
Hand hand);
84 void destroyActions();
85 bool checkXrResult(
const XrResult &
result,
const char *debugText =
nullptr);
88 void createAction(XrActionType
type,
90 const char *localizedName,
92 XrPath *subactionPath,
94 void getBoolInputState(XrActionStateGetInfo &getInfo,
const XrAction &action, std::function<
void(
bool)> setter);
95 void getFloatInputState(XrActionStateGetInfo &getInfo,
const XrAction &action, std::function<
void(
float)> setter);
97 XrInstance m_instance{XR_NULL_HANDLE};
98 XrSession m_session{XR_NULL_HANDLE};
100 enum SubPathSelector {NoSubPath = 0, LeftHandSubPath = 1, RightHandSubPath = 2, BothHandsSubPath = 3};
102 struct QXRHandComponentPath
104 XrPath
paths[2] = {{}, {}};
110 struct InputActionInfo {
112 const char *shortName;
113 const char *localizedName;
117 QList<InputActionInfo> m_handInputActionDefs;
118 QList<InputActionInfo> m_gamepadInputActionDefs;
121 XrAction gripPoseAction{XR_NULL_HANDLE};
122 XrAction aimPoseAction{XR_NULL_HANDLE};
123 XrAction hapticAction{XR_NULL_HANDLE};
126 struct GamepadActions {
127 XrAction hapticLeftAction{XR_NULL_HANDLE};
128 XrAction hapticRightAction{XR_NULL_HANDLE};
129 XrAction hapticLeftTriggerAction{XR_NULL_HANDLE};
130 XrAction hapticRightTriggerAction{XR_NULL_HANDLE};
134 XrActionSet m_actionSet{XR_NULL_HANDLE};
135 XrPath m_handSubactionPath[2];
136 XrSpace m_handGripSpace[2];
137 XrSpace m_handAimSpace[2];
142 XrPath m_gamepadSubactionPath;
143 HandActions m_handActions;
144 GamepadActions m_gamepadActions;
147 uint m_aimStateFlags[2] = {};
148 bool m_initialized =
false;
149 bool m_disableGamepad =
false;
150 bool m_validAimStateFromUpdatePoses[2] = {
false,
false};
153 struct HandMeshData {
154 QVector<XrVector3f> vertexPositions;
155 QVector<XrVector3f> vertexNormals;
156 QVector<XrVector2f> vertexUVs;
157 QVector<XrVector4sFB> vertexBlendIndices;
158 QVector<XrVector4f> vertexBlendWeights;
160 XrPosef jointBindPoses[XR_HAND_JOINT_COUNT_EXT];
161 XrHandJointEXT jointParents[XR_HAND_JOINT_COUNT_EXT];
162 float jointRadii[XR_HAND_JOINT_COUNT_EXT];
166 struct HandGeometryData {
168 } m_handGeometryData[2];
171 void createHandModelData(
Hand hand);