Rework wivrn_session to be a xrt_system_devices

This will allow changing roles dynamically, and fixes some object
lifetime issues.
This commit is contained in:
Patrick Nicolas
2025-02-21 18:42:26 +01:00
parent b337800146
commit ad9020193d
3 changed files with 16 additions and 0 deletions
+8
View File
@@ -312,6 +312,14 @@ void wivrn_session::operator()(from_headset::headset_info_packet &&)
}
void wivrn_session::operator()(from_headset::trackings && tracking)
{
bool changed = left_hand.set_interaction_profile(tracking.interaction_profiles[0]);
changed |= right_hand.set_interaction_profile(tracking.interaction_profiles[1]);
if (changed)
{
std::lock_guard lock(roles_mutex);
++roles.generation_id;
}
for (auto & item: tracking.items)
(*this)(item);
}