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
remove-scene-viewer
Justin Clark-Casey (justincc) 2011-10-20 20:48:51 +01:00
parent 6837e44d07
commit 9c43020876
3 changed files with 32 additions and 25 deletions

View File

@ -1167,7 +1167,8 @@ namespace OpenSim.Region.Framework.Scenes
/// </summary> /// </summary>
public void StartTimer() public void StartTimer()
{ {
//m_log.Debug("[SCENE]: Starting timer"); // m_log.DebugFormat("[SCENE]: Starting Heartbeat timer for {0}", RegionInfo.RegionName);
//m_heartbeatTimer.Enabled = true; //m_heartbeatTimer.Enabled = true;
//m_heartbeatTimer.Interval = (int)(m_timespan * 1000); //m_heartbeatTimer.Interval = (int)(m_timespan * 1000);
//m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat); //m_heartbeatTimer.Elapsed += new ElapsedEventHandler(Heartbeat);
@ -1242,6 +1243,8 @@ namespace OpenSim.Region.Framework.Scenes
++Frame; ++Frame;
// m_log.DebugFormat("[SCENE]: Processing frame {0}", Frame);
try try
{ {
int tmpAgentMS = Util.EnvironmentTickCount(); int tmpAgentMS = Util.EnvironmentTickCount();
@ -1359,6 +1362,8 @@ namespace OpenSim.Region.Framework.Scenes
if (LoginsDisabled && Frame == 20) if (LoginsDisabled && Frame == 20)
{ {
// m_log.DebugFormat("{0} {1} {2}", LoginsDisabled, m_sceneGraph.GetActiveScriptsCount(), LoginLock);
// In 99.9% of cases it is a bad idea to manually force garbage collection. However, // In 99.9% of cases it is a bad idea to manually force garbage collection. However,
// this is a rare case where we know we have just went through a long cycle of heap // this is a rare case where we know we have just went through a long cycle of heap
// allocations, and there is no more work to be done until someone logs in // allocations, and there is no more work to be done until someone logs in
@ -1375,8 +1380,9 @@ namespace OpenSim.Region.Framework.Scenes
EventManager.TriggerLoginsEnabled(RegionInfo.RegionName); EventManager.TriggerLoginsEnabled(RegionInfo.RegionName);
} }
m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName); m_log.DebugFormat("[REGION]: Enabling logins for {0}", RegionInfo.RegionName);
// For RegionReady lockouts // For RegionReady lockouts
if( LoginLock == false) if(LoginLock == false)
{ {
LoginsDisabled = false; LoginsDisabled = false;
} }

View File

@ -105,7 +105,7 @@ namespace OpenSim.Region.OptionalModules.Scripting.RegionReady
m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName); m_log.DebugFormat("[RegionReady]: Enabled for region {0}", scene.RegionInfo.RegionName);
if(m_disable_logins == true) if (m_disable_logins == true)
{ {
scene.LoginLock = true; scene.LoginLock = true;
scene.LoginsDisabled = true; scene.LoginsDisabled = true;

View File

@ -2640,24 +2640,27 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
framecount++; framecount++;
float fps = 0; float fps = 0;
float timeLeft = timeStep;
//m_log.Info(timeStep.ToString()); //m_log.Info(timeStep.ToString());
step_time += timeStep; // step_time += timeStep;
//
// If We're loaded down by something else, // // If We're loaded down by something else,
// or debugging with the Visual Studio project on pause // // or debugging with the Visual Studio project on pause
// skip a few frames to catch up gracefully. // // skip a few frames to catch up gracefully.
// without shooting the physicsactors all over the place // // without shooting the physicsactors all over the place
//
if (step_time >= m_SkipFramesAtms) // if (step_time >= m_SkipFramesAtms)
{ // {
// Instead of trying to catch up, it'll do 5 physics frames only // // Instead of trying to catch up, it'll do 5 physics frames only
step_time = ODE_STEPSIZE; // step_time = ODE_STEPSIZE;
m_physicsiterations = 5; // m_physicsiterations = 5;
} // }
else // else
{ // {
m_physicsiterations = 10; // m_physicsiterations = 10;
} // }
if (SupportsNINJAJoints) if (SupportsNINJAJoints)
{ {
@ -2683,13 +2686,11 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
// Figure out the Frames Per Second we're going at. // Figure out the Frames Per Second we're going at.
//(step_time == 0.004f, there's 250 of those per second. Times the step time/step size //(step_time == 0.004f, there's 250 of those per second. Times the step time/step size
fps = (step_time / ODE_STEPSIZE) * 1000; fps = (timeStep / ODE_STEPSIZE) * 1000;
// HACK: Using a time dilation of 1.0 to debug rubberbanding issues // HACK: Using a time dilation of 1.0 to debug rubberbanding issues
//m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f); //m_timeDilation = Math.Min((step_time / ODE_STEPSIZE) / (0.09375f / ODE_STEPSIZE), 1.0f);
step_time = 0.089f; while (timeLeft > 0.0f)
while (step_time > 0.0f)
{ {
try try
{ {
@ -2829,7 +2830,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name);
m_log.ErrorFormat("[PHYSICS]: {0}, {1}, {2}", e.Message, e.TargetSite, e); m_log.ErrorFormat("[PHYSICS]: {0}, {1}, {2}", e.Message, e.TargetSite, e);
} }
step_time -= ODE_STEPSIZE; timeLeft -= ODE_STEPSIZE;
} }
lock (_characters) lock (_characters)