From 827b0fb1993c6f9b1289931a1ac38ff2b810952c Mon Sep 17 00:00:00 2001 From: opensim Date: Wed, 30 Sep 2009 18:51:02 +0200 Subject: Commit initial version of KittoFlora's vehicle changes --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 54 +++++++++++++++++++-------- 1 file changed, 38 insertions(+), 16 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 94223d8..b7afa27 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -238,7 +238,8 @@ namespace OpenSim.Region.Physics.OdePlugin private readonly HashSet _characters = new HashSet(); private readonly HashSet _prims = new HashSet(); private readonly HashSet _activeprims = new HashSet(); - private readonly HashSet _taintedPrim = new HashSet(); + private readonly HashSet _taintedPrimH = new HashSet(); + private readonly List _taintedPrimL = new List(); private readonly HashSet _taintedActors = new HashSet(); private readonly List _perloopContact = new List(); private readonly List _collisionEventPrim = new List(); @@ -2112,6 +2113,7 @@ namespace OpenSim.Region.Physics.OdePlugin /// public void RemovePrimThreadLocked(OdePrim prim) { +//Console.WriteLine("RemovePrimThreadLocked " + prim.m_primName); lock (prim) { remCollisionEventReporting(prim); @@ -2559,11 +2561,15 @@ namespace OpenSim.Region.Physics.OdePlugin if (prim is OdePrim) { OdePrim taintedprim = ((OdePrim) prim); - lock (_taintedPrim) - { - if (!(_taintedPrim.Contains(taintedprim))) - _taintedPrim.Add(taintedprim); - } + lock (_taintedPrimH) + { + if (!(_taintedPrimH.Contains(taintedprim))) + { +//Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.m_primName); + _taintedPrimH.Add(taintedprim); // HashSet for searching + _taintedPrimL.Add(taintedprim); // List for ordered readout + } + } return; } else if (prim is OdeCharacter) @@ -2599,7 +2605,7 @@ namespace OpenSim.Region.Physics.OdePlugin float fps = 0; //m_log.Info(timeStep.ToString()); step_time += timeStep; - + // If We're loaded down by something else, // or debugging with the Visual Studio project on pause // skip a few frames to catch up gracefully. @@ -2679,16 +2685,20 @@ namespace OpenSim.Region.Physics.OdePlugin // Modify other objects in the scene. processedtaints = false; - lock (_taintedPrim) + lock (_taintedPrimL) { - foreach (OdePrim prim in _taintedPrim) + foreach (OdePrim prim in _taintedPrimL) { + + if (prim.m_taintremove) { +//Console.WriteLine("Simulate calls RemovePrimThreadLocked"); RemovePrimThreadLocked(prim); } else { +//Console.WriteLine("Simulate calls ProcessTaints"); prim.ProcessTaints(timeStep); } processedtaints = true; @@ -2878,7 +2888,9 @@ namespace OpenSim.Region.Physics.OdePlugin } if (processedtaints) - _taintedPrim.Clear(); +//Console.WriteLine("Simulate calls Clear of _taintedPrim list"); + _taintedPrimH.Clear(); + _taintedPrimL.Clear(); } // Move characters @@ -3488,7 +3500,7 @@ namespace OpenSim.Region.Physics.OdePlugin { if (geom == localGround) { - //localHeightfield = TerrainHeightFieldHeights[geom]; + localHeightfield = TerrainHeightFieldHeights[geom]; proceed = true; } else @@ -3510,7 +3522,7 @@ namespace OpenSim.Region.Physics.OdePlugin // memory corruption if (TerrainHeightFieldHeights.ContainsKey(g)) { - //float[] removingHeightField = TerrainHeightFieldHeights[g]; + float[] removingHeightField = TerrainHeightFieldHeights[g]; TerrainHeightFieldHeights.Remove(g); if (RegionTerrain.ContainsKey(g)) @@ -3519,17 +3531,27 @@ namespace OpenSim.Region.Physics.OdePlugin } d.GeomDestroy(g); - //removingHeightField = new float[0]; - } + removingHeightField = new float[0]; + + + + } + } + } else { m_log.Warn("[PHYSICS]: Couldn't proceed with UnCombine. Region has inconsistant data."); + } - } + + } + } - } + } + + public override void SetWaterLevel(float baseheight) { -- cgit v1.1 From d06c7d90a167c1bc9cf71f17d2d40ad84ec1fe10 Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 7 Oct 2009 06:56:00 +0100 Subject: Correct a build break caused by an optimization in trunk --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdePlugin.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index c02b123..57e1349 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -3488,7 +3488,7 @@ namespace OpenSim.Region.Physics.OdePlugin public override void UnCombine(PhysicsScene pScene) { IntPtr localGround = IntPtr.Zero; - //float[] localHeightfield; + float[] localHeightfield; bool proceed = false; List geomDestroyList = new List(); -- cgit v1.1