diff options
author | Justin Clark-Casey (justincc) | 2011-10-20 20:48:51 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-20 20:48:51 +0100 |
commit | 9c430208769ab7fd7877093e278e8fcae02ecef3 (patch) | |
tree | c1aa965c791c107803fe222ceb0acf5fe46bb953 /OpenSim/Region/Physics/OdePlugin | |
parent | Pass PhysicsScene.Simulate() only the MinFrameTime rather than the useless Ma... (diff) | |
download | opensim-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/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 45 |
1 files changed, 23 insertions, 22 deletions
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) |