aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-11 01:56:42 +0100
committerJustin Clark-Casey (justincc)2011-08-11 01:56:42 +0100
commit4402851b086e7faf0d441d2ae0d5f6a3e1ea04b8 (patch)
treeff44ea86dfd8ba586ae4439728ef26341085691a /OpenSim/Region/Framework
parentIf SP.MoveToTarget has been called with a force walk, begin by landing the av... (diff)
downloadopensim-SC-4402851b086e7faf0d441d2ae0d5f6a3e1ea04b8.zip
opensim-SC-4402851b086e7faf0d441d2ae0d5f6a3e1ea04b8.tar.gz
opensim-SC-4402851b086e7faf0d441d2ae0d5f6a3e1ea04b8.tar.bz2
opensim-SC-4402851b086e7faf0d441d2ae0d5f6a3e1ea04b8.tar.xz
Get NPCs to revert to the correct 'resting' animation (e.g. stand or hover) after finishing their movement. This also fixes judder after an avatar has finished "go here"/autopilot movement in a viewer.
This meant reseting the SP.AgentControlFlags since the Animator uses these to determine the correct default animation.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs10
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs6
2 files changed, 14 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
index 4ab818f..e07d8b4 100644
--- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
+++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs
@@ -77,6 +77,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
77 if (m_scenePresence.IsChildAgent) 77 if (m_scenePresence.IsChildAgent)
78 return; 78 return;
79 79
80// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} for {1}", animID, m_scenePresence.Name);
81
80 if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) 82 if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID))
81 SendAnimPack(); 83 SendAnimPack();
82 } 84 }
@@ -91,6 +93,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation
91 if (animID == UUID.Zero) 93 if (animID == UUID.Zero)
92 return; 94 return;
93 95
96// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Adding animation {0} {1} for {2}", animID, name, m_scenePresence.Name);
97
94 AddAnimation(animID, objectID); 98 AddAnimation(animID, objectID);
95 } 99 }
96 100
@@ -127,13 +131,15 @@ namespace OpenSim.Region.Framework.Scenes.Animation
127 /// </summary> 131 /// </summary>
128 public void TrySetMovementAnimation(string anim) 132 public void TrySetMovementAnimation(string anim)
129 { 133 {
130 //m_log.DebugFormat("Updating movement animation to {0}", anim);
131
132 if (!m_scenePresence.IsChildAgent) 134 if (!m_scenePresence.IsChildAgent)
133 { 135 {
134 if (m_animations.TrySetDefaultAnimation( 136 if (m_animations.TrySetDefaultAnimation(
135 anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) 137 anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
136 { 138 {
139// m_log.DebugFormat(
140// "[SCENE PRESENCE ANIMATOR]: Updating movement animation to {0} for {1}",
141// anim, m_scenePresence.Name);
142
137 // 16384 is CHANGED_ANIMATION 143 // 16384 is CHANGED_ANIMATION
138 m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION}); 144 m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION});
139 SendAnimPack(); 145 SendAnimPack();
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 12a4712..7a30684 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1745,6 +1745,12 @@ namespace OpenSim.Region.Framework.Scenes
1745 1745
1746 MovingToTarget = false; 1746 MovingToTarget = false;
1747 MoveToPositionTarget = Vector3.Zero; 1747 MoveToPositionTarget = Vector3.Zero;
1748
1749 // We need to reset the control flag as the ScenePresenceAnimator uses this to determine the correct
1750 // resting animation (e.g. hover or stand). NPCs don't have a client that will quickly reset this flag.
1751 // However, the line is here rather than in the NPC module since it also appears necessary to stop a
1752 // viewer that uses "go here" from juddering on all subsequent avatar movements.
1753 AgentControlFlags = (uint)AgentManager.ControlFlags.NONE;
1748 } 1754 }
1749 1755
1750 private void CheckAtSitTarget() 1756 private void CheckAtSitTarget()