diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index cb304b6..4442650 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | using System; | 27 | using System; |
28 | using System.Collections.Generic; | 28 | using System.Collections.Generic; |
29 | using System.Linq; | ||
29 | using System.Reflection; | 30 | using System.Reflection; |
30 | using System.Runtime.InteropServices; | 31 | using System.Runtime.InteropServices; |
31 | using System.Text; | 32 | using System.Text; |
@@ -697,7 +698,21 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
697 | 698 | ||
698 | public override Dictionary<uint, float> GetTopColliders() | 699 | public override Dictionary<uint, float> GetTopColliders() |
699 | { | 700 | { |
700 | return new Dictionary<uint, float>(); | 701 | Dictionary<uint, float> topColliders; |
702 | |||
703 | lock (PhysObjects) | ||
704 | { | ||
705 | foreach (KeyValuePair<uint, BSPhysObject> kvp in PhysObjects) | ||
706 | { | ||
707 | kvp.Value.ComputeCollisionScore(); | ||
708 | } | ||
709 | |||
710 | List<BSPhysObject> orderedPrims = new List<BSPhysObject>(PhysObjects.Values); | ||
711 | orderedPrims.OrderByDescending(p => p.CollisionScore).Take(25); | ||
712 | topColliders = orderedPrims.ToDictionary(p => p.LocalID, p => p.CollisionScore); | ||
713 | } | ||
714 | |||
715 | return topColliders; | ||
701 | } | 716 | } |
702 | 717 | ||
703 | public override bool IsThreaded { get { return false; } } | 718 | public override bool IsThreaded { get { return false; } } |