aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
authorTeravus Ovares2008-05-25 11:22:05 +0000
committerTeravus Ovares2008-05-25 11:22:05 +0000
commit042c9ed4d82e4389ec929f5438e82defad251235 (patch)
tree002d741e83cec0ee1a715603af7af5aacb5d079a /OpenSim/Region/Physics/OdePlugin
parent* phantom sculpties don't request the sculpt texture anymore. (diff)
downloadopensim-SC_OLD-042c9ed4d82e4389ec929f5438e82defad251235.zip
opensim-SC_OLD-042c9ed4d82e4389ec929f5438e82defad251235.tar.gz
opensim-SC_OLD-042c9ed4d82e4389ec929f5438e82defad251235.tar.bz2
opensim-SC_OLD-042c9ed4d82e4389ec929f5438e82defad251235.tar.xz
* Adds Top Colliders when using ODE. Access it from the estate tools/debug tab.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs1
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs5
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs30
3 files changed, 34 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 5024b5d..89162a0 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -570,6 +570,7 @@ namespace OpenSim.Region.Physics.OdePlugin
570 public override float CollisionScore 570 public override float CollisionScore
571 { 571 {
572 get { return 0f; } 572 get { return 0f; }
573 set { }
573 } 574 }
574 575
575 public override bool Kinematic 576 public override bool Kinematic
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 4c8eb20..6ade638 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -124,7 +124,7 @@ namespace OpenSim.Region.Physics.OdePlugin
124 private bool m_throttleUpdates = false; 124 private bool m_throttleUpdates = false;
125 private int throttleCounter = 0; 125 private int throttleCounter = 0;
126 public int m_interpenetrationcount = 0; 126 public int m_interpenetrationcount = 0;
127 public int m_collisionscore = 0; 127 public float m_collisionscore = 0;
128 public int m_roundsUnderMotionThreshold = 0; 128 public int m_roundsUnderMotionThreshold = 0;
129 private int m_crossingfailures = 0; 129 private int m_crossingfailures = 0;
130 130
@@ -243,7 +243,7 @@ namespace OpenSim.Region.Physics.OdePlugin
243 // is physical or the object is modified somehow *IN THE FUTURE* 243 // is physical or the object is modified somehow *IN THE FUTURE*
244 // without this, if an avatar selects prim, they can walk right 244 // without this, if an avatar selects prim, they can walk right
245 // through it while it's selected 245 // through it while it's selected
246 246 m_collisionscore = 0;
247 if ((m_isphysical && !_zeroFlag) || !value) 247 if ((m_isphysical && !_zeroFlag) || !value)
248 { 248 {
249 m_taintselected = value; 249 m_taintselected = value;
@@ -1783,6 +1783,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1783 public override float CollisionScore 1783 public override float CollisionScore
1784 { 1784 {
1785 get { return m_collisionscore; } 1785 get { return m_collisionscore; }
1786 set { m_collisionscore = value; }
1786 } 1787 }
1787 1788
1788 public override bool Kinematic 1789 public override bool Kinematic
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index fef0c4e..e43a1ac 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -555,6 +555,13 @@ namespace OpenSim.Region.Physics.OdePlugin
555 } 555 }
556 556
557 float max_collision_depth = 0f; 557 float max_collision_depth = 0f;
558 if (p1.CollisionScore + count >= float.MaxValue)
559 p1.CollisionScore = 0;
560 p1.CollisionScore += count;
561
562 if (p2.CollisionScore + count >= float.MaxValue)
563 p2.CollisionScore = 0;
564 p2.CollisionScore += count;
558 565
559 for (int i = 0; i < count; i++) 566 for (int i = 0; i < count; i++)
560 { 567 {
@@ -585,6 +592,7 @@ namespace OpenSim.Region.Physics.OdePlugin
585 p2.CollidingGround = true; 592 p2.CollidingGround = true;
586 break; 593 break;
587 } 594 }
595
588 596
589 // we don't want prim or avatar to explode 597 // we don't want prim or avatar to explode
590 598
@@ -2162,5 +2170,27 @@ namespace OpenSim.Region.Physics.OdePlugin
2162 //d.CloseODE(); 2170 //d.CloseODE();
2163 } 2171 }
2164 } 2172 }
2173 public override Dictionary<uint, float> GetTopColliders()
2174 {
2175 Dictionary<uint, float> returncolliders = new Dictionary<uint, float>();
2176 int cnt = 0;
2177 lock (_prims)
2178 {
2179 foreach (OdePrim prm in _prims)
2180 {
2181 if (prm.CollisionScore > 0)
2182 {
2183 returncolliders.Add(prm.m_localID, prm.CollisionScore);
2184 cnt++;
2185 prm.CollisionScore = 0f;
2186 if (cnt > 25)
2187 {
2188 break;
2189 }
2190 }
2191 }
2192 }
2193 return returncolliders;
2194 }
2165 } 2195 }
2166} 2196}