aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-10-25 22:39:08 +0100
committerJustin Clark-Casey (justincc)2011-10-25 22:39:08 +0100
commit0f83f87233544972ad6799cb78e5f21845c53fbd (patch)
tree1601a52b9fd552cf700e36f67d8bd75070212e0c /OpenSim/Region
parentGet rid of the pointless null checks on collision listeners. Add warning abo... (diff)
downloadopensim-SC_OLD-0f83f87233544972ad6799cb78e5f21845c53fbd.zip
opensim-SC_OLD-0f83f87233544972ad6799cb78e5f21845c53fbd.tar.gz
opensim-SC_OLD-0f83f87233544972ad6799cb78e5f21845c53fbd.tar.bz2
opensim-SC_OLD-0f83f87233544972ad6799cb78e5f21845c53fbd.tar.xz
Remove unused fields from CollisionEventUpdate
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs2
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs2
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs30
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs2
5 files changed, 10 insertions, 28 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 682eb80..9a6857b 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -443,7 +443,7 @@ public class BSCharacter : PhysicsActor
443 443
444 Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); 444 Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>();
445 contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); 445 contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
446 CollisionEventUpdate args = new CollisionEventUpdate(LocalID, (int)type, 1, contactPoints); 446 CollisionEventUpdate args = new CollisionEventUpdate(contactPoints);
447 base.SendCollisionUpdate(args); 447 base.SendCollisionUpdate(args);
448 } 448 }
449 449
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
index bb8d601..8782e62 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPrim.cs
@@ -1350,7 +1350,7 @@ public sealed class BSPrim : PhysicsActor
1350 // create the event for the collision 1350 // create the event for the collision
1351 Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); 1351 Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>();
1352 contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); 1352 contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
1353 CollisionEventUpdate args = new CollisionEventUpdate(LocalID, (int)type, 1, contactPoints); 1353 CollisionEventUpdate args = new CollisionEventUpdate(contactPoints);
1354 base.SendCollisionUpdate(args); 1354 base.SendCollisionUpdate(args);
1355 } 1355 }
1356} 1356}
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index 8f5abde..362f997 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -66,47 +66,29 @@ namespace OpenSim.Region.Physics.Manager
66 } 66 }
67 } 67 }
68 68
69 /// <summary>
70 /// Used to pass collision information to OnCollisionUpdate listeners.
71 /// </summary>
69 public class CollisionEventUpdate : EventArgs 72 public class CollisionEventUpdate : EventArgs
70 { 73 {
71 // Raising the event on the object, so don't need to provide location.. further up the tree knows that info.
72
73 /// <summary> 74 /// <summary>
74 /// Number of collision events in this update. 75 /// Number of collision events in this update.
75 /// </summary> 76 /// </summary>
76 public int Count { get { return m_objCollisionList.Count; } } 77 public int Count { get { return m_objCollisionList.Count; } }
77 78
78 public int m_colliderType; 79 public Dictionary<uint, ContactPoint> m_objCollisionList;
79 public int m_GenericStartEnd;
80 //public uint m_LocalID;
81 public Dictionary<uint, ContactPoint> m_objCollisionList = new Dictionary<uint, ContactPoint>();
82 80
83 public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, Dictionary<uint, ContactPoint> objCollisionList) 81 public CollisionEventUpdate(Dictionary<uint, ContactPoint> objCollisionList)
84 { 82 {
85 m_colliderType = colliderType;
86 m_GenericStartEnd = GenericStartEnd;
87 m_objCollisionList = objCollisionList; 83 m_objCollisionList = objCollisionList;
88 } 84 }
89 85
90 public CollisionEventUpdate() 86 public CollisionEventUpdate()
91 { 87 {
92 m_colliderType = (int) ActorTypes.Unknown;
93 m_GenericStartEnd = 1;
94 m_objCollisionList = new Dictionary<uint, ContactPoint>(); 88 m_objCollisionList = new Dictionary<uint, ContactPoint>();
95 } 89 }
96 90
97 public int collidertype 91 public void AddCollider(uint localID, ContactPoint contact)
98 {
99 get { return m_colliderType; }
100 set { m_colliderType = value; }
101 }
102
103 public int GenericStartEnd
104 {
105 get { return m_GenericStartEnd; }
106 set { m_GenericStartEnd = value; }
107 }
108
109 public void addCollider(uint localID, ContactPoint contact)
110 { 92 {
111 if (!m_objCollisionList.ContainsKey(localID)) 93 if (!m_objCollisionList.ContainsKey(localID))
112 { 94 {
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index 55e14bc..b6e1c4e 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -1227,7 +1227,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1227// m_log.DebugFormat( 1227// m_log.DebugFormat(
1228// "[PHYSICS]: Adding collision event for {0}, collidedWith {1}, contact {2}", "", CollidedWith, contact); 1228// "[PHYSICS]: Adding collision event for {0}, collidedWith {1}, contact {2}", "", CollidedWith, contact);
1229 1229
1230 CollisionEventsThisFrame.addCollider(CollidedWith, contact); 1230 CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
1231 } 1231 }
1232 } 1232 }
1233 1233
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index 4ef731d..0363885 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -3020,7 +3020,7 @@ Console.WriteLine(" JointCreateFixed");
3020 3020
3021 public void AddCollisionEvent(uint CollidedWith, ContactPoint contact) 3021 public void AddCollisionEvent(uint CollidedWith, ContactPoint contact)
3022 { 3022 {
3023 CollisionEventsThisFrame.addCollider(CollidedWith, contact); 3023 CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
3024 } 3024 }
3025 3025
3026 public void SendCollisions() 3026 public void SendCollisions()