Skip to content

Commit

Permalink
fix(client_core): 🐛 Fix wrong computation of prediction (#2641)
Browse files Browse the repository at this point in the history
  • Loading branch information
zmerp authored Jan 18, 2025
1 parent 66bbc3c commit f69b428
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
4 changes: 2 additions & 2 deletions alvr/client_core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ impl ClientCoreContext {
let target_timestamp = if let Some(stats) =
&*self.connection_context.statistics_manager.lock()
{
poll_timestamp + Duration::max(stats.average_total_pipeline_latency(), max_prediction)
poll_timestamp + Duration::min(stats.average_total_pipeline_latency(), max_prediction)
} else {
poll_timestamp
};
Expand All @@ -264,7 +264,7 @@ impl ClientCoreContext {
motion.angular_velocity = Vec3::ZERO;
} else if let Some(stats) = &*self.connection_context.statistics_manager.lock() {
let tracker_timestamp = poll_timestamp
+ Duration::max(stats.tracker_prediction_offset(), max_prediction);
+ Duration::min(stats.tracker_prediction_offset(), max_prediction);

*motion = motion.predict(poll_timestamp, tracker_timestamp);
}
Expand Down
1 change: 0 additions & 1 deletion alvr/session/src/settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1113,7 +1113,6 @@ Tilted: the world gets tilted when long pressing the oculus button. This is usef
#[schema(strings(
help = "Maximum prediction for head and controllers. Used to avoid too much jitter during loading."
))]
#[schema(flag = "real-time")]
#[schema(gui(slider(min = 0, max = 200, step = 5)), suffix = "ms")]
pub max_prediction_ms: u64,
}
Expand Down

0 comments on commit f69b428

Please sign in to comment.