From 5ba8ca5662efb9c4f595e9a703535661d72e5b2f Mon Sep 17 00:00:00 2001 From: "Justin Clark-Casey (justincc)" Date: Sat, 3 Dec 2011 00:27:21 +0000 Subject: [PATCH] Rename ScenePresenceAnimator.GetMovementAnimation() -> DetermineMovementAnimation() for better code readability --- .../Scenes/Animation/ScenePresenceAnimator.cs | 11 ++++++++--- .../ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 +- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index a2805d20bc..cac936ce63 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -59,6 +59,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation get { return m_movementAnimation; } } protected string m_movementAnimation = "CROUCH"; + private int m_animTickFall; public int m_animTickJump; // ScenePresence has to see this to control +Z force public bool m_jumping = false; @@ -146,6 +147,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation { if (!m_scenePresence.IsChildAgent) { +// m_log.DebugFormat( +// "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}", +// anim, m_scenePresence.Name); + if (m_animations.TrySetDefaultAnimation( anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) { @@ -169,7 +174,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// /// This method determines the proper movement related animation /// - public string GetMovementAnimation() + public string DetermineMovementAnimation() { const float FALL_DELAY = 800f; const float PREJUMP_DELAY = 200f; @@ -283,7 +288,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation int jumptime; jumptime = Environment.TickCount - m_animTickJump; - if ((move.Z > 0f) && (!m_jumping)) { // Start jumping, prejump @@ -387,6 +391,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation #endregion Ground Movement m_falling = false; + return m_movementAnimation; } @@ -395,7 +400,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// public void UpdateMovementAnimations() { - m_movementAnimation = GetMovementAnimation(); + m_movementAnimation = DetermineMovementAnimation(); TrySetMovementAnimation(m_movementAnimation); } diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6c54c9beb1..2812683f6d 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs @@ -5554,7 +5554,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api flags |= ScriptBaseClass.AGENT_TYPING; } - string agentMovementAnimation = agent.Animator.GetMovementAnimation(); + string agentMovementAnimation = agent.Animator.DetermineMovementAnimation(); if (agentMovementAnimation == "CROUCH") {