aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-10-20 20:48:51 +0100
committerJustin Clark-Casey (justincc)2011-10-20 20:48:51 +0100
commit9c430208769ab7fd7877093e278e8fcae02ecef3 (patch)
treec1aa965c791c107803fe222ceb0acf5fe46bb953 /OpenSim
parentPass PhysicsScene.Simulate() only the MinFrameTime rather than the useless Ma... (diff)
downloadopensim-SC_OLD-9c430208769ab7fd7877093e278e8fcae02ecef3.zip
opensim-SC_OLD-9c430208769ab7fd7877093e278e8fcae02ecef3.tar.gz
opensim-SC_OLD-9c430208769ab7fd7877093e278e8fcae02ecef3.tar.bz2
opensim-SC_OLD-9c430208769ab7fd7877093e278e8fcae02ecef3.tar.xz
Get OdeScene to use passed in time step rather than hard-coded 0.089
However, I still don't recommend changing MinFrameTime from 0.089, high values do not work well and lower values don't seem to make much difference
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs10
-rw-r--r--OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs45
3 files changed, 32 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 2a25b2b..894d8d2 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1167,7 +1167,8 @@ namespace OpenSim.Region.Framework.Scenes
1167 /// </summary> 1167 /// </summary>
1168 public void StartTimer() 1168 public void StartTimer()
1169 { 1169 {
1170 //m_log.Debug("[SCENE]: Starting timer"); 1170// m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName);
1171
1171 //m_heartbeatTimer.Enabled = true; 1172 //m_heartbeatTimer.Enabled = true;
1172 //m_heartbeatTimer.Interval = (int)(m_timespan * 1000); 1173 //m_heartbeatTimer.Interval = (int)(m_timespan * 1000);
1173 //m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); 1174 //m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
@@ -1242,6 +1243,8 @@ namespace OpenSim.Region.Framework.Scenes
1242 1243
1243 ++Frame; 1244 ++Frame;
1244 1245
1246// m_log.DebugFormat("[SCENE]: Processing frame {0}", Frame);
1247
1245 try 1248 try
1246 { 1249 {
1247 int tmpAgentMS = Util.EnvironmentTickCount(); 1250 int tmpAgentMS = Util.EnvironmentTickCount();
@@ -1359,6 +1362,8 @@ namespace OpenSim.Region.Framework.Scenes
1359 1362
1360 if (LoginsDisabled && Frame == 20) 1363 if (LoginsDisabled && Frame == 20)
1361 { 1364 {
1365// m_log.DebugFormat("{0} {1} {2}", LoginsDisabled, m_sceneGraph.GetActiveScriptsCount(), LoginLock);
1366
1362 // In 99.9% of cases it is a bad idea to manually force garbage collection. However, 1367 // In 99.9% of cases it is a bad idea to manually force garbage collection. However,
1363 // this is a rare case where we know we have just went through a long cycle of heap 1368 // this is a rare case where we know we have just went through a long cycle of heap
1364 // allocations, and there is no more work to be done until someone logs in 1369 // allocations, and there is no more work to be done until someone logs in
@@ -1375,8 +1380,9 @@ namespace OpenSim.Region.Framework.Scenes
1375 EventManager.TriggerLoginsEnabled(RegionInfo.RegionName); 1380 EventManager.TriggerLoginsEnabled(RegionInfo.RegionName);
1376 } 1381 }
1377 m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); 1382 m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
1383
1378 // For RegionReady lockouts 1384 // For RegionReady lockouts
1379 if( LoginLock == false) 1385 if(LoginLock == false)
1380 { 1386 {
1381 LoginsDisabled = false; 1387 LoginsDisabled = false;
1382 } 1388 }
diff --git a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
index 963d1e2..4c4f5fb 100644
--- a/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
+++ b/OpenSim/Region/OptionalModules/Scripting/RegionReadyModule/RegionReadyModule.cs
@@ -105,7 +105,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
105 105
106 m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); 106 m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
107 107
108 if(m_disable_logins == true) 108 if (m_disable_logins == true)
109 { 109 {
110 scene.LoginLock = true; 110 scene.LoginLock = true;
111 scene.LoginsDisabled = true; 111 scene.LoginsDisabled = true;
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index a56a292..1d0c699 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -2640,24 +2640,27 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
2640 framecount++; 2640 framecount++;
2641 2641
2642 float fps = 0; 2642 float fps = 0;
2643 //m_log.Info(timeStep.ToString());
2644 step_time += timeStep;
2645
2646 // If We're loaded down by something else,
2647 // or debugging with the Visual Studio project on pause
2648 // skip a few frames to catch up gracefully.
2649 // without shooting the physicsactors all over the place
2650 2643
2651 if (step_time >= m_SkipFramesAtms) 2644 float timeLeft = timeStep;
2652 { 2645
2653 // Instead of trying to catch up, it'll do 5 physics frames only 2646 //m_log.Info(timeStep.ToString());
2654 step_time = ODE_STEPSIZE; 2647// step_time += timeStep;
2655 m_physicsiterations = 5; 2648//
2656 } 2649// // If We're loaded down by something else,
2657 else 2650// // or debugging with the Visual Studio project on pause
2658 { 2651// // skip a few frames to catch up gracefully.
2659 m_physicsiterations = 10; 2652// // without shooting the physicsactors all over the place
2660 } 2653//
2654// if (step_time >= m_SkipFramesAtms)
2655// {
2656// // Instead of trying to catch up, it'll do 5 physics frames only
2657// step_time = ODE_STEPSIZE;
2658// m_physicsiterations = 5;
2659// }
2660// else
2661// {
2662// m_physicsiterations = 10;
2663// }
2661 2664
2662 if (SupportsNINJAJoints) 2665 if (SupportsNINJAJoints)
2663 { 2666 {
@@ -2683,13 +2686,11 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
2683 // Figure out the Frames Per Second we're going at. 2686 // Figure out the Frames Per Second we're going at.
2684 //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size 2687 //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size
2685 2688
2686 fps = (step_time / ODE_STEPSIZE) * 1000; 2689 fps = (timeStep / ODE_STEPSIZE) * 1000;
2687 // HACK: Using a time dilation of 1.0 to debug rubberbanding issues 2690 // HACK: Using a time dilation of 1.0 to debug rubberbanding issues
2688 //m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f); 2691 //m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f);
2689 2692
2690 step_time = 0.089f; 2693 while (timeLeft > 0.0f)
2691
2692 while (step_time > 0.0f)
2693 { 2694 {
2694 try 2695 try
2695 { 2696 {
@@ -2829,7 +2830,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
2829 m_log.ErrorFormat("[PHYSICS]: {0}, {1}, {2}", e.Message, e.TargetSite, e); 2830 m_log.ErrorFormat("[PHYSICS]: {0}, {1}, {2}", e.Message, e.TargetSite, e);
2830 } 2831 }
2831 2832
2832 step_time -= ODE_STEPSIZE; 2833 timeLeft -= ODE_STEPSIZE;
2833 } 2834 }
2834 2835
2835 lock (_characters) 2836 lock (_characters)