diff options
Diffstat (limited to 'modules/openxr/extensions/openxr_eye_gaze_interaction.cpp')
-rw-r--r-- | modules/openxr/extensions/openxr_eye_gaze_interaction.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp b/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp index 59bdec5c8e..477a1c2609 100644 --- a/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp +++ b/modules/openxr/extensions/openxr_eye_gaze_interaction.cpp @@ -30,6 +30,7 @@ #include "openxr_eye_gaze_interaction.h" +#include "core/config/project_settings.h" #include "core/os/os.h" #include "../action_map/openxr_interaction_profile_metadata.h" @@ -52,7 +53,11 @@ OpenXREyeGazeInteractionExtension::~OpenXREyeGazeInteractionExtension() { HashMap<String, bool *> OpenXREyeGazeInteractionExtension::get_requested_extensions() { HashMap<String, bool *> request_extensions; - request_extensions[XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME] = &available; + // Only enable this extension when requested. + // We still register our meta data or the action map editor will fail. + if (GLOBAL_GET("xr/openxr/extensions/eye_gaze_interaction") && (!OS::get_singleton()->has_feature("mobile") || OS::get_singleton()->has_feature(XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME))) { + request_extensions[XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME] = &available; + } return request_extensions; } @@ -69,6 +74,11 @@ void *OpenXREyeGazeInteractionExtension::set_system_properties_and_get_next_poin return &properties; } +PackedStringArray OpenXREyeGazeInteractionExtension::get_suggested_tracker_names() { + PackedStringArray arr = { "/user/eyes_ext" }; + return arr; +} + bool OpenXREyeGazeInteractionExtension::is_available() { return available; } |