cleanup
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -39,9 +39,7 @@ xr::pico_body_tracker::pico_body_tracker(instance & inst, XrBodyTrackerBD h)
|
||||
std::optional<std::array<wivrn::from_headset::body_tracking::pose, wivrn::from_headset::body_tracking::max_tracked_poses>> xr::pico_body_tracker::locate_spaces(XrTime time, XrSpace reference)
|
||||
{
|
||||
if (!xrLocateBodyJointsBD)
|
||||
{
|
||||
return std::nullopt;
|
||||
}
|
||||
|
||||
XrBodyJointsLocateInfoBD locate_info{
|
||||
.type = XR_TYPE_BODY_JOINTS_LOCATE_INFO_BD,
|
||||
@@ -67,22 +65,22 @@ std::optional<std::array<wivrn::from_headset::body_tracking::pose, wivrn::from_h
|
||||
std::array<wivrn::from_headset::body_tracking::pose, wivrn::from_headset::body_tracking::max_tracked_poses> poses{};
|
||||
for (int i = 0; i < joint_whitelist.size(); i++)
|
||||
{
|
||||
auto & joint_location = joints[joint_whitelist[i]];
|
||||
const auto & joint_loc = joints[joint_whitelist[i]];
|
||||
wivrn::from_headset::body_tracking::pose pose{
|
||||
.pose = joint_location.pose,
|
||||
.pose = joint_loc.pose,
|
||||
.flags = 0,
|
||||
};
|
||||
|
||||
if (joint_location.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;
|
||||
if (joint_location.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;
|
||||
if (joint_location.locationFlags & XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT)
|
||||
if (joint_loc.locationFlags & XR_SPACE_LOCATION_ORIENTATION_TRACKED_BIT)
|
||||
pose.flags |= wivrn::from_headset::body_tracking::orientation_tracked;
|
||||
if (joint_location.locationFlags & XR_SPACE_LOCATION_POSITION_TRACKED_BIT)
|
||||
if (joint_loc.locationFlags & XR_SPACE_LOCATION_POSITION_TRACKED_BIT)
|
||||
pose.flags |= wivrn::from_headset::body_tracking::position_tracked;
|
||||
|
||||
poses[i] = std::move(pose);
|
||||
poses[i] = pose;
|
||||
}
|
||||
return poses;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,6 @@
|
||||
namespace xr
|
||||
{
|
||||
class instance;
|
||||
class session;
|
||||
|
||||
XrResult destroy_pico_body_tracker(XrBodyTrackerBD);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user