diff options
Diffstat (limited to 'modules/openxr/openxr_interface.h')
-rw-r--r-- | modules/openxr/openxr_interface.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/modules/openxr/openxr_interface.h b/modules/openxr/openxr_interface.h index a2cc2b27ff..51ef4ea228 100644 --- a/modules/openxr/openxr_interface.h +++ b/modules/openxr/openxr_interface.h @@ -33,6 +33,7 @@ #include "action_map/openxr_action_map.h" #include "extensions/openxr_fb_passthrough_extension_wrapper.h" +#include "extensions/openxr_hand_tracking_extension.h" #include "openxr_api.h" #include "servers/xr/xr_interface.h" @@ -55,6 +56,7 @@ private: Transform3D head_transform; Vector3 head_linear_velocity; Vector3 head_angular_velocity; + XRPose::TrackingConfidence head_confidence; Transform3D transform_for_view[2]; // We currently assume 2, but could be 4 for VARJO which we do not support yet void _load_action_map(); @@ -97,6 +99,8 @@ private: void _set_default_pos(Transform3D &p_transform, double p_world_scale, uint64_t p_eye); + void handle_hand_tracking(const String &p_path, OpenXRHandTrackingExtension::HandTrackedHands p_hand); + protected: static void _bind_methods(); @@ -107,6 +111,7 @@ public: virtual PackedStringArray get_suggested_tracker_names() const override; virtual TrackingStatus get_tracking_status() const override; + bool is_hand_tracking_supported(); bool is_eye_gaze_interaction_supported(); bool initialize_on_startup() const; @@ -218,6 +223,17 @@ public: HAND_JOINT_MAX = 26, }; + enum HandJointFlags { + HAND_JOINT_NONE = 0, + HAND_JOINT_ORIENTATION_VALID = 1, + HAND_JOINT_ORIENTATION_TRACKED = 2, + HAND_JOINT_POSITION_VALID = 4, + HAND_JOINT_POSITION_TRACKED = 8, + HAND_JOINT_LINEAR_VELOCITY_VALID = 16, + HAND_JOINT_ANGULAR_VELOCITY_VALID = 32, + }; + + BitField<HandJointFlags> get_hand_joint_flags(Hand p_hand, HandJoints p_joint) const; Quaternion get_hand_joint_rotation(Hand p_hand, HandJoints p_joint) const; Vector3 get_hand_joint_position(Hand p_hand, HandJoints p_joint) const; float get_hand_joint_radius(Hand p_hand, HandJoints p_joint) const; @@ -232,5 +248,6 @@ public: VARIANT_ENUM_CAST(OpenXRInterface::Hand) VARIANT_ENUM_CAST(OpenXRInterface::HandMotionRange) VARIANT_ENUM_CAST(OpenXRInterface::HandJoints) +VARIANT_BITFIELD_CAST(OpenXRInterface::HandJointFlags) #endif // OPENXR_INTERFACE_H |