diff options
author | UbitUmarov | 2019-01-21 08:34:19 +0000 |
---|---|---|
committer | UbitUmarov | 2019-01-21 08:34:19 +0000 |
commit | 44d6746f406445ca0db453ede44936a683a27386 (patch) | |
tree | 970e6c0bbc88d878fe276316671efb52c072644e /OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |
parent | change float to byte rounding (diff) | |
download | opensim-SC-44d6746f406445ca0db453ede44936a683a27386.zip opensim-SC-44d6746f406445ca0db453ede44936a683a27386.tar.gz opensim-SC-44d6746f406445ca0db453ede44936a683a27386.tar.bz2 opensim-SC-44d6746f406445ca0db453ede44936a683a27386.tar.xz |
well.. put the ode locks back, for now
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 60 |
1 files changed, 35 insertions, 25 deletions
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 |