diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 5791b9511f..58fc6fc6b3 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -4821,7 +4821,6 @@ namespace OpenSim.Region.Framework.Scenes { PhysActor.OnCollisionUpdate += PhysicsCollision; PhysActor.SubscribeEvents(1000); - } } else diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 6b74e74ba3..7766691dc5 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -1220,14 +1220,16 @@ namespace OpenSim.Region.Physics.OdePlugin { m_requestedUpdateFrequency = ms; m_eventsubscription = ms; - _parent_scene.addCollisionEventReporting(this); + _parent_scene.AddCollisionEventReporting(this); } + public override void UnSubscribeEvents() { - _parent_scene.remCollisionEventReporting(this); + _parent_scene.RemoveCollisionEventReporting(this); m_requestedUpdateFrequency = 0; m_eventsubscription = 0; } + public void AddCollisionEvent(uint CollidedWith, ContactPoint contact) { if (m_eventsubscription > 0) @@ -1248,6 +1250,7 @@ namespace OpenSim.Region.Physics.OdePlugin m_eventsubscription = 0; } } + public override bool SubscribedEvents() { if (m_eventsubscription > 0) diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index b3045bd8cb..34c0deb445 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -2986,12 +2986,12 @@ Console.WriteLine("changeshape not need meshing"); public override void SubscribeEvents(int ms) { m_eventsubscription = ms; - _parent_scene.addCollisionEventReporting(this); + _parent_scene.AddCollisionEventReporting(this); } public override void UnSubscribeEvents() { - _parent_scene.remCollisionEventReporting(this); + _parent_scene.RemoveCollisionEventReporting(this); m_eventsubscription = 0; } diff --git a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs index cd2b156a95..e1e031fb66 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdeScene.cs @@ -198,7 +198,12 @@ namespace OpenSim.Region.Physics.OdePlugin private readonly List _taintedPrimL = new List(); private readonly HashSet _taintedActors = new HashSet(); private readonly List _perloopContact = new List(); + + /// + /// A list of actors that should receive collision events. + /// private readonly List _collisionEventPrim = new List(); + private readonly HashSet _badCharacter = new HashSet(); public Dictionary geom_name_map = new Dictionary(); public Dictionary actor_name_map = new Dictionary(); @@ -1604,7 +1609,11 @@ namespace OpenSim.Region.Physics.OdePlugin } // End recovered. Kitto Flora - public void addCollisionEventReporting(PhysicsActor obj) + /// + /// Add actor to the list that should receive collision events in the simulate loop. + /// + /// + public void AddCollisionEventReporting(PhysicsActor obj) { lock (_collisionEventPrim) { @@ -1613,7 +1622,11 @@ namespace OpenSim.Region.Physics.OdePlugin } } - public void remCollisionEventReporting(PhysicsActor obj) + /// + /// Remove actor from the list that should receive collision events in the simulate loop. + /// + /// + public void RemoveCollisionEventReporting(PhysicsActor obj) { lock (_collisionEventPrim) { @@ -2132,7 +2145,7 @@ namespace OpenSim.Region.Physics.OdePlugin //Console.WriteLine("RemovePrimThreadLocked " + prim.m_primName); lock (prim) { - remCollisionEventReporting(prim); + RemoveCollisionEventReporting(prim); lock (ode) { if (prim.prim_geom != IntPtr.Zero) @@ -2792,6 +2805,8 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); if (obj == null) continue; +// m_log.DebugFormat("[PHYSICS]: Assessing {0} for collision events", obj.SOPName); + switch ((ActorTypes)obj.PhysicsActorType) { case ActorTypes.Agent: @@ -2799,6 +2814,7 @@ Console.WriteLine("AddPhysicsActorTaint to " + taintedprim.Name); cobj.AddCollisionFrameTime(100); cobj.SendCollisions(); break; + case ActorTypes.Prim: OdePrim pobj = (OdePrim)obj; pobj.SendCollisions();