From 9c430208769ab7fd7877093e278e8fcae02ecef3 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Thu, 20 Oct 2011 20:48:51 +0100 Subject: 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 --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 45 ++++++++++++++-------------- 1 file changed, 23 insertions(+), 22 deletions(-) (limited to 'OpenSim/Region/Physics') 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); framecount++; float fps = 0; - //m_log.Info(timeStep.ToString()); - step_time += timeStep; - - // If We're loaded down by something else, - // or debugging with the Visual Studio project on pause - // skip a few frames to catch up gracefully. - // without shooting the physicsactors all over the place - if (step_time >= m_SkipFramesAtms) - { - // Instead of trying to catch up, it'll do 5 physics frames only - step_time = ODE_STEPSIZE; - m_physicsiterations = 5; - } - else - { - m_physicsiterations = 10; - } + float timeLeft = timeStep; + + //m_log.Info(timeStep.ToString()); +// step_time += timeStep; +// +// // If We're loaded down by something else, +// // or debugging with the Visual Studio project on pause +// // skip a few frames to catch up gracefully. +// // without shooting the physicsactors all over the place +// +// if (step_time >= m_SkipFramesAtms) +// { +// // Instead of trying to catch up, it'll do 5 physics frames only +// step_time = ODE_STEPSIZE; +// m_physicsiterations = 5; +// } +// else +// { +// m_physicsiterations = 10; +// } if (SupportsNINJAJoints) { @@ -2683,13 +2686,11 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); // 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 - fps = (step_time / ODE_STEPSIZE) * 1000; + fps = (timeStep / ODE_STEPSIZE) * 1000; // 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); - step_time = 0.089f; - - while (step_time > 0.0f) + while (timeLeft > 0.0f) { try { @@ -2829,7 +2830,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); m_log.ErrorFormat("[PHYSICS]: {0}, {1}, {2}", e.Message, e.TargetSite, e); } - step_time -= ODE_STEPSIZE; + timeLeft -= ODE_STEPSIZE; } lock (_characters) -- cgit v1.1