diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 40 |
1 files changed, 27 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index ba289f7..0a065be 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -238,7 +238,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
238 | private readonly HashSet<OdeCharacter> _characters = new HashSet<OdeCharacter>(); | 238 | private readonly HashSet<OdeCharacter> _characters = new HashSet<OdeCharacter>(); |
239 | private readonly HashSet<OdePrim> _prims = new HashSet<OdePrim>(); | 239 | private readonly HashSet<OdePrim> _prims = new HashSet<OdePrim>(); |
240 | private readonly HashSet<OdePrim> _activeprims = new HashSet<OdePrim>(); | 240 | private readonly HashSet<OdePrim> _activeprims = new HashSet<OdePrim>(); |
241 | private readonly HashSet<OdePrim> _taintedPrim = new HashSet<OdePrim>(); | 241 | private readonly HashSet<OdePrim> _taintedPrimH = new HashSet<OdePrim>(); |
242 | private readonly List<OdePrim> _taintedPrimL = new List<OdePrim>(); | ||
242 | private readonly HashSet<OdeCharacter> _taintedActors = new HashSet<OdeCharacter>(); | 243 | private readonly HashSet<OdeCharacter> _taintedActors = new HashSet<OdeCharacter>(); |
243 | private readonly List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>(); | 244 | private readonly List<d.ContactGeom> _perloopContact = new List<d.ContactGeom>(); |
244 | private readonly List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>(); | 245 | private readonly List<PhysicsActor> _collisionEventPrim = new List<PhysicsActor>(); |
@@ -2123,6 +2124,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2123 | /// <param name="prim"></param> | 2124 | /// <param name="prim"></param> |
2124 | public void RemovePrimThreadLocked(OdePrim prim) | 2125 | public void RemovePrimThreadLocked(OdePrim prim) |
2125 | { | 2126 | { |
2127 | //Console.WriteLine("RemovePrimThreadLocked " + prim.m_primName); | ||
2126 | lock (prim) | 2128 | lock (prim) |
2127 | { | 2129 | { |
2128 | remCollisionEventReporting(prim); | 2130 | remCollisionEventReporting(prim); |
@@ -2570,11 +2572,15 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2570 | if (prim is OdePrim) | 2572 | if (prim is OdePrim) |
2571 | { | 2573 | { |
2572 | OdePrim taintedprim = ((OdePrim) prim); | 2574 | OdePrim taintedprim = ((OdePrim) prim); |
2573 | lock (_taintedPrim) | 2575 | lock (_taintedPrimH) |
2574 | { | 2576 | { |
2575 | if (!(_taintedPrim.Contains(taintedprim))) | 2577 | if (!(_taintedPrimH.Contains(taintedprim))) |
2576 | _taintedPrim.Add(taintedprim); | 2578 | { |
2577 | } | 2579 | //Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.m_primName); |
2580 | _taintedPrimH.Add(taintedprim); // HashSet for searching | ||
2581 | _taintedPrimL.Add(taintedprim); // List for ordered readout | ||
2582 | } | ||
2583 | } | ||
2578 | return; | 2584 | return; |
2579 | } | 2585 | } |
2580 | else if (prim is OdeCharacter) | 2586 | else if (prim is OdeCharacter) |
@@ -2614,7 +2620,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2614 | float fps = 0; | 2620 | float fps = 0; |
2615 | //m_log.Info(timeStep.ToString()); | 2621 | //m_log.Info(timeStep.ToString()); |
2616 | step_time += timeStep; | 2622 | step_time += timeStep; |
2617 | 2623 | ||
2618 | // If We're loaded down by something else, | 2624 | // If We're loaded down by something else, |
2619 | // or debugging with the Visual Studio project on pause | 2625 | // or debugging with the Visual Studio project on pause |
2620 | // skip a few frames to catch up gracefully. | 2626 | // skip a few frames to catch up gracefully. |
@@ -2694,16 +2700,20 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2694 | // Modify other objects in the scene. | 2700 | // Modify other objects in the scene. |
2695 | processedtaints = false; | 2701 | processedtaints = false; |
2696 | 2702 | ||
2697 | lock (_taintedPrim) | 2703 | lock (_taintedPrimL) |
2698 | { | 2704 | { |
2699 | foreach (OdePrim prim in _taintedPrim) | 2705 | foreach (OdePrim prim in _taintedPrimL) |
2700 | { | 2706 | { |
2707 | |||
2708 | |||
2701 | if (prim.m_taintremove) | 2709 | if (prim.m_taintremove) |
2702 | { | 2710 | { |
2711 | //Console.WriteLine("Simulate calls RemovePrimThreadLocked"); | ||
2703 | RemovePrimThreadLocked(prim); | 2712 | RemovePrimThreadLocked(prim); |
2704 | } | 2713 | } |
2705 | else | 2714 | else |
2706 | { | 2715 | { |
2716 | //Console.WriteLine("Simulate calls ProcessTaints"); | ||
2707 | prim.ProcessTaints(timeStep); | 2717 | prim.ProcessTaints(timeStep); |
2708 | } | 2718 | } |
2709 | processedtaints = true; | 2719 | processedtaints = true; |
@@ -2893,7 +2903,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2893 | } | 2903 | } |
2894 | 2904 | ||
2895 | if (processedtaints) | 2905 | if (processedtaints) |
2896 | _taintedPrim.Clear(); | 2906 | //Console.WriteLine("Simulate calls Clear of _taintedPrim list"); |
2907 | _taintedPrimH.Clear(); | ||
2908 | _taintedPrimL.Clear(); | ||
2897 | } | 2909 | } |
2898 | 2910 | ||
2899 | // Move characters | 2911 | // Move characters |
@@ -3508,7 +3520,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3508 | public override void UnCombine(PhysicsScene pScene) | 3520 | public override void UnCombine(PhysicsScene pScene) |
3509 | { | 3521 | { |
3510 | IntPtr localGround = IntPtr.Zero; | 3522 | IntPtr localGround = IntPtr.Zero; |
3511 | //float[] localHeightfield; | 3523 | float[] localHeightfield; |
3512 | bool proceed = false; | 3524 | bool proceed = false; |
3513 | List<IntPtr> geomDestroyList = new List<IntPtr>(); | 3525 | List<IntPtr> geomDestroyList = new List<IntPtr>(); |
3514 | 3526 | ||
@@ -3520,7 +3532,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3520 | { | 3532 | { |
3521 | if (geom == localGround) | 3533 | if (geom == localGround) |
3522 | { | 3534 | { |
3523 | //localHeightfield = TerrainHeightFieldHeights[geom]; | 3535 | localHeightfield = TerrainHeightFieldHeights[geom]; |
3524 | proceed = true; | 3536 | proceed = true; |
3525 | } | 3537 | } |
3526 | else | 3538 | else |
@@ -3542,7 +3554,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3542 | // memory corruption | 3554 | // memory corruption |
3543 | if (TerrainHeightFieldHeights.ContainsKey(g)) | 3555 | if (TerrainHeightFieldHeights.ContainsKey(g)) |
3544 | { | 3556 | { |
3545 | //float[] removingHeightField = TerrainHeightFieldHeights[g]; | 3557 | float[] removingHeightField = TerrainHeightFieldHeights[g]; |
3546 | TerrainHeightFieldHeights.Remove(g); | 3558 | TerrainHeightFieldHeights.Remove(g); |
3547 | 3559 | ||
3548 | if (RegionTerrain.ContainsKey(g)) | 3560 | if (RegionTerrain.ContainsKey(g)) |
@@ -3554,10 +3566,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3554 | //removingHeightField = new float[0]; | 3566 | //removingHeightField = new float[0]; |
3555 | } | 3567 | } |
3556 | } | 3568 | } |
3569 | |||
3557 | } | 3570 | } |
3558 | else | 3571 | else |
3559 | { | 3572 | { |
3560 | m_log.Warn("[PHYSICS]: Couldn't proceed with UnCombine. Region has inconsistant data."); | 3573 | m_log.Warn("[PHYSICS]: Couldn't proceed with UnCombine. Region has inconsistant data."); |
3574 | |||
3561 | } | 3575 | } |
3562 | } | 3576 | } |
3563 | } | 3577 | } |