diff options
author | Teravus Ovares (Dan Olivares) | 2010-12-23 13:17:55 -0500 |
---|---|---|
committer | Teravus Ovares (Dan Olivares) | 2010-12-23 13:17:55 -0500 |
commit | d829580e5e3fa1db760dc764c0ca76e65dd9b4c8 (patch) | |
tree | a6b530c63a0f59ebf1c016f52fe511fd01fc438e /OpenSim/Region/Physics/OdePlugin | |
parent | * Cleanup from a commit a while ago. (diff) | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC-d829580e5e3fa1db760dc764c0ca76e65dd9b4c8.zip opensim-SC-d829580e5e3fa1db760dc764c0ca76e65dd9b4c8.tar.gz opensim-SC-d829580e5e3fa1db760dc764c0ca76e65dd9b4c8.tar.bz2 opensim-SC-d829580e5e3fa1db760dc764c0ca76e65dd9b4c8.tar.xz |
Merge branch 'master' of ssh://MyConnection/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 19 |
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; |