Rename ScenePresenceAnimator.GetMovementAnimation() -> DetermineMovementAnimation() for better code readability
parent
96c191f4fd
commit
5ba8ca5662
|
@ -59,6 +59,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
get { return m_movementAnimation; }
|
get { return m_movementAnimation; }
|
||||||
}
|
}
|
||||||
protected string m_movementAnimation = "CROUCH";
|
protected string m_movementAnimation = "CROUCH";
|
||||||
|
|
||||||
private int m_animTickFall;
|
private int m_animTickFall;
|
||||||
public int m_animTickJump; // ScenePresence has to see this to control +Z force
|
public int m_animTickJump; // ScenePresence has to see this to control +Z force
|
||||||
public bool m_jumping = false;
|
public bool m_jumping = false;
|
||||||
|
@ -146,6 +147,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
{
|
{
|
||||||
if (!m_scenePresence.IsChildAgent)
|
if (!m_scenePresence.IsChildAgent)
|
||||||
{
|
{
|
||||||
|
// m_log.DebugFormat(
|
||||||
|
// "[SCENE PRESENCE ANIMATOR]: Setting movement animation {0} for {1}",
|
||||||
|
// anim, m_scenePresence.Name);
|
||||||
|
|
||||||
if (m_animations.TrySetDefaultAnimation(
|
if (m_animations.TrySetDefaultAnimation(
|
||||||
anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
|
anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID))
|
||||||
{
|
{
|
||||||
|
@ -169,7 +174,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This method determines the proper movement related animation
|
/// This method determines the proper movement related animation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public string GetMovementAnimation()
|
public string DetermineMovementAnimation()
|
||||||
{
|
{
|
||||||
const float FALL_DELAY = 800f;
|
const float FALL_DELAY = 800f;
|
||||||
const float PREJUMP_DELAY = 200f;
|
const float PREJUMP_DELAY = 200f;
|
||||||
|
@ -283,7 +288,6 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
int jumptime;
|
int jumptime;
|
||||||
jumptime = Environment.TickCount - m_animTickJump;
|
jumptime = Environment.TickCount - m_animTickJump;
|
||||||
|
|
||||||
|
|
||||||
if ((move.Z > 0f) && (!m_jumping))
|
if ((move.Z > 0f) && (!m_jumping))
|
||||||
{
|
{
|
||||||
// Start jumping, prejump
|
// Start jumping, prejump
|
||||||
|
@ -387,6 +391,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
#endregion Ground Movement
|
#endregion Ground Movement
|
||||||
|
|
||||||
m_falling = false;
|
m_falling = false;
|
||||||
|
|
||||||
return m_movementAnimation;
|
return m_movementAnimation;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,7 +400,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public void UpdateMovementAnimations()
|
public void UpdateMovementAnimations()
|
||||||
{
|
{
|
||||||
m_movementAnimation = GetMovementAnimation();
|
m_movementAnimation = DetermineMovementAnimation();
|
||||||
TrySetMovementAnimation(m_movementAnimation);
|
TrySetMovementAnimation(m_movementAnimation);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5554,7 +5554,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||||
flags |= ScriptBaseClass.AGENT_TYPING;
|
flags |= ScriptBaseClass.AGENT_TYPING;
|
||||||
}
|
}
|
||||||
|
|
||||||
string agentMovementAnimation = agent.Animator.GetMovementAnimation();
|
string agentMovementAnimation = agent.Animator.DetermineMovementAnimation();
|
||||||
|
|
||||||
if (agentMovementAnimation == "CROUCH")
|
if (agentMovementAnimation == "CROUCH")
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue