diff options
author | Diva Canto | 2010-12-23 10:05:45 -0800 |
---|---|---|
committer | Diva Canto | 2010-12-23 10:05:45 -0800 |
commit | bc67bc0d949e5b71dbd924b8119b0232b149cfb6 (patch) | |
tree | 3ca3ac8bda0d4b64ba3cacdefca920f5c2105ea8 /OpenSim/Region/Physics | |
parent | Removed unused code -- this was the previous version of UDP texture sending, ... (diff) | |
parent | Put back a commented section of code. With some viewers, object inventory (diff) | |
download | opensim-SC-bc67bc0d949e5b71dbd924b8119b0232b149cfb6.zip opensim-SC-bc67bc0d949e5b71dbd924b8119b0232b149cfb6.tar.gz opensim-SC-bc67bc0d949e5b71dbd924b8119b0232b149cfb6.tar.bz2 opensim-SC-bc67bc0d949e5b71dbd924b8119b0232b149cfb6.tar.xz |
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
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; |