diff options
author | Justin Clark-Casey (justincc) | 2011-12-03 01:47:12 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-03 01:47:12 +0000 |
commit | f08aad8a403e18625c01c0b3b4b6d4248476a64b (patch) | |
tree | 633857377e66c44f9048f9c75be6eb0e7221f98c /OpenSim/Region | |
parent | refactor: Use just ScenePresenceAnimator.CurrentMovementAnimation rather than... (diff) | |
download | opensim-SC_OLD-f08aad8a403e18625c01c0b3b4b6d4248476a64b.zip opensim-SC_OLD-f08aad8a403e18625c01c0b3b4b6d4248476a64b.tar.gz opensim-SC_OLD-f08aad8a403e18625c01c0b3b4b6d4248476a64b.tar.bz2 opensim-SC_OLD-f08aad8a403e18625c01c0b3b4b6d4248476a64b.tar.xz |
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()
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 46 |
2 files changed, 28 insertions, 23 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 2a6b8ea..43cfd80 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -399,6 +399,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
399 | public void UpdateMovementAnimations() | 399 | public void UpdateMovementAnimations() |
400 | { | 400 | { |
401 | CurrentMovementAnimation = DetermineMovementAnimation(); | 401 | CurrentMovementAnimation = DetermineMovementAnimation(); |
402 | |||
403 | // m_log.DebugFormat( | ||
404 | // "[SCENE PRESENCE ANIMATOR]: Determined animation {0} for {1} in UpdateMovementAnimations()", | ||
405 | // CurrentMovementAnimation, m_scenePresence.Name); | ||
406 | |||
402 | TrySetMovementAnimation(CurrentMovementAnimation); | 407 | TrySetMovementAnimation(CurrentMovementAnimation); |
403 | } | 408 | } |
404 | 409 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 7156137..663c9ae 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -149,9 +149,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
149 | } | 149 | } |
150 | private bool m_wasFlying; // add for fly velocity control | 150 | private bool m_wasFlying; // add for fly velocity control |
151 | 151 | ||
152 | private int m_lastColCount = -1; //KF: Look for Collision chnages | 152 | // private int m_lastColCount = -1; //KF: Look for Collision chnages |
153 | private int m_updateCount = 0; //KF: Update Anims for a while | 153 | // private int m_updateCount = 0; //KF: Update Anims for a while |
154 | private static readonly int UPDATE_COUNT = 10; // how many frames to update for | 154 | // private static readonly int UPDATE_COUNT = 10; // how many frames to update for |
155 | 155 | ||
156 | private TeleportFlags m_teleportFlags; | 156 | private TeleportFlags m_teleportFlags; |
157 | public TeleportFlags TeleportFlags | 157 | public TeleportFlags TeleportFlags |
@@ -1366,14 +1366,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1366 | 1366 | ||
1367 | #endregion Inputs | 1367 | #endregion Inputs |
1368 | 1368 | ||
1369 | // Make anims work for client side autopilot | 1369 | // // Make anims work for client side autopilot |
1370 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) | 1370 | // if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) |
1371 | m_updateCount = UPDATE_COUNT; | 1371 | // m_updateCount = UPDATE_COUNT; |
1372 | 1372 | // | |
1373 | // Make turning in place work | 1373 | // // Make turning in place work |
1374 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 || | 1374 | // if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 || |
1375 | (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) | 1375 | // (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) |
1376 | m_updateCount = UPDATE_COUNT; | 1376 | // m_updateCount = UPDATE_COUNT; |
1377 | 1377 | ||
1378 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) | 1378 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) |
1379 | { | 1379 | { |
@@ -2297,7 +2297,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2297 | 2297 | ||
2298 | public void HandleAgentSitOnGround() | 2298 | public void HandleAgentSitOnGround() |
2299 | { | 2299 | { |
2300 | m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. | 2300 | // m_updateCount = 0; // Kill animation update burst so that the SIT_G.. will stick. |
2301 | Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); | 2301 | Animator.TrySetMovementAnimation("SIT_GROUND_CONSTRAINED"); |
2302 | SitGround = true; | 2302 | SitGround = true; |
2303 | RemoveFromPhysicalScene(); | 2303 | RemoveFromPhysicalScene(); |
@@ -3290,11 +3290,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3290 | // as of this comment the interval is set in AddToPhysicalScene | 3290 | // as of this comment the interval is set in AddToPhysicalScene |
3291 | if (Animator != null) | 3291 | if (Animator != null) |
3292 | { | 3292 | { |
3293 | if (m_updateCount > 0) | 3293 | // if (m_updateCount > 0) |
3294 | { | 3294 | // { |
3295 | Animator.UpdateMovementAnimations(); | 3295 | Animator.UpdateMovementAnimations(); |
3296 | m_updateCount--; | 3296 | // m_updateCount--; |
3297 | } | 3297 | // } |
3298 | } | 3298 | } |
3299 | 3299 | ||
3300 | CollisionEventUpdate collisionData = (CollisionEventUpdate)e; | 3300 | CollisionEventUpdate collisionData = (CollisionEventUpdate)e; |
@@ -3302,13 +3302,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3302 | 3302 | ||
3303 | CollisionPlane = Vector4.UnitW; | 3303 | CollisionPlane = Vector4.UnitW; |
3304 | 3304 | ||
3305 | // No collisions at all means we may be flying. Update always | 3305 | // // No collisions at all means we may be flying. Update always |
3306 | // to make falling work | 3306 | // // to make falling work |
3307 | if (m_lastColCount != coldata.Count || coldata.Count == 0) | 3307 | // if (m_lastColCount != coldata.Count || coldata.Count == 0) |
3308 | { | 3308 | // { |
3309 | m_updateCount = UPDATE_COUNT; | 3309 | // m_updateCount = UPDATE_COUNT; |
3310 | m_lastColCount = coldata.Count; | 3310 | // m_lastColCount = coldata.Count; |
3311 | } | 3311 | // } |
3312 | 3312 | ||
3313 | if (coldata.Count != 0 && Animator != null) | 3313 | if (coldata.Count != 0 && Animator != null) |
3314 | { | 3314 | { |