diff --git a/client/scenes/stream_tracking.cpp b/client/scenes/stream_tracking.cpp index 643eb5ed..ac595f1d 100644 --- a/client/scenes/stream_tracking.cpp +++ b/client/scenes/stream_tracking.cpp @@ -78,7 +78,7 @@ static std::optionalsend_stream(hands); + hands.hand = xrt::drivers::wivrn::from_headset::hand_tracking::right; + hands.joints = locate_hands(application::get_right_hand(), world_space, hands.timestamp); network_session->send_stream(hands); } } diff --git a/common/wivrn_packets.h b/common/wivrn_packets.h index 14afc719..d61bba17 100644 --- a/common/wivrn_packets.h +++ b/common/wivrn_packets.h @@ -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> left; - std::optional> right; + hand_id hand; + std::optional> joints; }; struct inputs diff --git a/server/driver/hand_joints_list.cpp b/server/driver/hand_joints_list.cpp index 746e313c..4d1c8ecd 100644 --- a/server/driver/hand_joints_list.cpp +++ b/server/driver/hand_joints_list.cpp @@ -104,7 +104,7 @@ static xrt_hand_joint_set convert_joints(const std::optional