diff options
author | Justin Clark-Casey (justincc) | 2011-11-21 19:45:22 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-11-21 19:45:22 +0000 |
commit | 54789706f40d0800d1277eeb71afd61edcefd9ab (patch) | |
tree | 1b486ad115731aeb117aa6a0da1f601b3147573e /OpenSim/Region/Physics/OdePlugin/OdeScene.cs | |
parent | move geom/actor map maintenance into DestroyODEStructures()/AvatarGeomAndBody... (diff) | |
download | opensim-SC-54789706f40d0800d1277eeb71afd61edcefd9ab.zip opensim-SC-54789706f40d0800d1277eeb71afd61edcefd9ab.tar.gz opensim-SC-54789706f40d0800d1277eeb71afd61edcefd9ab.tar.bz2 opensim-SC-54789706f40d0800d1277eeb71afd61edcefd9ab.tar.xz |
Reduce complexity of OdeScene.Simulate() by fully removing bad characters at point of detection rather than later on.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/OdeScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdeScene.cs | 42 |
1 files changed, 1 insertions, 41 deletions
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 | |||
194 | private readonly HashSet<OdePrim> _activeprims = new HashSet<OdePrim>(); | 194 | private readonly HashSet<OdePrim> _activeprims = new HashSet<OdePrim>(); |
195 | 195 | ||
196 | /// <summary> | 196 | /// <summary> |
197 | /// Defects list to remove characters that no longer have finite positions due to some other bug. | ||
198 | /// </summary> | ||
199 | /// <remarks> | ||
200 | /// Used repeatedly in Simulate() but initialized once here. | ||
201 | /// </remarks> | ||
202 | private readonly List<OdeCharacter> defects = new List<OdeCharacter>(); | ||
203 | |||
204 | /// <summary> | ||
205 | /// Used to lock on manipulation of _taintedPrimL and _taintedPrimH | 197 | /// Used to lock on manipulation of _taintedPrimL and _taintedPrimH |
206 | /// </summary> | 198 | /// </summary> |
207 | private readonly Object _taintedPrimLock = new Object(); | 199 | private readonly Object _taintedPrimLock = new Object(); |
@@ -236,8 +228,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
236 | /// A dictionary of collision event changes that are waiting to be processed. | 228 | /// A dictionary of collision event changes that are waiting to be processed. |
237 | /// </summary> | 229 | /// </summary> |
238 | private readonly Dictionary<uint, PhysicsActor> _collisionEventPrimChanges = new Dictionary<uint, PhysicsActor>(); | 230 | private readonly Dictionary<uint, PhysicsActor> _collisionEventPrimChanges = new Dictionary<uint, PhysicsActor>(); |
239 | |||
240 | private readonly HashSet<OdeCharacter> _badCharacter = new HashSet<OdeCharacter>(); | ||
241 | 231 | ||
242 | /// <summary> | 232 | /// <summary> |
243 | /// Maps a unique geometry id (a memory location) to a physics actor name. | 233 | /// Maps a unique geometry id (a memory location) to a physics actor name. |
@@ -1736,15 +1726,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1736 | } | 1726 | } |
1737 | } | 1727 | } |
1738 | 1728 | ||
1739 | internal void BadCharacter(OdeCharacter chr) | ||
1740 | { | ||
1741 | lock (_badCharacter) | ||
1742 | { | ||
1743 | if (!_badCharacter.Contains(chr)) | ||
1744 | _badCharacter.Add(chr); | ||
1745 | } | ||
1746 | } | ||
1747 | |||
1748 | private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, | 1729 | private PhysicsActor AddPrim(String name, Vector3 position, Vector3 size, Quaternion rotation, |
1749 | PrimitiveBaseShape pbs, bool isphysical, uint localID) | 1730 | PrimitiveBaseShape pbs, bool isphysical, uint localID) |
1750 | { | 1731 | { |
@@ -2805,15 +2786,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); | |||
2805 | foreach (OdeCharacter actor in _characters) | 2786 | foreach (OdeCharacter actor in _characters) |
2806 | { | 2787 | { |
2807 | if (actor != null) | 2788 | if (actor != null) |
2808 | actor.Move(defects); | 2789 | actor.Move(); |
2809 | } | ||
2810 | |||
2811 | if (0 != defects.Count) | ||
2812 | { | ||
2813 | foreach (OdeCharacter defect in defects) | ||
2814 | RemoveCharacter(defect); | ||
2815 | |||
2816 | defects.Clear(); | ||
2817 | } | 2790 | } |
2818 | } | 2791 | } |
2819 | 2792 | ||
@@ -2885,19 +2858,6 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); | |||
2885 | } | 2858 | } |
2886 | } | 2859 | } |
2887 | 2860 | ||
2888 | lock (_badCharacter) | ||
2889 | { | ||
2890 | if (_badCharacter.Count > 0) | ||
2891 | { | ||
2892 | foreach (OdeCharacter chr in _badCharacter) | ||
2893 | { | ||
2894 | RemoveCharacter(chr); | ||
2895 | } | ||
2896 | |||
2897 | _badCharacter.Clear(); | ||
2898 | } | ||
2899 | } | ||
2900 | |||
2901 | lock (_activeprims) | 2861 | lock (_activeprims) |
2902 | { | 2862 | { |
2903 | //if (timeStep < 0.2f) | 2863 | //if (timeStep < 0.2f) |