For now, disable mechanism to limit avatar animation updates since this causes avatars to never reach the correct animation after some actions.

This reverts to situation where animation updates are made each frame on SP.PhysicsCollisionUpdate (though a packet is only sent if the anim actually changes).
m_updateCount was not being update on various avatar state changes, causing the correct animations to never be sent.
Always setting in HandleAgentUpdate() is not enough since the avatar is continually sending AgentUpdate packets.
One would need to identify all the conditions under which animations need to play out and set m_updateCount appropriately in SP.HandleAgentUpdate()
iar_mods
Justin Clark-Casey (justincc) 2011-12-03 01:47:12 +00:00
parent 0ca8491bbe
commit f08aad8a40
2 changed files with 28 additions and 23 deletions

View File

@ -399,6 +399,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation
public void UpdateMovementAnimations() public void UpdateMovementAnimations()
{ {
CurrentMovementAnimation = DetermineMovementAnimation(); CurrentMovementAnimation = DetermineMovementAnimation();
// m_log.DebugFormat(
// "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()",
// CurrentMovementAnimation, m_scenePresence.Name);
TrySetMovementAnimation(CurrentMovementAnimation); TrySetMovementAnimation(CurrentMovementAnimation);
} }

View File

@ -149,9 +149,9 @@ namespace OpenSim.Region.Framework.Scenes
} }
private bool m_wasFlying; // add for fly velocity control private bool m_wasFlying; // add for fly velocity control
private int m_lastColCount = -1; //KF: Look for Collision chnages // private int m_lastColCount = -1; //KF: Look for Collision chnages
private int m_updateCount = 0; //KF: Update Anims for a while // private int m_updateCount = 0; //KF: Update Anims for a while
private static readonly int UPDATE_COUNT = 10; // how many frames to update for // private static readonly int UPDATE_COUNT = 10; // how many frames to update for
private TeleportFlags m_teleportFlags; private TeleportFlags m_teleportFlags;
public TeleportFlags TeleportFlags public TeleportFlags TeleportFlags
@ -1366,14 +1366,14 @@ namespace OpenSim.Region.Framework.Scenes
#endregion Inputs #endregion Inputs
// Make anims work for client side autopilot // // Make anims work for client side autopilot
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) // if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
m_updateCount = UPDATE_COUNT; // m_updateCount = UPDATE_COUNT;
//
// Make turning in place work // // Make turning in place work
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 || // if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 ||
(flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) // (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0)
m_updateCount = UPDATE_COUNT; // m_updateCount = UPDATE_COUNT;
if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
{ {
@ -2297,7 +2297,7 @@ namespace OpenSim.Region.Framework.Scenes
public void HandleAgentSitOnGround() public void HandleAgentSitOnGround()
{ {
m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. // m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick.
Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED");
SitGround = true; SitGround = true;
RemoveFromPhysicalScene(); RemoveFromPhysicalScene();
@ -3290,11 +3290,11 @@ namespace OpenSim.Region.Framework.Scenes
// as of this comment the interval is set in AddToPhysicalScene // as of this comment the interval is set in AddToPhysicalScene
if (Animator != null) if (Animator != null)
{ {
if (m_updateCount > 0) // if (m_updateCount > 0)
{ // {
Animator.UpdateMovementAnimations(); Animator.UpdateMovementAnimations();
m_updateCount--; // m_updateCount--;
} // }
} }
CollisionEventUpdate collisionData = (CollisionEventUpdate)e; CollisionEventUpdate collisionData = (CollisionEventUpdate)e;
@ -3302,13 +3302,13 @@ namespace OpenSim.Region.Framework.Scenes
CollisionPlane = Vector4.UnitW; CollisionPlane = Vector4.UnitW;
// No collisions at all means we may be flying. Update always // // No collisions at all means we may be flying. Update always
// to make falling work // // to make falling work
if (m_lastColCount != coldata.Count || coldata.Count == 0) // if (m_lastColCount != coldata.Count || coldata.Count == 0)
{ // {
m_updateCount = UPDATE_COUNT; // m_updateCount = UPDATE_COUNT;
m_lastColCount = coldata.Count; // m_lastColCount = coldata.Count;
} // }
if (coldata.Count != 0 && Animator != null) if (coldata.Count != 0 && Animator != null)
{ {