diff options
| author | David Snopek <dsnopek@gmail.com> | 2024-02-15 14:58:38 -0600 |
|---|---|---|
| committer | David Snopek <dsnopek@gmail.com> | 2024-02-23 15:30:10 -0600 |
| commit | 7fa8ccd1ed6d9c0b8e979d30e9af1d12dbf9ed48 (patch) | |
| tree | 4e7a045d86d01e023f41af43c06a6a17c04d0886 /modules/webxr/webxr_interface_js.h | |
| parent | 2fe8f07b6c1156803e860519f37c269e394c699e (diff) | |
| download | redot-engine-7fa8ccd1ed6d9c0b8e979d30e9af1d12dbf9ed48.tar.gz | |
WebXR: Add support for hand tracking
Diffstat (limited to 'modules/webxr/webxr_interface_js.h')
| -rw-r--r-- | modules/webxr/webxr_interface_js.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules/webxr/webxr_interface_js.h b/modules/webxr/webxr_interface_js.h index d85eb8cad7..fc5df3a59b 100644 --- a/modules/webxr/webxr_interface_js.h +++ b/modules/webxr/webxr_interface_js.h @@ -56,6 +56,7 @@ private: String optional_features; String requested_reference_space_types; String reference_space_type; + String enabled_features; Size2 render_targetsize; RBMap<unsigned int, RID> texture_cache; @@ -73,6 +74,10 @@ private: int touch_index = -1; } input_sources[input_source_count]; + static const int WEBXR_HAND_JOINT_MAX = 25; + static const int HAND_MAX = 2; + Ref<XRHandTracker> hand_trackers[HAND_MAX]; + RID color_texture; RID depth_texture; @@ -94,8 +99,8 @@ public: virtual String get_optional_features() const override; virtual void set_requested_reference_space_types(String p_requested_reference_space_types) override; virtual String get_requested_reference_space_types() const override; - void _set_reference_space_type(String p_reference_space_type); virtual String get_reference_space_type() const override; + virtual String get_enabled_features() const override; virtual bool is_input_source_active(int p_input_source_id) const override; virtual Ref<XRPositionalTracker> get_input_source_tracker(int p_input_source_id) const override; virtual TargetRayMode get_input_source_target_ray_mode(int p_input_source_id) const override; @@ -129,6 +134,9 @@ public: void _on_input_event(int p_event_type, int p_input_source_id); + inline void _set_reference_space_type(String p_reference_space_type) { reference_space_type = p_reference_space_type; } + inline void _set_enabled_features(String p_enabled_features) { enabled_features = p_enabled_features; } + WebXRInterfaceJS(); ~WebXRInterfaceJS(); |
