aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorMike Mazur2009-02-23 04:07:46 +0000
committerMike Mazur2009-02-23 04:07:46 +0000
commit05bbfd57f187df0911fac531d834ec554ea6df73 (patch)
treef22751651cac87d7ca156ff31e188502c6cff21f /OpenSim
parentMantis#3187. Thank you kindly, DoranZemlja for a patch that: (diff)
downloadopensim-SC_OLD-05bbfd57f187df0911fac531d834ec554ea6df73.zip
opensim-SC_OLD-05bbfd57f187df0911fac531d834ec554ea6df73.tar.gz
opensim-SC_OLD-05bbfd57f187df0911fac531d834ec554ea6df73.tar.bz2
opensim-SC_OLD-05bbfd57f187df0911fac531d834ec554ea6df73.tar.xz
Prevent avatar from walking along z-axis
Thanks mirceakitsune for a patch that prevents the avatar from trying to walk along the Z-axis in mouselook mode (or left-click the avatar and walk) while looking up or down. Fixes Mantis #946.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs20
1 files changed, 19 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 85437f6..c012350 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -637,6 +637,19 @@ namespace OpenSim.Region.Framework.Scenes
637 Dir_Vectors[5] = new Vector3(0, 0, -0.5f); //DOWN_Nudge 637 Dir_Vectors[5] = new Vector3(0, 0, -0.5f); //DOWN_Nudge
638 } 638 }
639 639
640 private Vector3[] GetWalkDirectionVectors()
641 {
642 Vector3[] vector = new Vector3[6];
643 vector[0] = new Vector3(m_CameraUpAxis.Z, 0, -m_CameraAtAxis.Z); //FORWARD
644 vector[1] = new Vector3(-m_CameraUpAxis.Z, 0, m_CameraAtAxis.Z); //BACK
645 vector[2] = new Vector3(0, 1, 0); //LEFT
646 vector[3] = new Vector3(0, -1, 0); //RIGHT
647 vector[4] = new Vector3(m_CameraAtAxis.Z, 0, m_CameraUpAxis.Z); //UP
648 vector[5] = new Vector3(-m_CameraAtAxis.Z, 0, -m_CameraUpAxis.Z); //DOWN
649 vector[5] = new Vector3(-m_CameraAtAxis.Z, 0, -m_CameraUpAxis.Z); //DOWN_Nudge
650 return vector;
651 }
652
640 #endregion 653 #endregion
641 654
642 /// <summary> 655 /// <summary>
@@ -1192,6 +1205,11 @@ namespace OpenSim.Region.Framework.Scenes
1192 { 1205 {
1193 bool bAllowUpdateMoveToPosition = false; 1206 bool bAllowUpdateMoveToPosition = false;
1194 bool bResetMoveToPosition = false; 1207 bool bResetMoveToPosition = false;
1208
1209 Vector3[] dirVectors;
1210 if (m_physicsActor.Flying) dirVectors = Dir_Vectors;
1211 else dirVectors = GetWalkDirectionVectors();
1212
1195 foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags))) 1213 foreach (Dir_ControlFlags DCF in Enum.GetValues(typeof (Dir_ControlFlags)))
1196 { 1214 {
1197 if ((flags & (uint) DCF) != 0) 1215 if ((flags & (uint) DCF) != 0)
@@ -1200,7 +1218,7 @@ namespace OpenSim.Region.Framework.Scenes
1200 DCFlagKeyPressed = true; 1218 DCFlagKeyPressed = true;
1201 try 1219 try
1202 { 1220 {
1203 agent_control_v3 += Dir_Vectors[i]; 1221 agent_control_v3 += dirVectors[i];
1204 } 1222 }
1205 catch (IndexOutOfRangeException) 1223 catch (IndexOutOfRangeException)
1206 { 1224 {