Forward XR_EXT_user_presence

Closes #258
This commit is contained in:
Sapphire
2025-07-04 23:43:06 +02:00
committed by xytovl
parent f43ee229f1
commit 3ac31fe5cc
10 changed files with 67 additions and 1 deletions
+15
View File
@@ -76,10 +76,12 @@ wivrn_hmd::wivrn_hmd(wivrn::wivrn_session * cnx,
.supported = {
.orientation_tracking = true,
.position_tracking = true,
.presence = info.presence,
.battery_status = true,
},
.update_inputs = [](xrt_device *) { return XRT_SUCCESS; },
.get_tracked_pose = method_pointer<&wivrn_hmd::get_tracked_pose>,
.get_presence = method_pointer<&wivrn_hmd::get_presence>,
.get_view_poses = method_pointer<&wivrn_hmd::get_view_poses>,
.get_visibility_mask = method_pointer<&wivrn_hmd::get_visibility_mask>,
.get_battery_status = method_pointer<&wivrn_hmd::get_battery_status>,
@@ -147,6 +149,13 @@ void wivrn_hmd::update_battery(const from_headset::battery & new_battery)
battery = new_battery;
}
xrt_result_t wivrn_hmd::get_presence(bool * out_presence)
{
*out_presence = presence;
return XRT_SUCCESS;
}
xrt_result_t wivrn_hmd::get_view_poses(const xrt_vec3 * default_eye_relation,
int64_t at_timestamp_ns,
uint32_t view_count,
@@ -222,4 +231,10 @@ void wivrn_hmd::update_visibility_mask(const from_headset::visibility_mask_chang
auto m = visibility_mask.lock();
m->at(mask.view_index) = mask.data;
}
void wivrn_hmd::update_presence(bool presence)
{
U_LOG_I("Updating user presence to %s", presence ? "true" : "false");
this->presence = presence;
}
} // namespace wivrn