From 54789706f40d0800d1277eeb71afd61edcefd9ab Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 21 Nov 2011 19:45:22 +0000 Subject: Reduce complexity of OdeScene.Simulate() by fully removing bad characters at point of detection rather than later on. --- OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 42 +--------------------------- 1 file changed, 1 insertion(+), 41 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs') diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index 05455dc..9c3c077 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -194,14 +194,6 @@ namespace OpenSim.Region.Physics.OdePlugin private readonly HashSet _activeprims = new HashSet(); /// - /// Defects list to remove characters that no longer have finite positions due to some other bug. - /// - /// - /// Used repeatedly in Simulate() but initialized once here. - /// - private readonly List defects = new List(); - - /// /// Used to lock on manipulation of _taintedPrimL and _taintedPrimH /// private readonly Object _taintedPrimLock = new Object(); @@ -236,8 +228,6 @@ namespace OpenSim.Region.Physics.OdePlugin /// A dictionary of collision event changes that are waiting to be processed. /// private readonly Dictionary _collisionEventPrimChanges = new Dictionary(); - - private readonly HashSet _badCharacter = new HashSet(); /// /// Maps a unique geometry id (a memory location) to a physics actor name. @@ -1736,15 +1726,6 @@ namespace OpenSim.Region.Physics.OdePlugin } } - internal void BadCharacter(OdeCharacter chr) - { - lock (_badCharacter) - { - if (!_badCharacter.Contains(chr)) - _badCharacter.Add(chr); - } - } - private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, PrimitiveBaseShape pbs, bool isphysical, uint localID) { @@ -2805,15 +2786,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); foreach (OdeCharacter actor in _characters) { if (actor != null) - actor.Move(defects); - } - - if (0 != defects.Count) - { - foreach (OdeCharacter defect in defects) - RemoveCharacter(defect); - - defects.Clear(); + actor.Move(); } } @@ -2885,19 +2858,6 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); } } - lock (_badCharacter) - { - if (_badCharacter.Count > 0) - { - foreach (OdeCharacter chr in _badCharacter) - { - RemoveCharacter(chr); - } - - _badCharacter.Clear(); - } - } - lock (_activeprims) { //if (timeStep < 0.2f) -- cgit v1.1