This commit is contained in:
Sapphire
2025-06-08 18:07:23 +02:00
committed by xytovl
parent 7b0cd08060
commit 2fc35832b9
3 changed files with 12 additions and 17 deletions
+5 -7
View File
@@ -67,9 +67,7 @@ void xr::fb_body_tracker::stop()
std::optional<std::array<wivrn::from_headset::body_tracking::pose, wivrn::from_headset::body_tracking::max_tracked_poses>> xr::fb_body_tracker::locate_spaces(XrTime time, XrSpace reference)
{
if (!handle)
{
return std::nullopt;
}
assert(xrLocateBodyJointsFB);
@@ -110,24 +108,24 @@ std::optional<std::array<wivrn::from_headset::body_tracking::pose, wivrn::from_h
if (!hip && joint == XR_FULL_BODY_JOINT_HIPS_META)
continue;
auto joint_pose = joints[joint];
const auto & joint_loc = joints[joint];
wivrn::from_headset::body_tracking::pose pose{
.pose = joint_pose.pose,
.pose = joint_loc.pose,
.flags = 0,
};
if (joint_pose.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT)
if (joint_loc.locationFlags & XR_SPACE_LOCATION_ORIENTATION_VALID_BIT)
{
pose.flags |= wivrn::from_headset::body_tracking::orientation_valid;
pose.flags |= wivrn::from_headset::body_tracking::orientation_tracked;
}
if (joint_pose.locationFlags & XR_SPACE_LOCATION_POSITION_VALID_BIT)
if (joint_loc.locationFlags & XR_SPACE_LOCATION_POSITION_VALID_BIT)
{
pose.flags |= wivrn::from_headset::body_tracking::position_valid;
pose.flags |= wivrn::from_headset::body_tracking::position_tracked;
}
poses[num_poses++] = std::move(pose);
poses[num_poses++] = pose;
}
return poses;
}