aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs71
1 files changed, 37 insertions, 34 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index bff4598..9703eb5 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -1180,15 +1180,14 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1180 //m_log.Debug("[PHYSICS]:ODELOCK"); 1180 //m_log.Debug("[PHYSICS]:ODELOCK");
1181 if (world == IntPtr.Zero) 1181 if (world == IntPtr.Zero)
1182 return; 1182 return;
1183 1183 lock (SimulationLock)
1184 lock (OdeLock) 1184 lock (OdeLock)
1185 { 1185 {
1186 SafeNativeMethods.AllocateODEDataForThread(0); 1186 SafeNativeMethods.AllocateODEDataForThread(0);
1187 ((OdeCharacter) actor).Destroy(); 1187 ((OdeCharacter) actor).Destroy();
1188 } 1188 }
1189 } 1189 }
1190 1190
1191
1192 public void addActivePrim(OdePrim activatePrim) 1191 public void addActivePrim(OdePrim activatePrim)
1193 { 1192 {
1194 // adds active prim.. 1193 // adds active prim..
@@ -1510,7 +1509,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1510 int nodeframes = 0; 1509 int nodeframes = 0;
1511 float fps = 0; 1510 float fps = 0;
1512 1511
1513 lock(OdeLock) 1512 lock (OdeLock)
1514 { 1513 {
1515 if (world == IntPtr.Zero) 1514 if (world == IntPtr.Zero)
1516 { 1515 {
@@ -1548,9 +1547,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1548 { 1547 {
1549 try 1548 try
1550 { 1549 {
1551 lock (SimulationLock) 1550 lock (SimulationLock)
1552 { 1551 {
1553 if (item.actor is OdeCharacter) 1552 if (item.actor is OdeCharacter)
1554 ((OdeCharacter)item.actor).DoAChange(item.what, item.arg); 1553 ((OdeCharacter)item.actor).DoAChange(item.what, item.arg);
1555 else if (((OdePrim)item.actor).DoAChange(item.what, item.arg)) 1554 else if (((OdePrim)item.actor).DoAChange(item.what, item.arg))
1556 RemovePrimThreadLocked((OdePrim)item.actor); 1555 RemovePrimThreadLocked((OdePrim)item.actor);
@@ -1599,17 +1598,17 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1599 } 1598 }
1600 1599
1601 // Move other active objects 1600 // Move other active objects
1602 lock (_activegroups) 1601 lock (SimulationLock)
1603 { 1602 {
1604 foreach (OdePrim aprim in _activegroups) 1603 lock (_activegroups)
1605 { 1604 {
1606 aprim.Move(); 1605 foreach (OdePrim aprim in _activegroups)
1606 {
1607 aprim.Move();
1608 }
1607 } 1609 }
1608 }
1609 // moveTime += Util.GetTimeStampMS() - tmpTime; 1610 // moveTime += Util.GetTimeStampMS() - tmpTime;
1610 // tmpTime = Util.GetTimeStampMS(); 1611 // tmpTime = Util.GetTimeStampMS();
1611 lock (SimulationLock)
1612 {
1613 m_rayCastManager.ProcessQueuedRequests(); 1612 m_rayCastManager.ProcessQueuedRequests();
1614 // rayTime += Util.GetTimeStampMS() - tmpTime; 1613 // rayTime += Util.GetTimeStampMS() - tmpTime;
1615 1614
@@ -1667,37 +1666,41 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1667 SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE); 1666 SafeNativeMethods.WorldQuickStep(world, ODE_STEPSIZE);
1668 SafeNativeMethods.JointGroupEmpty(contactgroup); 1667 SafeNativeMethods.JointGroupEmpty(contactgroup);
1669 } 1668 }
1670// qstepTIme += Util.GetTimeStampMS() - tmpTime; 1669 // qstepTIme += Util.GetTimeStampMS() - tmpTime;
1671 1670
1672 // update managed ideia of physical data and do updates to core 1671 // update managed ideia of physical data and do updates to core
1673 /* 1672 /*
1674 lock (_characters) 1673 lock (_characters)
1675 { 1674 {
1676 foreach (OdeCharacter actor in _characters) 1675 foreach (OdeCharacter actor in _characters)
1677 { 1676 {
1678 if (actor != null) 1677 if (actor != null)
1679 { 1678 {
1680 if (actor.bad) 1679 if (actor.bad)
1681 m_log.WarnFormat("[PHYSICS]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid); 1680 m_log.WarnFormat("[PHYSICS]: BAD Actor {0} in _characters list was not removed?", actor.m_uuid);
1682 1681
1683 actor.UpdatePositionAndVelocity(); 1682 actor.UpdatePositionAndVelocity();
1684 } 1683 }
1685 } 1684 }
1686 } 1685 }
1687 */ 1686 */
1688// tmpTime = Util.GetTimeStampMS(); 1687 // tmpTime = Util.GetTimeStampMS();
1689 lock (_activegroups) 1688 lock (SimulationLock)
1690 { 1689 {
1690 lock (_activegroups)
1691 { 1691 {
1692 foreach (OdePrim actor in _activegroups)
1693 { 1692 {
1694 if (actor.IsPhysical) 1693 foreach (OdePrim actor in _activegroups)
1695 { 1694 {
1696 actor.UpdatePositionAndVelocity(framecount); 1695 if (actor.IsPhysical)
1696 {
1697 actor.UpdatePositionAndVelocity(framecount);
1698 }
1697 } 1699 }
1698 } 1700 }
1699 } 1701 }
1700 } 1702 }
1703
1701// updatesTime += Util.GetTimeStampMS() - tmpTime; 1704// updatesTime += Util.GetTimeStampMS() - tmpTime;
1702 } 1705 }
1703 catch (Exception e) 1706 catch (Exception e)