aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules
diff options
context:
space:
mode:
authorUbitUmarov2015-11-20 00:37:41 +0000
committerUbitUmarov2015-11-20 00:37:41 +0000
commit98a00cbce55d7b880b860f7e95a66e13c5f070b7 (patch)
tree4a1c002a0b3907231d1d2d852183e54996745da5 /OpenSim/Region/PhysicsModules
parentremove unused return value on DeliverMessageTo() (diff)
downloadopensim-SC_OLD-98a00cbce55d7b880b860f7e95a66e13c5f070b7.zip
opensim-SC_OLD-98a00cbce55d7b880b860f7e95a66e13c5f070b7.tar.gz
opensim-SC_OLD-98a00cbce55d7b880b860f7e95a66e13c5f070b7.tar.bz2
opensim-SC_OLD-98a00cbce55d7b880b860f7e95a66e13c5f070b7.tar.xz
ubOde: add threading related calls new ode.dll may need. Hope this doesn't break with current linux ode library
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs6
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs21
2 files changed, 23 insertions, 4 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 1dbf164..24fceb9 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -466,6 +466,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
466 { 466 {
467 lock (_parent_scene.OdeLock) 467 lock (_parent_scene.OdeLock)
468 { 468 {
469 d.AllocateODEDataForThread(0);
470
469 d.Vector3 dtmp; 471 d.Vector3 dtmp;
470 if (!childPrim && Body != IntPtr.Zero) 472 if (!childPrim && Body != IntPtr.Zero)
471 { 473 {
@@ -892,9 +894,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
892 _velocity.Y = 0; 894 _velocity.Y = 0;
893 _velocity.Z = 0; 895 _velocity.Z = 0;
894 896
897 d.AllocateODEDataForThread(0);
898
895 m_lastVelocity = _velocity; 899 m_lastVelocity = _velocity;
896 if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE) 900 if (m_vehicle != null && m_vehicle.Type != Vehicle.TYPE_NONE)
897 m_vehicle.Stop(); 901 m_vehicle.Stop();
898 902
899 if(Body != IntPtr.Zero) 903 if(Body != IntPtr.Zero)
900 d.BodySetLinearVel(Body, 0, 0, 0); // stop it 904 d.BodySetLinearVel(Body, 0, 0, 0); // stop it
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index 61e31a1..aec7ec3 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -366,7 +366,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
366 /// </summary> 366 /// </summary>
367 private void Initialization() 367 private void Initialization()
368 { 368 {
369 // checkThread(); 369 d.AllocateODEDataForThread(~0U);
370
370 SimulationLock = new Object(); 371 SimulationLock = new Object();
371 372
372 nearCallback = near; 373 nearCallback = near;
@@ -1290,7 +1291,11 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1290 public override void RemoveAvatar(PhysicsActor actor) 1291 public override void RemoveAvatar(PhysicsActor actor)
1291 { 1292 {
1292 //m_log.Debug("[PHYSICS]:ODELOCK"); 1293 //m_log.Debug("[PHYSICS]:ODELOCK");
1293 ((OdeCharacter) actor).Destroy(); 1294 lock (OdeLock)
1295 {
1296 d.AllocateODEDataForThread(0);
1297 ((OdeCharacter) actor).Destroy();
1298 }
1294 } 1299 }
1295 1300
1296 1301
@@ -1319,6 +1324,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1319 OdePrim newPrim; 1324 OdePrim newPrim;
1320 lock (OdeLock) 1325 lock (OdeLock)
1321 { 1326 {
1327
1322 newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID); 1328 newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID);
1323 lock (_prims) 1329 lock (_prims)
1324 _prims.Add(newPrim); 1330 _prims.Add(newPrim);
@@ -1547,6 +1553,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1547 return; 1553 return;
1548 } 1554 }
1549 1555
1556 d.AllocateODEDataForThread(~0U);
1557
1550 ODEchangeitem item; 1558 ODEchangeitem item;
1551 1559
1552 int donechanges = 0; 1560 int donechanges = 0;
@@ -1630,7 +1638,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1630 int changestimeMS = 0; 1638 int changestimeMS = 0;
1631 int maxChangestime = (int)(reqTimeStep * 500f); // half the time 1639 int maxChangestime = (int)(reqTimeStep * 500f); // half the time
1632 int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time 1640 int maxLoopTime = (int)(reqTimeStep * 1200f); // 1.2 the time
1633 1641
1642 d.AllocateODEDataForThread(~0U);
1643
1634 if (ChangesQueue.Count > 0) 1644 if (ChangesQueue.Count > 0)
1635 { 1645 {
1636 while (ChangesQueue.Dequeue(out item)) 1646 while (ChangesQueue.Dequeue(out item))
@@ -2260,6 +2270,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2260 2270
2261 lock (OdeLock) 2271 lock (OdeLock)
2262 { 2272 {
2273 d.AllocateODEDataForThread(~0U);
2274
2263 IntPtr GroundGeom = IntPtr.Zero; 2275 IntPtr GroundGeom = IntPtr.Zero;
2264 if (RegionTerrain.TryGetValue(pOffset, out GroundGeom)) 2276 if (RegionTerrain.TryGetValue(pOffset, out GroundGeom))
2265 { 2277 {
@@ -2450,9 +2462,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2450 { 2462 {
2451 lock (OdeLock) 2463 lock (OdeLock)
2452 { 2464 {
2465
2453 if (world == IntPtr.Zero) 2466 if (world == IntPtr.Zero)
2454 return; 2467 return;
2455 2468
2469 d.AllocateODEDataForThread(~0U);
2470
2456 if (m_meshWorker != null) 2471 if (m_meshWorker != null)
2457 m_meshWorker.Stop(); 2472 m_meshWorker.Stop();
2458 2473