diff options
author | Melanie | 2010-12-23 12:08:38 +0000 |
---|---|---|
committer | Melanie | 2010-12-23 12:08:38 +0000 |
commit | 2cc07de0bac6c5eae48a3a61056ecedaa06c2bca (patch) | |
tree | c8b32755bee00ff1b0dbf795bddd97ef5afc6aab /OpenSim/Region/Physics | |
parent | Revert "reactivating some traces to track a dead thread" (diff) | |
parent | Put back a commented section of code. With some viewers, object inventory (diff) | |
download | opensim-SC-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.zip opensim-SC-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.tar.gz opensim-SC-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.tar.bz2 opensim-SC-2cc07de0bac6c5eae48a3a61056ecedaa06c2bca.tar.xz |
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Physics')
-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; |