aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2015-10-22 17:34:28 +0100
committerUbitUmarov2015-10-22 17:34:28 +0100
commit7cb6ecb9f54415fd723d7b7c85a65eb131aab077 (patch)
tree2e20d030a8c20faed8bfbe7e3196a7598eba4607 /OpenSim
parent rename terrain for opensim and respective configuration flag that a future c... (diff)
downloadopensim-SC-7cb6ecb9f54415fd723d7b7c85a65eb131aab077.zip
opensim-SC-7cb6ecb9f54415fd723d7b7c85a65eb131aab077.tar.gz
opensim-SC-7cb6ecb9f54415fd723d7b7c85a65eb131aab077.tar.bz2
opensim-SC-7cb6ecb9f54415fd723d7b7c85a65eb131aab077.tar.xz
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
Diffstat (limited to '')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/Scene.cs4
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SceneGraph.cs6
-rw-r--r--OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs7
4 files changed, 13 insertions, 6 deletions
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
1523 m_heartbeatThread = null; 1523 m_heartbeatThread = null;
1524 } 1524 }
1525 1525
1526// m_sceneGraph.PreparePhysicsSimulation(); 1526 // tell physics to finish building actor
1527 1527 m_sceneGraph.ProcessPhysicsPreSimulation();
1528 1528
1529 m_heartbeatThread 1529 m_heartbeatThread
1530 = WorkManager.StartThread( 1530 = 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
222 return PhysicsScene.Simulate((float)elapsed); 222 return PhysicsScene.Simulate((float)elapsed);
223 } 223 }
224 224
225 protected internal void ProcessPhysicsPreSimulation()
226 {
227 if(PhysicsScene != null)
228 PhysicsScene.ProcessPreSimulation();
229 }
230
225 protected internal void UpdateScenePresenceMovement() 231 protected internal void UpdateScenePresenceMovement()
226 { 232 {
227 ForEachScenePresence(delegate(ScenePresence presence) 233 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
290 public abstract void AddPhysicsActorTaint(PhysicsActor prim); 290 public abstract void AddPhysicsActorTaint(PhysicsActor prim);
291 291
292 292
293 public virtual void PrepareSimulation() { } 293 public virtual void ProcessPreSimulation() { }
294 294
295 /// <summary> 295 /// <summary>
296 /// Perform a simulation of the current physics scene over the given timestep. 296 /// 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
1526 } 1526 }
1527 1527
1528 // does all pending changes generated during region load process 1528 // does all pending changes generated during region load process
1529 public override void PrepareSimulation() 1529 public override void ProcessPreSimulation()
1530 { 1530 {
1531 lock (OdeLock) 1531 lock (OdeLock)
1532 { 1532 {
@@ -1541,7 +1541,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1541 int donechanges = 0; 1541 int donechanges = 0;
1542 if (ChangesQueue.Count > 0) 1542 if (ChangesQueue.Count > 0)
1543 { 1543 {
1544 m_log.InfoFormat("[ODE] start processing pending actor operations"); 1544 m_log.InfoFormat("[ubOde] start processing pending actor operations");
1545 int tstart = Util.EnvironmentTickCount(); 1545 int tstart = Util.EnvironmentTickCount();
1546 1546
1547 while (ChangesQueue.Dequeue(out item)) 1547 while (ChangesQueue.Dequeue(out item))
@@ -1564,8 +1564,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1564 donechanges++; 1564 donechanges++;
1565 } 1565 }
1566 int time = Util.EnvironmentTickCountSubtract(tstart); 1566 int time = Util.EnvironmentTickCountSubtract(tstart);
1567 m_log.InfoFormat("[ODE] finished {0} operations in {1}ms", donechanges, time); 1567 m_log.InfoFormat("[ubOde] finished {0} operations in {1}ms", donechanges, time);
1568 } 1568 }
1569 m_log.InfoFormat("[ubOde] {0} prim actors loaded",_prims.Count);
1569 } 1570 }
1570 } 1571 }
1571 1572