diff options
author | UbitUmarov | 2014-09-10 19:30:57 +0100 |
---|---|---|
committer | UbitUmarov | 2014-09-10 19:30:57 +0100 |
commit | f66b58cf00d4dcbd9d11030809bf9766330966f2 (patch) | |
tree | 40cf47bda3160e03d1d94918a795179b01ca2778 /OpenSim/Region/Framework/Scenes/Animation | |
parent | Fix a nullref that can hit Vivox voice (diff) | |
download | opensim-SC_OLD-f66b58cf00d4dcbd9d11030809bf9766330966f2.zip opensim-SC_OLD-f66b58cf00d4dcbd9d11030809bf9766330966f2.tar.gz opensim-SC_OLD-f66b58cf00d4dcbd9d11030809bf9766330966f2.tar.bz2 opensim-SC_OLD-f66b58cf00d4dcbd9d11030809bf9766330966f2.tar.xz |
*TEST* add movement states SIT and SITGROUND. ScenePresence on SIT,
SITGROUND or STAND, sets directly the state, and desired sitAnimation for
default sits
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Animation')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index bbc5745..4d1d913 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -200,21 +200,28 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
200 | if (overridenAnim != UUID.Zero) | 200 | if (overridenAnim != UUID.Zero) |
201 | { | 201 | { |
202 | m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID); | 202 | m_animations.SetDefaultAnimation(overridenAnim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID); |
203 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION}); | 203 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION }); |
204 | SendAnimPack(); | 204 | SendAnimPack(); |
205 | ret = true; | 205 | ret = true; |
206 | } | 206 | } |
207 | else if (m_animations.TrySetDefaultAnimation( | 207 | else |
208 | anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) | ||
209 | { | 208 | { |
210 | // m_log.DebugFormat( | 209 | // translate sit and sitground state animations |
211 | // "[SCENE PRESENCE ANIMATOR]: Updating movement animation to {0} for {1}", | 210 | if (anim == "SIT" || anim == "SITGROUND") |
212 | // anim, m_scenePresence.Name); | 211 | anim = m_scenePresence.sitAnimation; |
213 | 212 | ||
214 | // 16384 is CHANGED_ANIMATION | 213 | if (m_animations.TrySetDefaultAnimation( |
215 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION}); | 214 | anim, m_scenePresence.ControllingClient.NextAnimationSequenceNumber, m_scenePresence.UUID)) |
216 | SendAnimPack(); | 215 | { |
217 | ret = true; | 216 | // m_log.DebugFormat( |
217 | // "[SCENE PRESENCE ANIMATOR]: Updating movement animation to {0} for {1}", | ||
218 | // anim, m_scenePresence.Name); | ||
219 | |||
220 | // 16384 is CHANGED_ANIMATION | ||
221 | m_scenePresence.SendScriptEventToAttachments("changed", new Object[] { (int)Changed.ANIMATION }); | ||
222 | SendAnimPack(); | ||
223 | ret = true; | ||
224 | } | ||
218 | } | 225 | } |
219 | } | 226 | } |
220 | else | 227 | else |
@@ -236,6 +243,11 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
236 | const float JUMP_PERIOD = 800f; | 243 | const float JUMP_PERIOD = 800f; |
237 | #region Inputs | 244 | #region Inputs |
238 | 245 | ||
246 | if (m_scenePresence.SitGround) | ||
247 | return "SITGROUND"; | ||
248 | if (m_scenePresence.ParentID != 0 || m_scenePresence.ParentUUID != UUID.Zero) | ||
249 | return "SIT"; | ||
250 | |||
239 | AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; | 251 | AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; |
240 | PhysicsActor actor = m_scenePresence.PhysicsActor; | 252 | PhysicsActor actor = m_scenePresence.PhysicsActor; |
241 | 253 | ||
@@ -491,15 +503,20 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
491 | 503 | ||
492 | public bool ForceUpdateMovementAnimations() | 504 | public bool ForceUpdateMovementAnimations() |
493 | { | 505 | { |
494 | // m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Updating movement animations for {0}", m_scenePresence.Name); | 506 | lock (m_animations) |
507 | { | ||
508 | CurrentMovementAnimation = DetermineMovementAnimation(); | ||
509 | return TrySetMovementAnimation(CurrentMovementAnimation); | ||
510 | } | ||
511 | } | ||
495 | 512 | ||
496 | bool ret = false; | 513 | public bool SetMovementAnimations(string motionState) |
514 | { | ||
497 | lock (m_animations) | 515 | lock (m_animations) |
498 | { | 516 | { |
499 | string newMovementAnimation = DetermineMovementAnimation(); | 517 | CurrentMovementAnimation = motionState; |
500 | ret = TrySetMovementAnimation(newMovementAnimation); | 518 | return TrySetMovementAnimation(CurrentMovementAnimation); |
501 | } | 519 | } |
502 | return ret; | ||
503 | } | 520 | } |
504 | 521 | ||
505 | public UUID[] GetAnimationArray() | 522 | public UUID[] GetAnimationArray() |