aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/OdeScene.cs8
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs60
2 files changed, 39 insertions, 29 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
index c9bc754..5ad2126 100644
--- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
@@ -124,8 +124,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
124 /// /lib/x86_64-linux-gnu/libpthread.so.0(+0xfc60) [0x7f03c9849c60] 124 /// /lib/x86_64-linux-gnu/libpthread.so.0(+0xfc60) [0x7f03c9849c60]
125 /// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82] 125 /// .../opensim/bin/libode-x86_64.so(_Z12dCollideCCTLP6dxGeomS0_iP12dContactGeomi+0x92) [0x7f03b44bcf82]
126 /// </remarks> 126 /// </remarks>
127// internal static Object UniversalColliderSyncObject = new Object(); 127 internal static object UniversalColliderSyncObject = new object();
128 internal static Object SimulationLock = new Object(); 128 internal static object SimulationLock = new object();
129 129
130 /// <summary> 130 /// <summary>
131 /// Is stats collecting enabled for this ODE scene? 131 /// Is stats collecting enabled for this ODE scene?
@@ -880,7 +880,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
880 { 880 {
881 int count; 881 int count;
882 882
883// lock (OdeScene.UniversalColliderSyncObject) 883 lock (OdeScene.UniversalColliderSyncObject)
884 { 884 {
885 // We do this inside the lock so that we don't count any delay in acquiring it 885 // We do this inside the lock so that we don't count any delay in acquiring it
886 if (CollectStats) 886 if (CollectStats)
@@ -2869,7 +2869,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
2869 tempTick = tempTick2; 2869 tempTick = tempTick2;
2870 } 2870 }
2871 2871
2872// lock(SimulationLock) 2872 lock(SimulationLock)
2873 SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); 2873 SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE);
2874 2874
2875 if (CollectStats) 2875 if (CollectStats)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index b53beda..bff4598 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -282,7 +282,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
282 public IntPtr GroundSpace; // space for ground 282 public IntPtr GroundSpace; // space for ground
283 283
284 public object OdeLock = new object(); 284 public object OdeLock = new object();
285// public static object SimulationLock = new object(); 285 public static object SimulationLock = new object();
286 286
287 public IMesher mesher; 287 public IMesher mesher;
288 288
@@ -1134,7 +1134,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1134 1134
1135 public override PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying) 1135 public override PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
1136 { 1136 {
1137 OdeCharacter newAv = new OdeCharacter(localID, avName, this, position, 1137 OdeCharacter newAv = new OdeCharacter(localID, avName, this, position,
1138 size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun); 1138 size, feetOffset, avDensity, avMovementDivisorWalk, avMovementDivisorRun);
1139 newAv.Flying = isFlying; 1139 newAv.Flying = isFlying;
1140 newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset; 1140 newAv.MinimumGroundFlightOffset = minimumGroundFlightOffset;
@@ -1214,7 +1214,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1214 OdePrim newPrim; 1214 OdePrim newPrim;
1215 lock (OdeLock) 1215 lock (OdeLock)
1216 { 1216 {
1217
1218 newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID); 1217 newPrim = new OdePrim(name, this, position, size, rotation, pbs, isphysical, isPhantom, shapeType, localID);
1219 } 1218 }
1220 return newPrim; 1219 return newPrim;
@@ -1453,10 +1452,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1453 { 1452 {
1454 try 1453 try
1455 { 1454 {
1456 if (item.actor is OdeCharacter) 1455 lock (SimulationLock)
1457 ((OdeCharacter)item.actor).DoAChange(item.what, item.arg); 1456 {
1458 else if (((OdePrim)item.actor).DoAChange(item.what, item.arg)) 1457 if (item.actor is OdeCharacter)
1459 RemovePrimThreadLocked((OdePrim)item.actor); 1458 ((OdeCharacter)item.actor).DoAChange(item.what, item.arg);
1459 else if (((OdePrim)item.actor).DoAChange(item.what, item.arg))
1460 RemovePrimThreadLocked((OdePrim)item.actor);
1461 }
1460 } 1462 }
1461 catch 1463 catch
1462 { 1464 {
@@ -1546,10 +1548,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1546 { 1548 {
1547 try 1549 try
1548 { 1550 {
1549 if (item.actor is OdeCharacter) 1551 lock (SimulationLock)
1550 ((OdeCharacter)item.actor).DoAChange(item.what, item.arg); 1552 {
1551 else if (((OdePrim)item.actor).DoAChange(item.what, item.arg)) 1553 if (item.actor is OdeCharacter)
1552 RemovePrimThreadLocked((OdePrim)item.actor); 1554 ((OdeCharacter)item.actor).DoAChange(item.what, item.arg);
1555 else if (((OdePrim)item.actor).DoAChange(item.what, item.arg))
1556 RemovePrimThreadLocked((OdePrim)item.actor);
1557 }
1553 } 1558 }
1554 catch 1559 catch
1555 { 1560 {
@@ -1601,17 +1606,19 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1601 aprim.Move(); 1606 aprim.Move();
1602 } 1607 }
1603 } 1608 }
1604// moveTime += Util.GetTimeStampMS() - tmpTime; 1609 // moveTime += Util.GetTimeStampMS() - tmpTime;
1605 1610 // tmpTime = Util.GetTimeStampMS();
1606// tmpTime = Util.GetTimeStampMS(); 1611 lock (SimulationLock)
1607 m_rayCastManager.ProcessQueuedRequests(); 1612 {
1608// rayTime += Util.GetTimeStampMS() - tmpTime; 1613 m_rayCastManager.ProcessQueuedRequests();
1614 // rayTime += Util.GetTimeStampMS() - tmpTime;
1609 1615
1610// tmpTime = Util.GetTimeStampMS(); 1616 // tmpTime = Util.GetTimeStampMS();
1611 collision_optimized(); 1617 collision_optimized();
1612// collisionTime += Util.GetTimeStampMS() - tmpTime; 1618 }
1619 // collisionTime += Util.GetTimeStampMS() - tmpTime;
1613 1620
1614// tmpTime = Util.GetTimeStampMS(); 1621 // tmpTime = Util.GetTimeStampMS();
1615 lock(_collisionEventPrimRemove) 1622 lock(_collisionEventPrimRemove)
1616 { 1623 {
1617 foreach (PhysicsActor obj in _collisionEventPrimRemove) 1624 foreach (PhysicsActor obj in _collisionEventPrimRemove)
@@ -1650,13 +1657,16 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1650 foreach(OdePrim prm in sleepers) 1657 foreach(OdePrim prm in sleepers)
1651 prm.SleeperAddCollisionEvents(); 1658 prm.SleeperAddCollisionEvents();
1652 sleepers.Clear(); 1659 sleepers.Clear();
1653// collisonRepo += Util.GetTimeStampMS() - tmpTime; 1660 // collisonRepo += Util.GetTimeStampMS() - tmpTime;
1661
1654 1662
1655
1656 // do a ode simulation step 1663 // do a ode simulation step
1657// tmpTime = Util.GetTimeStampMS(); 1664 // tmpTime = Util.GetTimeStampMS();
1658 SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); 1665 lock (SimulationLock)
1659 SafeNativeMethods.JointGroupEmpty(contactgroup); 1666 {
1667 SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE);
1668 SafeNativeMethods.JointGroupEmpty(contactgroup);
1669 }
1660// qstepTIme += Util.GetTimeStampMS() - tmpTime; 1670// qstepTIme += Util.GetTimeStampMS() - tmpTime;
1661 1671
1662 // update managed ideia of physical data and do updates to core 1672 // update managed ideia of physical data and do updates to core