diff options
author | UbitUmarov | 2016-08-22 20:28:15 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-22 20:28:15 +0100 |
commit | 133fce98e79eced53bb68adc73749adf176cfccd (patch) | |
tree | d038c524f3c50e338baca67d2ace14dd740128ea /OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | |
parent | try to make mono happy (diff) | |
download | opensim-SC_OLD-133fce98e79eced53bb68adc73749adf176cfccd.zip opensim-SC_OLD-133fce98e79eced53bb68adc73749adf176cfccd.tar.gz opensim-SC_OLD-133fce98e79eced53bb68adc73749adf176cfccd.tar.bz2 opensim-SC_OLD-133fce98e79eced53bb68adc73749adf176cfccd.tar.xz |
change ODEs topcolliders code ( still bad), plus a few memory leaks
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 8f9bccb..7021a05 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | |||
@@ -3452,6 +3452,11 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3452 | } | 3452 | } |
3453 | } | 3453 | } |
3454 | 3454 | ||
3455 | private int compareByCollisionsDesc(OdePrim A, OdePrim B) | ||
3456 | { | ||
3457 | return -A.CollisionScore.CompareTo(B.CollisionScore); | ||
3458 | } | ||
3459 | |||
3455 | public override Dictionary<uint, float> GetTopColliders() | 3460 | public override Dictionary<uint, float> GetTopColliders() |
3456 | { | 3461 | { |
3457 | Dictionary<uint, float> topColliders; | 3462 | Dictionary<uint, float> topColliders; |
@@ -3459,7 +3464,7 @@ namespace OpenSim.Region.PhysicsModule.ODE | |||
3459 | lock (_prims) | 3464 | lock (_prims) |
3460 | { | 3465 | { |
3461 | List<OdePrim> orderedPrims = new List<OdePrim>(_prims); | 3466 | List<OdePrim> orderedPrims = new List<OdePrim>(_prims); |
3462 | orderedPrims.OrderByDescending(p => p.CollisionScore); | 3467 | orderedPrims.Sort(compareByCollisionsDesc); |
3463 | topColliders = orderedPrims.Take(25).ToDictionary(p => p.LocalID, p => p.CollisionScore); | 3468 | topColliders = orderedPrims.Take(25).ToDictionary(p => p.LocalID, p => p.CollisionScore); |
3464 | 3469 | ||
3465 | foreach (OdePrim p in _prims) | 3470 | foreach (OdePrim p in _prims) |