From 4cde02a2a36dd7f6afce49e5e6db78af021ab14b Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Sat, 30 Nov 2013 01:44:30 +0000 Subject: Implement most effects of AGENT_CONTROL_STOP AGENT_CONTROL_STOP is specified to SP.HandleAgentUpdate if the user holds down the space bar on a viewer. For a stopped avatar, this prevents fly or walk/run (though not rotate) until released. For a walking/running avatar, this reduces movement to half speed. For a flying avatar, this stops the avatar. These are observed behaviours on the LL grid - there was no previous OpenSimulator implementation This commit introduces an optional parameter to SP.AddNewMovement(), which means that it will no longer compile on .NET 3.5 or earlier versions of Mono than 2.8 Currently, this does not work for jumping, and if used whilst flying the avatar continues the fly animation even though it does not move --- .../Framework/Scenes/Animation/ScenePresenceAnimator.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Animation') diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 3b5a5bd..5beee73 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs @@ -403,11 +403,18 @@ namespace OpenSim.Region.Framework.Scenes.Animation Falling = false; // Walking / crouchwalking / running if (move.Z < 0f) + { return "CROUCHWALK"; - else if (m_scenePresence.SetAlwaysRun) - return "RUN"; - else - return "WALK"; + } + // We need to prevent these animations if the user tries to make their avatar walk or run whilst + // specifying AGENT_CONTROL_STOP (pressing down space on viewers). + else if (!m_scenePresence.AgentControlStopActive) + { + if (m_scenePresence.SetAlwaysRun) + return "RUN"; + else + return "WALK"; + } } else if (!m_jumping) { @@ -435,6 +442,8 @@ namespace OpenSim.Region.Framework.Scenes.Animation /// 'true' if the animation was changed public bool UpdateMovementAnimations() { +// m_log.DebugFormat("[SCENE PRESENCE ANIMATOR]: Updating movement animations for {0}", m_scenePresence.Name); + bool ret = false; lock (m_animations) { -- cgit v1.1