Avoid hand tracking packet fragmentation

This commit is contained in:
Patrick Nicolas
2024-04-07 10:25:30 +02:00
parent 7768527fad
commit c9301332dd
3 changed files with 23 additions and 13 deletions
+10 -4
View File
@@ -160,20 +160,26 @@ struct hand_tracking
orientation_tracked = 1 << 4,
position_tracked = 1 << 5
};
enum hand_id : uint8_t
{
left,
right,
};
struct pose
{
XrPosef pose;
XrVector3f linear_velocity;
XrVector3f angular_velocity;
float radius;
// In order to avoid packet fragmentation
// use 2 less bytes for radius
uint16_t radius; // 10th of mm
uint8_t flags;
};
XrTime production_timestamp;
XrTime timestamp;
std::optional<std::array<pose, XR_HAND_JOINT_COUNT_EXT>> left;
std::optional<std::array<pose, XR_HAND_JOINT_COUNT_EXT>> right;
hand_id hand;
std::optional<std::array<pose, XR_HAND_JOINT_COUNT_EXT>> joints;
};
struct inputs