passthru EXT_eye_gaze_interaction

This commit is contained in:
galister authored and xytovl committed 2024-08-01 12:08:05 +02:00
1 parent 4cfdc4fa24
commit f0ca7ff8da
11 files changed
+78 -7

No files matched your search

+16
View File
@@ -250,6 +250,12 @@ static std::vector<interaction_profile> interaction_profiles{
"/user/hand/right/input/thumbstick/touch",
"/user/hand/right/input/thumbrest/touch",
}},
interaction_profile{
"/interaction_profiles/ext/eye_gaze_interaction",
{"XR_EXT_eye_gaze_interaction"},
{
"/user/eyes_ext/input/gaze_ext/pose",
}},
};
static const std::pair<std::string_view, XrActionType> action_suffixes[] =
@@ -648,6 +654,8 @@ void application::initialize_actions()
right_grip_space = xr_session.create_action_space(a);
else if (name == "/user/hand/right/input/aim/pose")
right_aim_space = xr_session.create_action_space(a);
else if (name == "/user/eyes_ext/input/gaze_ext/pose")
eye_gaze_space = xr_session.create_action_space(a);
}
// Build an action set for each scene
@@ -727,6 +735,7 @@ void application::initialize()
std::vector<std::string> opt_extensions;
opt_extensions.push_back(XR_FB_DISPLAY_REFRESH_RATE_EXTENSION_NAME);
opt_extensions.push_back(XR_EXT_HAND_TRACKING_EXTENSION_NAME);
opt_extensions.push_back(XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME);
opt_extensions.push_back(XR_FB_PASSTHROUGH_EXTENSION_NAME);
opt_extensions.push_back(XR_HTC_PASSTHROUGH_EXTENSION_NAME);
@@ -781,6 +790,13 @@ void application::initialize()
hand_tracking_supported = hand_tracking_properties.supportsHandTracking;
}
if (utils::contains(xr_extensions, XR_EXT_EYE_GAZE_INTERACTION_EXTENSION_NAME))
{
XrSystemEyeGazeInteractionPropertiesEXT eye_gaze_properties = xr_system_id.eye_gaze_interaction_properties();
spdlog::info(" Eye gaze support: {}", (bool)eye_gaze_properties.supportsEyeGazeInteraction);
eye_gaze_supported = eye_gaze_properties.supportsEyeGazeInteraction;
}
switch (xr_system_id.passthrough_supported())
{
case xr::system::passthrough_type::no_passthrough: