aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdeScene.cs32
1 files changed, 13 insertions, 19 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
index fa65945..25b3266 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs
@@ -30,20 +30,21 @@
30 30
31using System; 31using System;
32using System.Collections.Generic; 32using System.Collections.Generic;
33using System.Diagnostics;
34using System.IO;
35using System.Linq;
33using System.Reflection; 36using System.Reflection;
34using System.Runtime.InteropServices; 37using System.Runtime.InteropServices;
35using System.Threading; 38using System.Threading;
36using System.IO;
37using System.Diagnostics;
38using log4net; 39using log4net;
39using Nini.Config; 40using Nini.Config;
40using Ode.NET; 41using Ode.NET;
42using OpenMetaverse;
41#if USE_DRAWSTUFF 43#if USE_DRAWSTUFF
42using Drawstuff.NET; 44using Drawstuff.NET;
43#endif 45#endif
44using OpenSim.Framework; 46using OpenSim.Framework;
45using OpenSim.Region.Physics.Manager; 47using OpenSim.Region.Physics.Manager;
46using OpenMetaverse;
47 48
48namespace OpenSim.Region.Physics.OdePlugin 49namespace OpenSim.Region.Physics.OdePlugin
49{ 50{
@@ -3868,26 +3869,19 @@ namespace OpenSim.Region.Physics.OdePlugin
3868 3869
3869 public override Dictionary<uint, float> GetTopColliders() 3870 public override Dictionary<uint, float> GetTopColliders()
3870 { 3871 {
3871 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); 3872 Dictionary<uint, float> topColliders;
3872 int cnt = 0; 3873
3873 lock (_prims) 3874 lock (_prims)
3874 { 3875 {
3875 foreach (OdePrim prm in _prims) 3876 List<OdePrim> orderedPrims = new List<OdePrim>(_prims);
3876 { 3877 orderedPrims.OrderByDescending(p => p.CollisionScore).Take(25);
3877 if (prm.CollisionScore > 0) 3878 topColliders = orderedPrims.ToDictionary(p => p.LocalID, p => p.CollisionScore);
3878 { 3879
3879 returncolliders.Add(prm.LocalID, prm.CollisionScore); 3880 foreach (OdePrim p in _prims)
3880 cnt++; 3881 p.CollisionScore = 0;
3881 prm.CollisionScore = 0f;
3882 if (cnt > 25)
3883 {
3884 break;
3885 }
3886 }
3887 }
3888 } 3882 }
3889 3883
3890 return returncolliders; 3884 return topColliders;
3891 } 3885 }
3892 3886
3893 public override bool SupportsRayCast() 3887 public override bool SupportsRayCast()