Remove unused fields from CollisionEventUpdate

remove-scene-viewer
Justin Clark-Casey (justincc) 2011-10-25 22:39:08 +01:00
parent c825c9a945
commit 0f83f87233
5 changed files with 10 additions and 28 deletions

View File

@ -443,7 +443,7 @@ public class BSCharacter : PhysicsActor
Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>();
contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
CollisionEventUpdate args = new CollisionEventUpdate(LocalID, (int)type, 1, contactPoints); CollisionEventUpdate args = new CollisionEventUpdate(contactPoints);
base.SendCollisionUpdate(args); base.SendCollisionUpdate(args);
} }

View File

@ -1350,7 +1350,7 @@ public sealed class BSPrim : PhysicsActor
// create the event for the collision // create the event for the collision
Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>(); Dictionary<uint, ContactPoint> contactPoints = new Dictionary<uint, ContactPoint>();
contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); contactPoints.Add(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth));
CollisionEventUpdate args = new CollisionEventUpdate(LocalID, (int)type, 1, contactPoints); CollisionEventUpdate args = new CollisionEventUpdate(contactPoints);
base.SendCollisionUpdate(args); base.SendCollisionUpdate(args);
} }
} }

View File

@ -66,47 +66,29 @@ namespace OpenSim.Region.Physics.Manager
} }
} }
/// <summary>
/// Used to pass collision information to OnCollisionUpdate listeners.
/// </summary>
public class CollisionEventUpdate : EventArgs public class CollisionEventUpdate : EventArgs
{ {
// Raising the event on the object, so don't need to provide location.. further up the tree knows that info.
/// <summary> /// <summary>
/// Number of collision events in this update. /// Number of collision events in this update.
/// </summary> /// </summary>
public int Count { get { return m_objCollisionList.Count; } } public int Count { get { return m_objCollisionList.Count; } }
public int m_colliderType; public Dictionary<uint, ContactPoint> m_objCollisionList;
public int m_GenericStartEnd;
//public uint m_LocalID;
public Dictionary<uint, ContactPoint> m_objCollisionList = new Dictionary<uint, ContactPoint>();
public CollisionEventUpdate(uint localID, int colliderType, int GenericStartEnd, Dictionary<uint, ContactPoint> objCollisionList) public CollisionEventUpdate(Dictionary<uint, ContactPoint> objCollisionList)
{ {
m_colliderType = colliderType;
m_GenericStartEnd = GenericStartEnd;
m_objCollisionList = objCollisionList; m_objCollisionList = objCollisionList;
} }
public CollisionEventUpdate() public CollisionEventUpdate()
{ {
m_colliderType = (int) ActorTypes.Unknown;
m_GenericStartEnd = 1;
m_objCollisionList = new Dictionary<uint, ContactPoint>(); m_objCollisionList = new Dictionary<uint, ContactPoint>();
} }
public int collidertype public void AddCollider(uint localID, ContactPoint contact)
{
get { return m_colliderType; }
set { m_colliderType = value; }
}
public int GenericStartEnd
{
get { return m_GenericStartEnd; }
set { m_GenericStartEnd = value; }
}
public void addCollider(uint localID, ContactPoint contact)
{ {
if (!m_objCollisionList.ContainsKey(localID)) if (!m_objCollisionList.ContainsKey(localID))
{ {

View File

@ -1227,7 +1227,7 @@ namespace OpenSim.Region.Physics.OdePlugin
// m_log.DebugFormat( // m_log.DebugFormat(
// "[PHYSICS]: Adding collision event for {0}, collidedWith {1}, contact {2}", "", CollidedWith, contact); // "[PHYSICS]: Adding collision event for {0}, collidedWith {1}, contact {2}", "", CollidedWith, contact);
CollisionEventsThisFrame.addCollider(CollidedWith, contact); CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
} }
} }

View File

@ -3020,7 +3020,7 @@ Console.WriteLine(" JointCreateFixed");
public void AddCollisionEvent(uint CollidedWith, ContactPoint contact) public void AddCollisionEvent(uint CollidedWith, ContactPoint contact)
{ {
CollisionEventsThisFrame.addCollider(CollidedWith, contact); CollisionEventsThisFrame.AddCollider(CollidedWith, contact);
} }
public void SendCollisions() public void SendCollisions()