8 #ifndef META_OCEAN_PLATFORM_META_QUEST_OPENXR_HAND_POSES_H
9 #define META_OCEAN_PLATFORM_META_QUEST_OPENXR_HAND_POSES_H
18 #include <openxr/openxr.h>
40 class OCEAN_PLATFORM_META_QUEST_OPENXR_EXPORT
HandPoses
50 static constexpr
size_t numberHands_ = 2;
53 static constexpr
size_t leftHandIndex_ = 0;
56 static constexpr
size_t rightHandIndex_ = 1;
61 class OCEAN_PLATFORM_META_QUEST_OPENXR_EXPORT
Mesh
70 typedef std::vector<float>
Radii;
114 template <
typename T = Scalar>
121 inline bool isValid()
const;
136 bool initialize(
const XrHandTrackerEXT& xrHandTrackerEXT,
const PFN_xrGetHandMeshFB& xrGetHandMeshFB);
141 XrHandTrackingMeshFB xrHandTrackingMeshFB_ = {XR_TYPE_HAND_TRACKING_MESH_FB};
171 bool isValid_ =
false;
177 class OCEAN_PLATFORM_META_QUEST_OPENXR_EXPORT
Pose
184 static constexpr XrSpaceLocationFlags defaultLocationFlags_ = XR_SPACE_LOCATION_ORIENTATION_VALID_BIT | XR_SPACE_LOCATION_POSITION_VALID_BIT;
195 template <
typename T = Scalar>
206 template <
typename T = Scalar>
218 template <
typename T = Scalar>
230 template <
typename T = Scalar>
231 bool meshVertices(
const Mesh& mesh,
VectorsT3<T>& baseSpaceMeshVertices,
const XrSpaceLocationFlags xrSpaceLocationFlags = defaultLocationFlags_)
const;
237 inline XrSpace xrBaseSpace()
const;
243 inline const XrHandJointLocationEXT* xrHandJointLocationsEXT()
const;
249 inline const XrHandJointVelocityEXT* xrHandJointVelocitiesEXT()
const;
255 inline bool isValid()
const;
267 XrSpace xrBaseSpace_ = XR_NULL_HANDLE;
270 XrHandJointLocationEXT xrHandJointLocationsEXT_[XR_HAND_JOINT_COUNT_EXT];
273 XrHandJointVelocityEXT xrHandJointVelocitiesEXT_[XR_HAND_JOINT_COUNT_EXT];
303 bool initialize(
const XrInstance& xrInstance,
const XrSession& xrSession,
const XrSystemId& xrSystemId);
317 bool update(
const XrSpace& xrBaseSpace,
const XrTime& predictedDisplayTime);
326 inline const Mesh& mesh(
const size_t handIndex)
const;
336 inline const Pose& pose(
const size_t handIndex)
const;
350 inline Lock& lock()
const;
356 inline bool isValid()
const;
380 static bool updateHandPose(
const XrHandTrackerEXT& xrHandTrackersEXT,
const PFN_xrLocateHandJointsEXT xrLocateHandJointsEXT,
const XrSpace& xrBaseSpace,
const XrTime& xrTime,
Pose& pose);
398 XrInstance xrInstance_ = XR_NULL_HANDLE;
401 PFN_xrCreateHandTrackerEXT xrCreateHandTrackerEXT_ =
nullptr;
404 PFN_xrDestroyHandTrackerEXT xrDestroyHandTrackerEXT_ =
nullptr;
407 PFN_xrLocateHandJointsEXT xrLocateHandJointsEXT_ =
nullptr;
410 PFN_xrGetHandMeshFB xrGetHandMeshFB_ =
nullptr;
413 XrHandTrackerEXT xrHandTrackersEXT_[numberHands_] = {XR_NULL_HANDLE, XR_NULL_HANDLE};
422 mutable Vectors3 baseSpaceJointPositions_[numberHands_];
438 return vertexBlendWeights_;
458 return xrHandJointLocationsEXT_;
463 return xrHandJointVelocitiesEXT_;
468 return xrBaseSpace_ != XR_NULL_HANDLE;
473 ocean_assert(session.
isValid());
This class implements a recursive lock object.
Definition: Lock.h:31
This class implements a scoped lock object for recursive lock objects.
Definition: Lock.h:135
std::vector< HomogenousMatrixT4< T > > HomogenousMatricesT4
Definition of a typename alias for vectors with HomogenousMatrixT4 objects.
Definition: HomogenousMatrix4.h:66
std::vector< VectorT3< T > > VectorsT3
Definition of a typename alias for vectors with VectorT3 objects.
Definition: Vector3.h:58
std::vector< Vector3 > Vectors3
Definition of a vector holding Vector3 objects.
Definition: Vector3.h:65
The namespace covering the entire Ocean framework.
Definition: Accessor.h:15