aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2010-12-23 03:30:09 -0500
committerTeravus Ovares (Dan Olivares)2010-12-23 03:30:09 -0500
commit46db73b62baec7baf0e33d83efbaafaadcd4db0d (patch)
tree1891cc6883f09a56cd45ea54917fc6f5609efa07 /OpenSim/Region/Physics/OdePlugin
parentAdded a counter to NewFiles in Xfers to account for simultaneous object inven... (diff)
downloadopensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.zip
opensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.tar.gz
opensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.tar.bz2
opensim-SC-46db73b62baec7baf0e33d83efbaafaadcd4db0d.tar.xz
* Re-Adding Scene TimeDilation to Object Update Packets.
* Added Calculating Time Dilation in the OdePlubin * When multiple object updates are stuffed into one packet, average the time dilation between them as a compromise. * Time Dilation on the update is calculated when the EntityUpdate object is created. The pre-calc-ed TD is stored in the Entity update and used when it goes out on the wire. Previously, it was 1.0 all the time. The time dilation is tied to when the update is created, not when the update is sent.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs19
1 files changed, 19 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index 7fd59a0..eb97f41 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -287,6 +287,9 @@ namespace OpenSim.Region.Physics.OdePlugin
287 private OdePrim cp1; 287 private OdePrim cp1;
288 private OdeCharacter cc2; 288 private OdeCharacter cc2;
289 private OdePrim cp2; 289 private OdePrim cp2;
290 private int tickCountFrameRun;
291
292 private int latertickcount=0;
290 //private int cStartStop = 0; 293 //private int cStartStop = 0;
291 //private string cDictKey = ""; 294 //private string cDictKey = "";
292 295
@@ -3123,6 +3126,22 @@ namespace OpenSim.Region.Physics.OdePlugin
3123 } 3126 }
3124 d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix); 3127 d.WorldExportDIF(world, fname, physics_logging_append_existing_logfile, prefix);
3125 } 3128 }
3129 latertickcount = Util.EnvironmentTickCount() - tickCountFrameRun;
3130
3131 // OpenSimulator above does 10 fps. 10 fps = means that the main thread loop and physics
3132 // has a max of 100 ms to run theoretically.
3133 // If the main loop stalls, it calls Simulate later which makes the tick count ms larger.
3134 // If Physics stalls, it takes longer which makes the tick count ms larger.
3135
3136 if (latertickcount < 100)
3137 m_timeDilation = 1.0f;
3138 else
3139 {
3140 m_timeDilation = 100f / latertickcount;
3141 //m_timeDilation = Math.Min((Math.Max(100 - (Util.EnvironmentTickCount() - tickCountFrameRun), 1) / 100f), 1.0f);
3142 }
3143
3144 tickCountFrameRun = Util.EnvironmentTickCount();
3126 } 3145 }
3127 3146
3128 return fps; 3147 return fps;