Browse Source

set important smoothmover vars when setting lag

Joe Shochet 19 years ago
parent
commit
a3af3b052c
1 changed files with 4 additions and 0 deletions
  1. 4 0
      direct/src/distributed/DistributedSmoothNode.py

+ 4 - 0
direct/src/distributed/DistributedSmoothNode.py

@@ -60,6 +60,10 @@ def activateSmoothing(smoothing, prediction):
             SmoothMover.setSmoothMode(SmoothMover.SMOn)
             SmoothMover.setSmoothMode(SmoothMover.SMOn)
             SmoothMover.setPredictionMode(SmoothMover.PMOff)
             SmoothMover.setPredictionMode(SmoothMover.PMOff)
             SmoothMover.setDelay(Lag)
             SmoothMover.setDelay(Lag)
+            # Set these other variables relative to the lag factor
+            SmoothMover.setExpectedBroadcastPeriod(Lag)
+            SmoothMover.setMaxPositionAge(Lag * 1.25)
+            SmoothMover.setResetVelocityAge(Lag * 1.5)
     else:
     else:
         # No smoothing, no prediction.
         # No smoothing, no prediction.
         SmoothMover.setSmoothMode(SmoothMover.SMOff)
         SmoothMover.setSmoothMode(SmoothMover.SMOff)