diff options
author | Teravus Ovares | 2008-05-25 11:22:05 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-05-25 11:22:05 +0000 |
commit | 042c9ed4d82e4389ec929f5438e82defad251235 (patch) | |
tree | 002d741e83cec0ee1a715603af7af5aacb5d079a /OpenSim/Region/Physics | |
parent | * phantom sculpties don't request the sculpt texture anymore. (diff) | |
download | opensim-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')
9 files changed, 76 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs index d7c4013..ee30e54 100644 --- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs +++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs | |||
@@ -198,6 +198,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
198 | public override void DeleteTerrain() | 198 | public override void DeleteTerrain() |
199 | { | 199 | { |
200 | } | 200 | } |
201 | public override Dictionary<uint, float> GetTopColliders() | ||
202 | { | ||
203 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); | ||
204 | return returncolliders; | ||
205 | } | ||
201 | } | 206 | } |
202 | 207 | ||
203 | public class BasicActor : PhysicsActor | 208 | public class BasicActor : PhysicsActor |
@@ -348,6 +353,7 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin | |||
348 | public override float CollisionScore | 353 | public override float CollisionScore |
349 | { | 354 | { |
350 | get { return 0f; } | 355 | get { return 0f; } |
356 | set { } | ||
351 | } | 357 | } |
352 | 358 | ||
353 | public override Quaternion Orientation | 359 | public override Quaternion Orientation |
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs index fcff04e..1fa759c 100644 --- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs +++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs | |||
@@ -549,6 +549,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
549 | 549 | ||
550 | } | 550 | } |
551 | 551 | ||
552 | public override Dictionary<uint, float> GetTopColliders() | ||
553 | { | ||
554 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); | ||
555 | return returncolliders; | ||
556 | } | ||
557 | |||
552 | public override void SetWaterLevel(float baseheight) | 558 | public override void SetWaterLevel(float baseheight) |
553 | { | 559 | { |
554 | 560 | ||
@@ -917,6 +923,7 @@ namespace OpenSim.Region.Physics.BulletXPlugin | |||
917 | public override float CollisionScore | 923 | public override float CollisionScore |
918 | { | 924 | { |
919 | get { return 0f; } | 925 | get { return 0f; } |
926 | set { } | ||
920 | } | 927 | } |
921 | public override PhysicsVector Size | 928 | public override PhysicsVector Size |
922 | { | 929 | { |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 3cf2646..c87e748 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs | |||
@@ -176,7 +176,7 @@ namespace OpenSim.Region.Physics.Manager | |||
176 | public abstract PhysicsVector GeometricCenter { get; } | 176 | public abstract PhysicsVector GeometricCenter { get; } |
177 | public abstract PhysicsVector CenterOfMass { get; } | 177 | public abstract PhysicsVector CenterOfMass { get; } |
178 | public abstract PhysicsVector Velocity { get; set; } | 178 | public abstract PhysicsVector Velocity { get; set; } |
179 | public abstract float CollisionScore { get;} | 179 | public abstract float CollisionScore { get; set;} |
180 | public abstract PhysicsVector Acceleration { get; } | 180 | public abstract PhysicsVector Acceleration { get; } |
181 | public abstract Quaternion Orientation { get; set; } | 181 | public abstract Quaternion Orientation { get; set; } |
182 | public abstract int PhysicsActorType { get; set; } | 182 | public abstract int PhysicsActorType { get; set; } |
@@ -208,8 +208,10 @@ namespace OpenSim.Region.Physics.Manager | |||
208 | public override bool Stopped | 208 | public override bool Stopped |
209 | { | 209 | { |
210 | get{ return false; } | 210 | get{ return false; } |
211 | |||
211 | } | 212 | } |
212 | 213 | ||
214 | |||
213 | public override PhysicsVector Position | 215 | public override PhysicsVector Position |
214 | { | 216 | { |
215 | get { return PhysicsVector.Zero; } | 217 | get { return PhysicsVector.Zero; } |
@@ -300,6 +302,7 @@ namespace OpenSim.Region.Physics.Manager | |||
300 | public override float CollisionScore | 302 | public override float CollisionScore |
301 | { | 303 | { |
302 | get { return 0f; } | 304 | get { return 0f; } |
305 | set { } | ||
303 | } | 306 | } |
304 | 307 | ||
305 | public override void CrossingFailure() | 308 | public override void CrossingFailure() |
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index de93f22..f9d990b 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -25,6 +25,7 @@ | |||
25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 25 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System.Collections.Generic; | ||
28 | using System.Reflection; | 29 | using System.Reflection; |
29 | using Axiom.Math; | 30 | using Axiom.Math; |
30 | using log4net; | 31 | using log4net; |
@@ -86,6 +87,8 @@ namespace OpenSim.Region.Physics.Manager | |||
86 | 87 | ||
87 | public abstract void Dispose(); | 88 | public abstract void Dispose(); |
88 | 89 | ||
90 | public abstract Dictionary<uint, float> GetTopColliders(); | ||
91 | |||
89 | public abstract bool IsThreaded { get; } | 92 | public abstract bool IsThreaded { get; } |
90 | 93 | ||
91 | private class NullPhysicsScene : PhysicsScene | 94 | private class NullPhysicsScene : PhysicsScene |
@@ -170,6 +173,12 @@ namespace OpenSim.Region.Physics.Manager | |||
170 | public override void Dispose() | 173 | public override void Dispose() |
171 | { | 174 | { |
172 | } | 175 | } |
176 | |||
177 | public override Dictionary<uint,float> GetTopColliders() | ||
178 | { | ||
179 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); | ||
180 | return returncolliders; | ||
181 | } | ||
173 | } | 182 | } |
174 | } | 183 | } |
175 | } | 184 | } |
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 | } |
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs index 82ce144..c14a80a 100644 --- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs +++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs | |||
@@ -326,6 +326,12 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
326 | public override void DeleteTerrain() | 326 | public override void DeleteTerrain() |
327 | { | 327 | { |
328 | } | 328 | } |
329 | |||
330 | public override Dictionary<uint, float> GetTopColliders() | ||
331 | { | ||
332 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); | ||
333 | return returncolliders; | ||
334 | } | ||
329 | } | 335 | } |
330 | 336 | ||
331 | public class POSCharacter : PhysicsActor | 337 | public class POSCharacter : PhysicsActor |
@@ -476,6 +482,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
476 | public override float CollisionScore | 482 | public override float CollisionScore |
477 | { | 483 | { |
478 | get { return 0f; } | 484 | get { return 0f; } |
485 | set { } | ||
479 | } | 486 | } |
480 | 487 | ||
481 | public override Quaternion Orientation | 488 | public override Quaternion Orientation |
@@ -663,6 +670,7 @@ namespace OpenSim.Region.Physics.POSPlugin | |||
663 | public override float CollisionScore | 670 | public override float CollisionScore |
664 | { | 671 | { |
665 | get { return 0f; } | 672 | get { return 0f; } |
673 | set { } | ||
666 | } | 674 | } |
667 | 675 | ||
668 | public override Quaternion Orientation | 676 | public override Quaternion Orientation |
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs index 175d749..c9e1e30 100644 --- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs +++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs | |||
@@ -200,6 +200,12 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
200 | { | 200 | { |
201 | scene.DeleteTerrain(); | 201 | scene.DeleteTerrain(); |
202 | } | 202 | } |
203 | |||
204 | public override Dictionary<uint, float> GetTopColliders() | ||
205 | { | ||
206 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); | ||
207 | return returncolliders; | ||
208 | } | ||
203 | } | 209 | } |
204 | 210 | ||
205 | public class PhysXCharacter : PhysicsActor | 211 | public class PhysXCharacter : PhysicsActor |
@@ -355,6 +361,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
355 | public override float CollisionScore | 361 | public override float CollisionScore |
356 | { | 362 | { |
357 | get { return 0f; } | 363 | get { return 0f; } |
364 | set { } | ||
358 | } | 365 | } |
359 | 366 | ||
360 | public override bool Kinematic | 367 | public override bool Kinematic |
@@ -593,6 +600,7 @@ namespace OpenSim.Region.Physics.PhysXPlugin | |||
593 | public override float CollisionScore | 600 | public override float CollisionScore |
594 | { | 601 | { |
595 | get { return 0f; } | 602 | get { return 0f; } |
603 | set { } | ||
596 | } | 604 | } |
597 | 605 | ||
598 | public override bool Kinematic | 606 | public override bool Kinematic |