diff options
author | Robert Adams | 2013-01-25 16:00:17 -0800 |
---|---|---|
committer | Robert Adams | 2013-01-27 12:50:05 -0800 |
commit | ddef8f16e58471d19baa63f14134b25309cf2570 (patch) | |
tree | f7f520bf8613ff818701392958572f73f4b2b91e /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |
parent | BulletSim: parameterize several vehicle debugging values: physical linear and... (diff) | |
download | opensim-SC_OLD-ddef8f16e58471d19baa63f14134b25309cf2570.zip opensim-SC_OLD-ddef8f16e58471d19baa63f14134b25309cf2570.tar.gz opensim-SC_OLD-ddef8f16e58471d19baa63f14134b25309cf2570.tar.bz2 opensim-SC_OLD-ddef8f16e58471d19baa63f14134b25309cf2570.tar.xz |
BulletSim: first attempt at reporting top colliders
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; } } |