From c825c9a94588e31c38ba43bf8ea763818e1c02b6 Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Tue, 25 Oct 2011 22:35:00 +0100 Subject: [PATCH] Get rid of the pointless null checks on collision listeners. Add warning about synchronicity for PhysicsActor.OnCollisionUpdate event doc --- OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 4 ---- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 3 --- OpenSim/Region/Physics/Manager/PhysicsActor.cs | 6 ++++++ 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index bee96d1f29..8b6810251c 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs @@ -2083,10 +2083,6 @@ namespace OpenSim.Region.Framework.Scenes public void PhysicsCollision(EventArgs e) { // single threaded here - if (e == null) - { - return; - } CollisionEventUpdate a = (CollisionEventUpdate)e; Dictionary collissionswith = a.m_objCollisionList; diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e685a2c366..ee6c708d3f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -3296,9 +3296,6 @@ namespace OpenSim.Region.Framework.Scenes // Event called by the physics plugin to tell the avatar about a collision. private void PhysicsCollisionUpdate(EventArgs e) { - if (e == null) - return; - //if ((Math.Abs(Velocity.X) > 0.1e-9f) || (Math.Abs(Velocity.Y) > 0.1e-9f)) // The Physics Scene will send updates every 500 ms grep: PhysicsActor.SubscribeEvents( // as of this comment the interval is set in AddToPhysicalScene diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs index 44af636df9..8f5abdea30 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs @@ -140,7 +140,13 @@ namespace OpenSim.Region.Physics.Manager public event VelocityUpdate OnVelocityUpdate; public event OrientationUpdate OnOrientationUpdate; public event RequestTerseUpdate OnRequestTerseUpdate; + + /// + /// Subscribers to this event must synchronously handle the dictionary of collisions received, since the event + /// object is reused in subsequent physics frames. + /// public event CollisionUpdate OnCollisionUpdate; + public event OutOfBounds OnOutOfBounds; #pragma warning restore 67