diff options
author | Justin Clark-Casey (justincc) | 2011-12-03 00:40:08 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-12-03 00:40:08 +0000 |
commit | 0ca8491bbeab74e4cb50521d4857104c7e0a59b9 (patch) | |
tree | 7a5d35e880cdcedddaf969b1b49d2a98acc56e19 /OpenSim/Region | |
parent | Use agent.Animator.CurrentMovementAnimation in llGetAgentInfo() rather than a... (diff) | |
download | opensim-SC-0ca8491bbeab74e4cb50521d4857104c7e0a59b9.zip opensim-SC-0ca8491bbeab74e4cb50521d4857104c7e0a59b9.tar.gz opensim-SC-0ca8491bbeab74e4cb50521d4857104c7e0a59b9.tar.bz2 opensim-SC-0ca8491bbeab74e4cb50521d4857104c7e0a59b9.tar.xz |
refactor: Use just ScenePresenceAnimator.CurrentMovementAnimation rather than duplicating it with m_movementAnimation
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 26 |
1 files changed, 12 insertions, 14 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index cac936c..2a6b8ea 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -54,11 +54,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
54 | /// <value> | 54 | /// <value> |
55 | /// The current movement animation | 55 | /// The current movement animation |
56 | /// </value> | 56 | /// </value> |
57 | public string CurrentMovementAnimation | 57 | public string CurrentMovementAnimation { get; private set; } |
58 | { | ||
59 | get { return m_movementAnimation; } | ||
60 | } | ||
61 | protected string m_movementAnimation = "CROUCH"; | ||
62 | 58 | ||
63 | private int m_animTickFall; | 59 | private int m_animTickFall; |
64 | public int m_animTickJump; // ScenePresence has to see this to control +Z force | 60 | public int m_animTickJump; // ScenePresence has to see this to control +Z force |
@@ -80,6 +76,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
80 | public ScenePresenceAnimator(ScenePresence sp) | 76 | public ScenePresenceAnimator(ScenePresence sp) |
81 | { | 77 | { |
82 | m_scenePresence = sp; | 78 | m_scenePresence = sp; |
79 | CurrentMovementAnimation = "CROUCH"; | ||
83 | } | 80 | } |
84 | 81 | ||
85 | public void AddAnimation(UUID animID, UUID objectID) | 82 | public void AddAnimation(UUID animID, UUID objectID) |
@@ -174,7 +171,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
174 | /// <summary> | 171 | /// <summary> |
175 | /// This method determines the proper movement related animation | 172 | /// This method determines the proper movement related animation |
176 | /// </summary> | 173 | /// </summary> |
177 | public string DetermineMovementAnimation() | 174 | private string DetermineMovementAnimation() |
178 | { | 175 | { |
179 | const float FALL_DELAY = 800f; | 176 | const float FALL_DELAY = 800f; |
180 | const float PREJUMP_DELAY = 200f; | 177 | const float PREJUMP_DELAY = 200f; |
@@ -277,7 +274,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
277 | return "FALLDOWN"; | 274 | return "FALLDOWN"; |
278 | } | 275 | } |
279 | 276 | ||
280 | return m_movementAnimation; | 277 | return CurrentMovementAnimation; |
281 | } | 278 | } |
282 | 279 | ||
283 | #endregion Falling/Floating/Landing | 280 | #endregion Falling/Floating/Landing |
@@ -331,7 +328,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
331 | 328 | ||
332 | #region Ground Movement | 329 | #region Ground Movement |
333 | 330 | ||
334 | if (m_movementAnimation == "FALLDOWN") | 331 | if (CurrentMovementAnimation == "FALLDOWN") |
335 | { | 332 | { |
336 | m_falling = false; | 333 | m_falling = false; |
337 | m_animTickFall = Environment.TickCount; | 334 | m_animTickFall = Environment.TickCount; |
@@ -344,16 +341,17 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
344 | else | 341 | else |
345 | return "LAND"; | 342 | return "LAND"; |
346 | } | 343 | } |
347 | else if ((m_movementAnimation == "LAND") || (m_movementAnimation == "SOFT_LAND") || (m_movementAnimation == "STANDUP")) | 344 | else if ((CurrentMovementAnimation == "LAND") || (CurrentMovementAnimation == "SOFT_LAND") || (CurrentMovementAnimation == "STANDUP")) |
348 | { | 345 | { |
349 | int landElapsed = Environment.TickCount - m_animTickFall; | 346 | int landElapsed = Environment.TickCount - m_animTickFall; |
350 | int limit = 1000; | 347 | int limit = 1000; |
351 | if(m_movementAnimation == "LAND") limit = 350; | 348 | if (CurrentMovementAnimation == "LAND") |
349 | limit = 350; | ||
352 | // NB if the above is set too long a weird anim reset from some place prevents STAND from being sent to client | 350 | // NB if the above is set too long a weird anim reset from some place prevents STAND from being sent to client |
353 | 351 | ||
354 | if ((m_animTickFall != 0) && (landElapsed <= limit)) | 352 | if ((m_animTickFall != 0) && (landElapsed <= limit)) |
355 | { | 353 | { |
356 | return m_movementAnimation; | 354 | return CurrentMovementAnimation; |
357 | } | 355 | } |
358 | else | 356 | else |
359 | { | 357 | { |
@@ -392,7 +390,7 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
392 | 390 | ||
393 | m_falling = false; | 391 | m_falling = false; |
394 | 392 | ||
395 | return m_movementAnimation; | 393 | return CurrentMovementAnimation; |
396 | } | 394 | } |
397 | 395 | ||
398 | /// <summary> | 396 | /// <summary> |
@@ -400,8 +398,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
400 | /// </summary> | 398 | /// </summary> |
401 | public void UpdateMovementAnimations() | 399 | public void UpdateMovementAnimations() |
402 | { | 400 | { |
403 | m_movementAnimation = DetermineMovementAnimation(); | 401 | CurrentMovementAnimation = DetermineMovementAnimation(); |
404 | TrySetMovementAnimation(m_movementAnimation); | 402 | TrySetMovementAnimation(CurrentMovementAnimation); |
405 | } | 403 | } |
406 | 404 | ||
407 | public UUID[] GetAnimationArray() | 405 | public UUID[] GetAnimationArray() |