diff options
author | Melanie | 2011-11-10 23:15:03 +0100 |
---|---|---|
committer | Melanie | 2011-11-10 23:42:48 +0000 |
commit | 0daece6f2b8c14f9de02aabfa136135161083bc2 (patch) | |
tree | 778a4cd925013ef67543444d9d3cf172551b020f /OpenSim/Region/Framework | |
parent | Implement nudging support for strafing motion (diff) | |
download | opensim-SC_OLD-0daece6f2b8c14f9de02aabfa136135161083bc2.zip opensim-SC_OLD-0daece6f2b8c14f9de02aabfa136135161083bc2.tar.gz opensim-SC_OLD-0daece6f2b8c14f9de02aabfa136135161083bc2.tar.bz2 opensim-SC_OLD-0daece6f2b8c14f9de02aabfa136135161083bc2.tar.xz |
Fix turn left and turn right properly. Works for both built-ins and LSL AOs
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | 17 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 5 |
2 files changed, 16 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs index 05cdf61..4cf854e 100644 --- a/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs +++ b/OpenSim/Region/Framework/Scenes/Animation/ScenePresenceAnimator.cs | |||
@@ -180,12 +180,17 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
180 | bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); | 180 | bool heldBack = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_AT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_AT_NEG); |
181 | bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); | 181 | bool heldLeft = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_POS || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_POS); |
182 | bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); | 182 | bool heldRight = ((controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_LEFT_NEG || (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_NUDGE_LEFT_NEG); |
183 | //bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; | 183 | bool heldTurnLeft = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_LEFT; |
184 | //bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; | 184 | bool heldTurnRight = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT) == AgentManager.ControlFlags.AGENT_CONTROL_TURN_RIGHT; |
185 | bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; | 185 | bool heldUp = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) == AgentManager.ControlFlags.AGENT_CONTROL_UP_POS; |
186 | bool heldDown = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; | 186 | bool heldDown = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) == AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG; |
187 | //bool flying = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) == AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 187 | //bool flying = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) == AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
188 | //bool mouselook = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) == AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK; | 188 | //bool mouselook = (controlFlags & AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK) == AgentManager.ControlFlags.AGENT_CONTROL_MOUSELOOK; |
189 | if (heldForward || heldBack || heldLeft || heldRight || heldUp || heldDown) | ||
190 | { | ||
191 | heldTurnLeft = false; | ||
192 | heldTurnRight = false; | ||
193 | } | ||
189 | 194 | ||
190 | // Direction in which the avatar is trying to move | 195 | // Direction in which the avatar is trying to move |
191 | Vector3 move = Vector3.Zero; | 196 | Vector3 move = Vector3.Zero; |
@@ -363,10 +368,10 @@ namespace OpenSim.Region.Framework.Scenes.Animation | |||
363 | // Not walking | 368 | // Not walking |
364 | if (move.Z < 0) | 369 | if (move.Z < 0) |
365 | return "CROUCH"; | 370 | return "CROUCH"; |
366 | // else if (heldTurnLeft) | 371 | else if (heldTurnLeft) |
367 | // return "TURNLEFT"; | 372 | return "TURNLEFT"; |
368 | // else if (heldTurnRight) | 373 | else if (heldTurnRight) |
369 | // return "TURNRIGHT"; | 374 | return "TURNRIGHT"; |
370 | else | 375 | else |
371 | return "STAND"; | 376 | return "STAND"; |
372 | } | 377 | } |
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index e662492..fdf944b 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -1387,6 +1387,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1387 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) | 1387 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) |
1388 | m_updateCount = UPDATE_COUNT; | 1388 | m_updateCount = UPDATE_COUNT; |
1389 | 1389 | ||
1390 | // Make turning in place work | ||
1391 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 || | ||
1392 | (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0) | ||
1393 | m_updateCount = UPDATE_COUNT; | ||
1394 | |||
1390 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) | 1395 | if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) |
1391 | { | 1396 | { |
1392 | StandUp(); | 1397 | StandUp(); |