From 96c191f4fdbd64009fc210b8c911c832723bb10e Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 3 Dec 2011 00:09:18 +0000 Subject: Stop SP.HandleAgentUpdate() and PhysicsCollisionUpdate() from being processed if we're dealing with a child ScenePresence. Neither of these can have any effect on child agents Now leaving warning about trying to set animation on a child agent active. Might temporarily pop up now and again. --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 14 ++++++-------- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 11 +++++++---- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 6b1208c..a2805d2 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -158,14 +158,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation SendAnimPack(); } } - // Don't leave this on since on teleports SP.HandleAgentUpdate() still hammers us for a while after it teleports -// else -// { -// m_log.WarnFormat( -// "[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {0} on child presence {1}", -// anim, m_scenePresence.Name); -// throw new Exception(string.Format("aaargh on setting {0}", anim)); -// } + else + { + m_log.WarnFormat( + "[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {0} on child presence {1}", + anim, m_scenePresence.Name); + } } /// diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b93b67d..c517978 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1293,11 +1293,11 @@ namespace OpenSim.Region.Framework.Scenes // "[SCENE PRESENCE]: In {0} received agent update from {1}", // Scene.RegionInfo.RegionName, remoteClient.Name); - //if (IsChildAgent) - //{ + if (IsChildAgent) + { // // m_log.Debug("DEBUG: HandleAgentUpdate: child agent"); - // return; - //} + return; + } ++m_movementUpdateCount; if (m_movementUpdateCount < 1) @@ -3280,6 +3280,9 @@ namespace OpenSim.Region.Framework.Scenes // Event called by the physics plugin to tell the avatar about a collision. private void PhysicsCollisionUpdate(EventArgs e) { + if (IsChildAgent) + 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 -- cgit v1.1