Forward body skeletons from headset

This commit is contained in:
Sapphire
2026-07-10 13:22:05 -05:00
parent 41c2c0b727
commit 2e28b0a4ad
28 changed files with 858 additions and 236 deletions
+23 -13
View File
@@ -18,18 +18,23 @@
#include "body_tracker.h"
#include "xr/fb_body_tracker.h"
#include "xr/htc_exts.h"
#include "xr/instance.h"
#include "xr/system.h"
#include <openxr/openxr.h>
xr::body_tracker_type xr::body_tracker_supported(xr::instance & instance, xr::system & system)
{
if (instance.has_extension(XR_FB_BODY_TRACKING_EXTENSION_NAME) and
instance.has_extension(XR_META_BODY_TRACKING_FULL_BODY_EXTENSION_NAME) and
instance.has_extension(XR_META_BODY_TRACKING_FIDELITY_EXTENSION_NAME))
if (instance.has_extension(XR_FB_BODY_TRACKING_EXTENSION_NAME))
{
auto fb_body_properties = system.fb_body_tracking_properties();
if (fb_body_properties.supportsBodyTracking)
bool body_supported = system.fb_body_tracking_properties().supportsBodyTracking;
bool full_body_supported = instance.has_extension(XR_META_BODY_TRACKING_FULL_BODY_EXTENSION_NAME) and instance.has_extension(XR_META_BODY_TRACKING_FIDELITY_EXTENSION_NAME)
? system.meta_body_tracking_properties().supportsFullBodyTracking
: false;
if (full_body_supported)
return body_tracker_type::meta;
if (body_supported)
return body_tracker_type::fb;
}
@@ -47,19 +52,24 @@ xr::body_tracker_type xr::body_tracker_supported(xr::instance & instance, xr::sy
return xr::body_tracker_type::none;
}
xr::body_tracker xr::make_body_tracker(xr::instance & instance, xr::system & system, xr::session & session, std::vector<std::pair<XrPath, xr::space>> & generic_trackers, bool full_body, bool hips)
xr::body_tracker xr::make_body_tracker(xr::instance & instance, xr::system & system, xr::session & session, std::vector<std::pair<XrPath, xr::space>> & generic_trackers, bool full_body)
{
if (instance.has_extension(XR_FB_BODY_TRACKING_EXTENSION_NAME) and
instance.has_extension(XR_META_BODY_TRACKING_FULL_BODY_EXTENSION_NAME) and
instance.has_extension(XR_META_BODY_TRACKING_FIDELITY_EXTENSION_NAME))
if (instance.has_extension(XR_FB_BODY_TRACKING_EXTENSION_NAME))
{
auto fb_body_properties = system.fb_body_tracking_properties();
if (fb_body_properties.supportsBodyTracking)
bool body_supported = system.fb_body_tracking_properties().supportsBodyTracking;
bool full_body_supported = instance.has_extension(XR_META_BODY_TRACKING_FULL_BODY_EXTENSION_NAME) and
instance.has_extension(XR_META_BODY_TRACKING_FIDELITY_EXTENSION_NAME) and
system.meta_body_tracking_properties().supportsFullBodyTracking;
if (full_body_supported)
return xr::body_tracker(std::in_place_type_t<xr::fb_body_tracker>(),
instance,
session,
full_body,
hips);
full_body);
if (body_supported)
return xr::body_tracker(std::in_place_type_t<xr::fb_body_tracker>(),
instance,
session,
false);
}
if (not generic_trackers.empty())