Don't accumulate delay if tracking is slow on client

This commit is contained in:
Patrick Nicolas
2024-03-14 19:58:31 +01:00
parent d479ae9786
commit 5dc5117441
+3
View File
@@ -124,6 +124,9 @@ void scenes::stream::tracking()
if (now < t0)
std::this_thread::sleep_for(std::chrono::nanoseconds(t0 - now - dt));
// If thread can't keep up, skip timestamps
t0 += tracking_period * ((now - t0) / tracking_period);
for (XrTime Δt = 0; Δt < extrapolation_horizon; Δt += tracking_period)
{
from_headset::tracking packet{};