diff options
author | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
---|---|---|
committer | Melanie Thielker | 2014-06-21 00:39:55 +0200 |
commit | 159fcbf150b7da0e229b29aa7b94793484543d12 (patch) | |
tree | b8c0ff3b4c758a3fba8315b556c923ef4c02a185 /OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |
parent | Merge commit '68c8633ba18f0a11cfc0ed04d1d0c7c59e6cec76' (diff) | |
parent | Merge branch 'master' into careminster (diff) | |
download | opensim-SC-159fcbf150b7da0e229b29aa7b94793484543d12.zip opensim-SC-159fcbf150b7da0e229b29aa7b94793484543d12.tar.gz opensim-SC-159fcbf150b7da0e229b29aa7b94793484543d12.tar.bz2 opensim-SC-159fcbf150b7da0e229b29aa7b94793484543d12.tar.xz |
Merge branch 'master' of ssh://3dhosting.de/var/git/careminster
Conflicts:
OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 36 |
1 files changed, 29 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 65c279e..c1394aa 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -93,7 +93,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
93 | GetAnimName(animID), animID, m_scenePresence.Name); | 93 | GetAnimName(animID), animID, m_scenePresence.Name); |
94 | 94 | ||
95 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) | 95 | if (m_animations.Add(animID, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, objectID)) |
96 | { | ||
96 | SendAnimPack(); | 97 | SendAnimPack(); |
98 | m_scenePresence.TriggerScenePresenceUpdated(); | ||
99 | } | ||
97 | } | 100 | } |
98 | 101 | ||
99 | // Called from scripts | 102 | // Called from scripts |
@@ -132,7 +135,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
132 | GetAnimName(animID), animID, m_scenePresence.Name); | 135 | GetAnimName(animID), animID, m_scenePresence.Name); |
133 | 136 | ||
134 | if (m_animations.Remove(animID, allowNoDefault)) | 137 | if (m_animations.Remove(animID, allowNoDefault)) |
138 | { | ||
135 | SendAnimPack(); | 139 | SendAnimPack(); |
140 | m_scenePresence.TriggerScenePresenceUpdated(); | ||
141 | } | ||
136 | } | 142 | } |
137 | 143 | ||
138 | public void avnChangeAnim(UUID animID, bool addRemove, bool sendPack) | 144 | public void avnChangeAnim(UUID animID, bool addRemove, bool sendPack) |
@@ -180,8 +186,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
180 | /// The movement animation is reserved for "main" animations | 186 | /// The movement animation is reserved for "main" animations |
181 | /// that are mutually exclusive, e.g. flying and sitting. | 187 | /// that are mutually exclusive, e.g. flying and sitting. |
182 | /// </summary> | 188 | /// </summary> |
183 | public void TrySetMovementAnimation(string anim) | 189 | /// <returns>'true' if the animation was updated</returns> |
190 | public bool TrySetMovementAnimation(string anim) | ||
184 | { | 191 | { |
192 | bool ret = false; | ||
185 | if (!m_scenePresence.IsChildAgent) | 193 | if (!m_scenePresence.IsChildAgent) |
186 | { | 194 | { |
187 | // m_log.DebugFormat( | 195 | // m_log.DebugFormat( |
@@ -198,6 +206,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
198 | // 16384 is CHANGED_ANIMATION | 206 | // 16384 is CHANGED_ANIMATION |
199 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION}); | 207 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION}); |
200 | SendAnimPack(); | 208 | SendAnimPack(); |
209 | ret = true; | ||
201 | } | 210 | } |
202 | } | 211 | } |
203 | else | 212 | else |
@@ -206,6 +215,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
206 | "[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {0} on child presence {1}", | 215 | "[SCENE PRESENCE ANIMATOR]: Tried to set movement animation {0} on child presence {1}", |
207 | anim, m_scenePresence.Name); | 216 | anim, m_scenePresence.Name); |
208 | } | 217 | } |
218 | return ret; | ||
209 | } | 219 | } |
210 | 220 | ||
211 | /// <summary> | 221 | /// <summary> |
@@ -410,11 +420,18 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
410 | Falling = false; | 420 | Falling = false; |
411 | // Walking / crouchwalking / running | 421 | // Walking / crouchwalking / running |
412 | if (move.Z < 0f) | 422 | if (move.Z < 0f) |
423 | { | ||
413 | return "CROUCHWALK"; | 424 | return "CROUCHWALK"; |
414 | else if (m_scenePresence.SetAlwaysRun) | 425 | } |
415 | return "RUN"; | 426 | // We need to prevent these animations if the user tries to make their avatar walk or run whilst |
416 | else | 427 | // specifying AGENT_CONTROL_STOP (pressing down space on viewers). |
417 | return "WALK"; | 428 | else if (!m_scenePresence.AgentControlStopActive) |
429 | { | ||
430 | if (m_scenePresence.SetAlwaysRun) | ||
431 | return "RUN"; | ||
432 | else | ||
433 | return "WALK"; | ||
434 | } | ||
418 | } | 435 | } |
419 | else if (!m_jumping) | 436 | else if (!m_jumping) |
420 | { | 437 | { |
@@ -439,8 +456,12 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
439 | /// <summary> | 456 | /// <summary> |
440 | /// Update the movement animation of this avatar according to its current state | 457 | /// Update the movement animation of this avatar according to its current state |
441 | /// </summary> | 458 | /// </summary> |
442 | public void UpdateMovementAnimations() | 459 | /// <returns>'true' if the animation was changed</returns> |
460 | public bool UpdateMovementAnimations() | ||
443 | { | 461 | { |
462 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Updating movement animations for {0}", m_scenePresence.Name); | ||
463 | |||
464 | bool ret = false; | ||
444 | lock (m_animations) | 465 | lock (m_animations) |
445 | { | 466 | { |
446 | string newMovementAnimation = DetermineMovementAnimation(); | 467 | string newMovementAnimation = DetermineMovementAnimation(); |
@@ -454,9 +475,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
454 | 475 | ||
455 | // Only set it if it's actually changed, give a script | 476 | // Only set it if it's actually changed, give a script |
456 | // a chance to stop a default animation | 477 | // a chance to stop a default animation |
457 | TrySetMovementAnimation(CurrentMovementAnimation); | 478 | ret = TrySetMovementAnimation(CurrentMovementAnimation); |
458 | } | 479 | } |
459 | } | 480 | } |
481 | return ret; | ||
460 | } | 482 | } |
461 | 483 | ||
462 | public UUID[] GetAnimationArray() | 484 | public UUID[] GetAnimationArray() |