aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2013-01-25 16:00:17 -0800
committerRobert Adams2013-01-27 12:50:05 -0800
commitddef8f16e58471d19baa63f14134b25309cf2570 (patch)
treef7f520bf8613ff818701392958572f73f4b2b91e /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentBulletSim: parameterize several vehicle debugging values: physical linear and... (diff)
downloadopensim-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.cs17
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 */
27using System; 27using System;
28using System.Collections.Generic; 28using System.Collections.Generic;
29using System.Linq;
29using System.Reflection; 30using System.Reflection;
30using System.Runtime.InteropServices; 31using System.Runtime.InteropServices;
31using System.Text; 32using 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; } }