From 7cb6ecb9f54415fd723d7b7c85a65eb131aab077 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 22 Oct 2015 17:34:28 +0100 Subject: Make physics engines finish internal representation of loaded prims before starting simulation so it does start for all at same time. Currently only in use by ubOde --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++-- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 6 ++++++ OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs | 2 +- OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 7 ++++--- 4 files changed, 13 insertions(+), 6 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index c61a23d..dddc31a 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1523,8 +1523,8 @@ namespace OpenSim.Region.Framework.Scenes m_heartbeatThread = null; } -// m_sceneGraph.PreparePhysicsSimulation(); - + // tell physics to finish building actor + m_sceneGraph.ProcessPhysicsPreSimulation(); m_heartbeatThread = WorkManager.StartThread( diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 0a22bb3..0879cce 100755 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -222,6 +222,12 @@ namespace OpenSim.Region.Framework.Scenes return PhysicsScene.Simulate((float)elapsed); } + protected internal void ProcessPhysicsPreSimulation() + { + if(PhysicsScene != null) + PhysicsScene.ProcessPreSimulation(); + } + protected internal void UpdateScenePresenceMovement() { ForEachScenePresence(delegate(ScenePresence presence) diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs index 1c0ad20..8623891 100644 --- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs @@ -290,7 +290,7 @@ namespace OpenSim.Region.PhysicsModules.SharedBase public abstract void AddPhysicsActorTaint(PhysicsActor prim); - public virtual void PrepareSimulation() { } + public virtual void ProcessPreSimulation() { } /// /// Perform a simulation of the current physics scene over the given timestep. diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 103304d..2da2603 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -1526,7 +1526,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde } // does all pending changes generated during region load process - public override void PrepareSimulation() + public override void ProcessPreSimulation() { lock (OdeLock) { @@ -1541,7 +1541,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde int donechanges = 0; if (ChangesQueue.Count > 0) { - m_log.InfoFormat("[ODE] start processing pending actor operations"); + m_log.InfoFormat("[ubOde] start processing pending actor operations"); int tstart = Util.EnvironmentTickCount(); while (ChangesQueue.Dequeue(out item)) @@ -1564,8 +1564,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde donechanges++; } int time = Util.EnvironmentTickCountSubtract(tstart); - m_log.InfoFormat("[ODE] finished {0} operations in {1}ms", donechanges, time); + m_log.InfoFormat("[ubOde] finished {0} operations in {1}ms", donechanges, time); } + m_log.InfoFormat("[ubOde] {0} prim actors loaded",_prims.Count); } } -- cgit v1.1