Prevent eye gaze extrapolation

This commit is contained in:
Patrick Nicolas
2026-02-04 09:37:26 +01:00
parent 67f4ced505
commit 30fddf7518
4 changed files with 27 additions and 1 deletions
+2
View File
@@ -72,6 +72,8 @@ xrt_result_t wivrn_eye_tracker::get_tracked_pose(xrt_input_name name, int64_t at
{
if (name == XRT_INPUT_GENERIC_EYE_GAZE_POSE)
{
if (auto [min, max] = gaze.get_bounds(); min <= max)
at_timestamp_ns = std::clamp(at_timestamp_ns, min, max);
auto [production_timestamp, relation] = gaze.get_at(at_timestamp_ns);
*out_relation = relation;
cnx.add_tracking_request(device_id::EYE_GAZE, at_timestamp_ns, production_timestamp);