瀏覽代碼

refinements to clock skew tolerance

David Rose 24 年之前
父節點
當前提交
fffe7200a4
共有 2 個文件被更改,包括 3 次插入2 次删除
  1. 2 1
      direct/src/deadrec/smoothMover.cxx
  2. 1 1
      direct/src/distributed/DistributedSmoothNode.py

+ 2 - 1
direct/src/deadrec/smoothMover.cxx

@@ -212,6 +212,7 @@ compute_smooth_position(double timestamp) {
   }
   }
 
 
   // First, back up in time by the specified delay factor.
   // First, back up in time by the specified delay factor.
+  double orig_timestamp = timestamp;
   timestamp -= _delay;
   timestamp -= _delay;
   if (_accept_clock_skew) {
   if (_accept_clock_skew) {
     timestamp -= get_avg_timestamp_delay();
     timestamp -= get_avg_timestamp_delay();
@@ -304,7 +305,7 @@ compute_smooth_position(double timestamp) {
       set_smooth_pos(point._pos, point._hpr, timestamp);
       set_smooth_pos(point._pos, point._hpr, timestamp);
     }
     }
 
 
-    if (timestamp - _last_heard_from > _reset_velocity_age) {
+    if (orig_timestamp - _last_heard_from > _reset_velocity_age) {
       // Furthermore, if we haven't heard from this client in a while,
       // Furthermore, if we haven't heard from this client in a while,
       // reset the velocity.  This decision is based entirely on our
       // reset the velocity.  This decision is based entirely on our
       // local timestamps, not on the other client's reported
       // local timestamps, not on the other client's reported

+ 1 - 1
direct/src/distributed/DistributedSmoothNode.py

@@ -25,7 +25,7 @@ EnablePrediction = base.config.GetBool("smooth-enable-prediction", 1)
 # each avatar, which is intended to compensate for relative clock
 # each avatar, which is intended to compensate for relative clock
 # skew.
 # skew.
 Lag = base.config.GetDouble("smooth-lag", 0.1)
 Lag = base.config.GetDouble("smooth-lag", 0.1)
-PredictionLag = base.config.GetDouble("smooth-prediction-lag", -0.1)
+PredictionLag = base.config.GetDouble("smooth-prediction-lag", 0.0)