aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2011-11-10 23:15:03 +0100
committerMelanie2011-11-10 23:15:03 +0100
commit008b213ec092aafa59fde39c3e150bfebdac23fe (patch)
treea8613d4f74e01a16cd1568126c6d7e834a47e7a7 /OpenSim/Region/Framework
parentMerge branch 'master' into bigmerge (diff)
downloadopensim-SC-008b213ec092aafa59fde39c3e150bfebdac23fe.zip
opensim-SC-008b213ec092aafa59fde39c3e150bfebdac23fe.tar.gz
opensim-SC-008b213ec092aafa59fde39c3e150bfebdac23fe.tar.bz2
opensim-SC-008b213ec092aafa59fde39c3e150bfebdac23fe.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.cs17
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs5
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 c4bd016..fe2dfef 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1392,6 +1392,11 @@ namespace OpenSim.Region.Framework.Scenes
1392 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0) 1392 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_AT_POS) != 0)
1393 m_updateCount = UPDATE_COUNT; 1393 m_updateCount = UPDATE_COUNT;
1394 1394
1395 // Make turning in place work
1396 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_POS) != 0 ||
1397 (flags & AgentManager.ControlFlags.AGENT_CONTROL_YAW_NEG) != 0)
1398 m_updateCount = UPDATE_COUNT;
1399
1395 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) 1400 if ((flags & AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0)
1396 { 1401 {
1397 StandUp(); 1402 StandUp();