@@ -1113,6 +1113,7 @@ void application::initialize()
|
||||
opt_extensions.push_back(XR_KHR_COMPOSITION_LAYER_DEPTH_EXTENSION_NAME);
|
||||
opt_extensions.push_back(XR_FB_COMPOSITION_LAYER_DEPTH_TEST_EXTENSION_NAME);
|
||||
opt_extensions.push_back(XR_KHR_COMPOSITION_LAYER_COLOR_SCALE_BIAS_EXTENSION_NAME);
|
||||
opt_extensions.push_back(XR_EXT_USER_PRESENCE_EXTENSION_NAME);
|
||||
opt_extensions.push_back(XR_KHR_VISIBILITY_MASK_EXTENSION_NAME);
|
||||
opt_extensions.push_back(XR_FB_COMPOSITION_LAYER_SETTINGS_EXTENSION_NAME);
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include "xr/fb_face_tracker2.h"
|
||||
#include "xr/htc_body_tracker.h"
|
||||
#include "xr/pico_body_tracker.h"
|
||||
#include <openxr/openxr.h>
|
||||
#define GLM_FORCE_RADIANS
|
||||
|
||||
#include "stream.h"
|
||||
@@ -217,6 +218,7 @@ std::shared_ptr<scenes::stream> scenes::stream::create(std::unique_ptr<wivrn_ses
|
||||
|
||||
info.hand_tracking = config.check_feature(feature::hand_tracking);
|
||||
info.eye_gaze = config.check_feature(feature::eye_gaze);
|
||||
info.presence = self->instance.has_extension(XR_EXT_USER_PRESENCE_EXTENSION_NAME) && self->system.user_presence_properties().supportsUserPresence;
|
||||
|
||||
if (config.check_feature(feature::face_tracking))
|
||||
{
|
||||
@@ -1287,6 +1289,11 @@ void scenes::stream::on_xr_event(const xr::event & event)
|
||||
.view_index = uint8_t(event.visibility_mask_changed.viewIndex),
|
||||
});
|
||||
break;
|
||||
case XR_TYPE_EVENT_DATA_USER_PRESENCE_CHANGED_EXT:
|
||||
network_session->send_control(from_headset::user_presence_changed{
|
||||
.present = (bool)event.user_presence_changed.isUserPresent,
|
||||
});
|
||||
break;
|
||||
case XR_TYPE_EVENT_DATA_INTERACTION_PROFILE_CHANGED:
|
||||
on_interaction_profile_changed(event.interaction_profile_changed);
|
||||
break;
|
||||
|
||||
@@ -43,6 +43,7 @@ union event
|
||||
XrEventDataDisplayRefreshRateChangedFB refresh_rate_changed;
|
||||
XrEventDataPassthroughStateChangedFB passthrough_state_changed;
|
||||
XrEventDataVisibilityMaskChangedKHR visibility_mask_changed;
|
||||
XrEventDataUserPresenceChangedEXT user_presence_changed;
|
||||
};
|
||||
class instance : public utils::handle<XrInstance, xrDestroyInstance>
|
||||
{
|
||||
|
||||
@@ -105,6 +105,24 @@ XrSystemEyeGazeInteractionPropertiesEXT xr::system::eye_gaze_interaction_propert
|
||||
return eye_gaze_prop;
|
||||
}
|
||||
|
||||
XrSystemUserPresencePropertiesEXT xr::system::user_presence_properties() const
|
||||
{
|
||||
if (!id)
|
||||
throw std::invalid_argument("this");
|
||||
|
||||
XrSystemUserPresencePropertiesEXT presence_prop{
|
||||
.type = XR_TYPE_SYSTEM_USER_PRESENCE_PROPERTIES_EXT,
|
||||
};
|
||||
|
||||
XrSystemProperties prop{
|
||||
.type = XR_TYPE_SYSTEM_PROPERTIES,
|
||||
.next = &presence_prop,
|
||||
};
|
||||
CHECK_XR(xrGetSystemProperties(*inst, id, &prop));
|
||||
|
||||
return presence_prop;
|
||||
}
|
||||
|
||||
XrSystemFaceTrackingProperties2FB xr::system::fb_face_tracking2_properties() const
|
||||
{
|
||||
if (!id)
|
||||
|
||||
@@ -62,6 +62,7 @@ public:
|
||||
XrSystemProperties properties() const;
|
||||
XrSystemHandTrackingPropertiesEXT hand_tracking_properties() const;
|
||||
XrSystemEyeGazeInteractionPropertiesEXT eye_gaze_interaction_properties() const;
|
||||
XrSystemUserPresencePropertiesEXT user_presence_properties() const;
|
||||
XrSystemFaceTrackingProperties2FB fb_face_tracking2_properties() const;
|
||||
XrSystemFacialTrackingPropertiesHTC htc_face_tracking_properties() const;
|
||||
XrSystemBodyTrackingPropertiesFB fb_body_tracking_properties() const;
|
||||
|
||||
Reference in New Issue
Block a user