From 0d14c47c28f4e453540f5f6807ba8b86d5ff50c2 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 14 Feb 2008 00:39:08 +0000 Subject: * Bigisn ODE Stability update 2 --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 45 +++++++++++++++++---------- 1 file changed, 28 insertions(+), 17 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 66af095..5ff74dc 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -736,6 +736,7 @@ namespace OpenSim.Region.Physics.OdePlugin /// public void RemovePrimThreadLocked(OdePrim prim) { + prim.ResetTaints(); lock (OdeLock) { System.Threading.Thread.Sleep(20); @@ -1237,31 +1238,39 @@ namespace OpenSim.Region.Physics.OdePlugin actor.Move(timeStep); actor.collidelock = true; } - - ode.dlock(world); + if (!ode.lockquery()) + { + ode.dlock(world); - collision_optimized(timeStep); + collision_optimized(timeStep); - - ode.dunlock(world); - - try - { - d.WorldQuickStep(world, ODE_STEPSIZE); + + + + try + { + d.WorldQuickStep(world, ODE_STEPSIZE); + } + catch (StackOverflowException) + { + d.WorldQuickStep(world, 0.001f); + } + d.JointGroupEmpty(contactgroup); + ode.dunlock(world); + + step_time -= ODE_STEPSIZE; + i++; } - catch (StackOverflowException) + else { - d.WorldQuickStep(world, 0.001f); + fps = 0; } - d.JointGroupEmpty(contactgroup); + foreach (OdeCharacter actor in _characters) { actor.collidelock = false; } - - step_time -= ODE_STEPSIZE; - i++; } foreach (OdeCharacter actor in _characters) @@ -1273,12 +1282,14 @@ namespace OpenSim.Region.Physics.OdePlugin { bool processedtaints = false; foreach (OdePrim prim in _taintedPrim) - { - prim.ProcessTaints(timeStep); + { if (prim.m_taintremove) { RemovePrimThreadLocked(prim); } + + prim.ProcessTaints(timeStep); + processedtaints = true; prim.m_collisionscore = 0; } -- cgit v1.1