From 8ed17f745d0aa29cdd8a1a0485416c42f610cef6 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 22 Oct 2015 18:03:49 +0100 Subject: let ode also finish internal representation of prim actors, before simulation --- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 40 +++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 86ec817..4e95b7a 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -2919,6 +2919,46 @@ namespace OpenSim.Region.PhysicsModule.ODE } } + // does all pending changes generated during region load process + public override void ProcessPreSimulation() + { + lock (OdeLock) + { + if (world == IntPtr.Zero) + { + _taintedPrims.Clear();; + return; + } + + int donechanges = 0; + if (_taintedPrims.Count > 0) + { + m_log.InfoFormat("[Ode] start processing pending actor operations"); + int tstart = Util.EnvironmentTickCount(); + + lock (_taintedPrims) + { + foreach (OdePrim prim in _taintedPrims) + { + if (prim.m_taintremove) + RemovePrimThreadLocked(prim); + else + prim.ProcessTaints(); + + prim.m_collisionscore = 0; + donechanges++; + } + _taintedPrims.Clear(); + } + + int time = Util.EnvironmentTickCountSubtract(tstart); + m_log.InfoFormat("[Ode] finished {0} operations in {1}ms", donechanges, time); + } + m_log.InfoFormat("[Ode] {0} prim actors loaded",_prims.Count); + } + } + + /// /// This is our main simulate loop /// -- cgit v1.1