Pack multiple tracking items per datagram

This commit is contained in:
Patrick Nicolas
2024-10-02 23:58:13 +02:00
parent 5f359dc6d7
commit c370d19469
9 changed files with 76 additions and 70 deletions
+16 -12
View File
@@ -138,10 +138,10 @@ struct tracking
struct pose
{
device_id device;
XrPosef pose;
XrVector3f linear_velocity;
XrVector3f angular_velocity;
device_id device;
uint8_t flags;
};
@@ -160,6 +160,20 @@ struct tracking
std::array<view, 2> views;
std::vector<pose> device_poses;
struct fb_face2
{
std::array<float, XR_FACE_EXPRESSION2_COUNT_FB> weights;
std::array<float, XR_FACE_CONFIDENCE2_COUNT_FB> confidences;
bool is_valid;
bool is_eye_following_blendshapes_valid;
};
std::optional<fb_face2> face;
};
struct trackings
{
std::vector<tracking> items;
};
struct hand_tracking
@@ -195,16 +209,6 @@ struct hand_tracking
std::optional<std::array<pose, XR_HAND_JOINT_COUNT_EXT>> joints;
};
struct fb_face2
{
std::array<float, XR_FACE_EXPRESSION2_COUNT_FB> weights;
std::array<float, XR_FACE_CONFIDENCE2_COUNT_FB> confidences;
XrTime production_timestamp;
XrTime timestamp;
bool is_valid;
bool is_eye_following_blendshapes_valid;
};
struct inputs
{
struct input_value
@@ -245,7 +249,7 @@ struct battery
bool charging;
};
using packets = std::variant<headset_info_packet, feedback, audio_data, handshake, tracking, hand_tracking, fb_face2, inputs, timesync_response, battery>;
using packets = std::variant<headset_info_packet, feedback, audio_data, handshake, tracking, trackings, hand_tracking, inputs, timesync_response, battery>;
} // namespace from_headset
namespace to_headset