aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs6
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs11
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs4
4 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index fc89b2a..01ab199 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -5447,10 +5447,10 @@ namespace OpenSim.Region.Framework.Scenes
5447 for (int i = 0; i < 5; i++) 5447 for (int i = 0; i < 5; i++)
5448 presence.PhysicsActor.IsColliding = true; 5448 presence.PhysicsActor.IsColliding = true;
5449 5449
5450// Vector3 targetPos = presence.MoveToPositionTarget; 5450 if (presence.LandAtTarget)
5451// if (m_avatars[presence.UUID].LandAtTarget) 5451 presence.PhysicsActor.Flying = false;
5452// presence.PhysicsActor.Flying = false;
5453 5452
5453// Vector3 targetPos = presence.MoveToPositionTarget;
5454// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y]; 5454// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
5455// if (targetPos.Z - terrainHeight < 0.2) 5455// if (targetPos.Z - terrainHeight < 0.2)
5456// { 5456// {
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 5e9cb32..6ff5364 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -1939,7 +1939,7 @@ namespace OpenSim.Region.Framework.Scenes
1939 ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar); 1939 ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
1940 if (avatar != null) 1940 if (avatar != null)
1941 { 1941 {
1942 avatar.MoveToTarget(target, false); 1942 avatar.MoveToTarget(target, false, false);
1943 } 1943 }
1944 } 1944 }
1945 else 1945 else
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 91052ec..09a8bb7 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -236,6 +236,11 @@ namespace OpenSim.Region.Framework.Scenes
236 public Vector3 MoveToPositionTarget { get; private set; } 236 public Vector3 MoveToPositionTarget { get; private set; }
237 private Quaternion m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f); 237 private Quaternion m_offsetRotation = new Quaternion(0.0f, 0.0f, 0.0f, 1.0f);
238 238
239 /// <summary>
240 /// Controls whether an avatar automatically moving to a target will land when it gets there (if flying).
241 /// </summary>
242 public bool LandAtTarget { get; private set; }
243
239 private bool m_followCamAuto; 244 private bool m_followCamAuto;
240 245
241 private int m_movementUpdateCount; 246 private int m_movementUpdateCount;
@@ -1829,7 +1834,10 @@ namespace OpenSim.Region.Framework.Scenes
1829 /// This is to allow movement to targets that are known to be on an elevated platform with a continuous path 1834 /// This is to allow movement to targets that are known to be on an elevated platform with a continuous path
1830 /// from start to finish. 1835 /// from start to finish.
1831 /// </param> 1836 /// </param>
1832 public void MoveToTarget(Vector3 pos, bool noFly) 1837 /// <param name="landAtTarget">
1838 /// If true and the avatar starts flying during the move then land at the target.
1839 /// </param>
1840 public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget)
1833 { 1841 {
1834 m_log.DebugFormat( 1842 m_log.DebugFormat(
1835 "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}", 1843 "[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}",
@@ -1868,6 +1876,7 @@ namespace OpenSim.Region.Framework.Scenes
1868 else if (pos.Z > terrainHeight) 1876 else if (pos.Z > terrainHeight)
1869 PhysicsActor.Flying = true; 1877 PhysicsActor.Flying = true;
1870 1878
1879 LandAtTarget = landAtTarget;
1871 MovingToTarget = true; 1880 MovingToTarget = true;
1872 MoveToPositionTarget = pos; 1881 MoveToPositionTarget = pos;
1873 1882
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
index 5a85d7f..64c36ff 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
85 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos)); 85 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
86 86
87 Vector3 targetPos = startPos + new Vector3(0, 10, 0); 87 Vector3 targetPos = startPos + new Vector3(0, 10, 0);
88 sp.MoveToTarget(targetPos, false); 88 sp.MoveToTarget(targetPos, false, false);
89 89
90 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos)); 90 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
91 Assert.That( 91 Assert.That(
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
110 // Try a second movement 110 // Try a second movement
111 startPos = sp.AbsolutePosition; 111 startPos = sp.AbsolutePosition;
112 targetPos = startPos + new Vector3(10, 0, 0); 112 targetPos = startPos + new Vector3(10, 0, 0);
113 sp.MoveToTarget(targetPos, false); 113 sp.MoveToTarget(targetPos, false, false);
114 114
115 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos)); 115 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
116 Assert.That( 116 Assert.That(