diff options
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 4 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 24 |
2 files changed, 19 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index e4e5ab6..175e8ed 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | using System; | 28 | using System; |
29 | using System.Threading; | ||
29 | using System.Collections.Generic; | 30 | using System.Collections.Generic; |
30 | using System.Reflection; | 31 | using System.Reflection; |
31 | using log4net; | 32 | using log4net; |
@@ -169,6 +170,7 @@ TrySetMovementAnimation("STAND"); | |||
169 | #region Inputs | 170 | #region Inputs |
170 | 171 | ||
171 | AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; | 172 | AgentManager.ControlFlags controlFlags = (AgentManager.ControlFlags)m_scenePresence.AgentControlFlags; |
173 | // m_log.DebugFormat("[ANIM]: Control flags: {0}", controlFlags); | ||
172 | PhysicsActor actor = m_scenePresence.PhysicsActor; | 174 | PhysicsActor actor = m_scenePresence.PhysicsActor; |
173 | 175 | ||
174 | // Create forward and left vectors from the current avatar rotation | 176 | // Create forward and left vectors from the current avatar rotation |
@@ -190,12 +192,12 @@ TrySetMovementAnimation("STAND"); | |||
190 | 192 | ||
191 | // Direction in which the avatar is trying to move | 193 | // Direction in which the avatar is trying to move |
192 | Vector3 move = Vector3.Zero; | 194 | Vector3 move = Vector3.Zero; |
193 | if (heldForward) { move.X += fwd.X; move.Y += fwd.Y; } | ||
194 | if (heldBack) { move.X -= fwd.X; move.Y -= fwd.Y; } | 195 | if (heldBack) { move.X -= fwd.X; move.Y -= fwd.Y; } |
195 | if (heldLeft) { move.X += left.X; move.Y += left.Y; } | 196 | if (heldLeft) { move.X += left.X; move.Y += left.Y; } |
196 | if (heldRight) { move.X -= left.X; move.Y -= left.Y; } | 197 | if (heldRight) { move.X -= left.X; move.Y -= left.Y; } |
197 | if (heldUp) { move.Z += 1; } | 198 | if (heldUp) { move.Z += 1; } |
198 | if (heldDown) { move.Z -= 1; } | 199 | if (heldDown) { move.Z -= 1; } |
200 | if (heldForward) { move.X += fwd.X; move.Y += fwd.Y; } | ||
199 | 201 | ||
200 | // Is the avatar trying to move? | 202 | // Is the avatar trying to move? |
201 | // bool moving = (move != Vector3.Zero); | 203 | // bool moving = (move != Vector3.Zero); |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9884acd..d43f67f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1486,6 +1486,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1486 | 1486 | ||
1487 | #endregion Inputs | 1487 | #endregion Inputs |
1488 | 1488 | ||
1489 | // Make anims work for client side autopilot | ||
1490 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) | ||
1491 | m_updateCount = UPDATE_COUNT; | ||
1492 | |||
1489 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) | 1493 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) |
1490 | { | 1494 | { |
1491 | StandUp(); | 1495 | StandUp(); |
@@ -1856,9 +1860,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1856 | /// </param> | 1860 | /// </param> |
1857 | public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget) | 1861 | public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget) |
1858 | { | 1862 | { |
1859 | m_log.DebugFormat( | 1863 | if (SitGround) |
1860 | "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", | 1864 | StandUp(); |
1861 | Name, pos, m_scene.RegionInfo.RegionName); | 1865 | |
1866 | // m_log.DebugFormat( | ||
1867 | // "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", | ||
1868 | // Name, pos, m_scene.RegionInfo.RegionName); | ||
1862 | 1869 | ||
1863 | if (pos.X < 0 || pos.X >= Constants.RegionSize | 1870 | if (pos.X < 0 || pos.X >= Constants.RegionSize |
1864 | || pos.Y < 0 || pos.Y >= Constants.RegionSize | 1871 | || pos.Y < 0 || pos.Y >= Constants.RegionSize |
@@ -1884,9 +1891,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1884 | if (pos.Z - terrainHeight < 0.2) | 1891 | if (pos.Z - terrainHeight < 0.2) |
1885 | pos.Z = terrainHeight; | 1892 | pos.Z = terrainHeight; |
1886 | 1893 | ||
1887 | m_log.DebugFormat( | 1894 | // m_log.DebugFormat( |
1888 | "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", | 1895 | // "[SCENE PRESENCE]: Avatar {0} set move to target {1} (terrain height {2}) in {3}", |
1889 | Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); | 1896 | // Name, pos, terrainHeight, m_scene.RegionInfo.RegionName); |
1890 | 1897 | ||
1891 | if (noFly) | 1898 | if (noFly) |
1892 | PhysicsActor.Flying = false; | 1899 | PhysicsActor.Flying = false; |
@@ -1922,7 +1929,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1922 | /// </summary> | 1929 | /// </summary> |
1923 | public void ResetMoveToTarget() | 1930 | public void ResetMoveToTarget() |
1924 | { | 1931 | { |
1925 | m_log.DebugFormat("[SCENE PRESENCE]: Resetting move to target for {0}", Name); | 1932 | // m_log.DebugFormat("[SCENE PRESENCE]: Resetting move to target for {0}", Name); |
1926 | 1933 | ||
1927 | MovingToTarget = false; | 1934 | MovingToTarget = false; |
1928 | MoveToPositionTarget = Vector3.Zero; | 1935 | MoveToPositionTarget = Vector3.Zero; |
@@ -2061,7 +2068,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
2061 | SendAvatarDataToAllAgents(); | 2068 | SendAvatarDataToAllAgents(); |
2062 | m_requestedSitTargetID = 0; | 2069 | m_requestedSitTargetID = 0; |
2063 | } | 2070 | } |
2064 | Animator.TrySetMovementAnimation("STAND"); | 2071 | |
2072 | Animator.UpdateMovementAnimations(); | ||
2065 | } | 2073 | } |
2066 | 2074 | ||
2067 | private SceneObjectPart FindNextAvailableSitTarget(UUID targetID) | 2075 | private SceneObjectPart FindNextAvailableSitTarget(UUID targetID) |