mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
Merge branch 'master' of ssh://opensimulator.org/var/git/opensim
This commit is contained in:
@@ -5178,10 +5178,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
for (int i = 0; i < 5; i++)
|
||||
presence.PhysicsActor.IsColliding = true;
|
||||
|
||||
// Vector3 targetPos = presence.MoveToPositionTarget;
|
||||
// if (m_avatars[presence.UUID].LandAtTarget)
|
||||
// presence.PhysicsActor.Flying = false;
|
||||
if (presence.LandAtTarget)
|
||||
presence.PhysicsActor.Flying = false;
|
||||
|
||||
// Vector3 targetPos = presence.MoveToPositionTarget;
|
||||
// float terrainHeight = (float)presence.Scene.Heightmap[(int)targetPos.X, (int)targetPos.Y];
|
||||
// if (targetPos.Z - terrainHeight < 0.2)
|
||||
// {
|
||||
|
||||
@@ -1599,7 +1599,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
ScenePresence avatar = m_scene.GetScenePresence(AttachedAvatar);
|
||||
if (avatar != null)
|
||||
{
|
||||
avatar.MoveToTarget(target, false);
|
||||
avatar.MoveToTarget(target, false, false);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -220,6 +220,11 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
public bool MovingToTarget { get; private set; }
|
||||
public Vector3 MoveToPositionTarget { get; private set; }
|
||||
|
||||
/// <summary>
|
||||
/// Controls whether an avatar automatically moving to a target will land when it gets there (if flying).
|
||||
/// </summary>
|
||||
public bool LandAtTarget { get; private set; }
|
||||
|
||||
private bool m_followCamAuto;
|
||||
|
||||
private int m_movementUpdateCount;
|
||||
@@ -1681,7 +1686,10 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// This is to allow movement to targets that are known to be on an elevated platform with a continuous path
|
||||
/// from start to finish.
|
||||
/// </param>
|
||||
public void MoveToTarget(Vector3 pos, bool noFly)
|
||||
/// <param name="landAtTarget">
|
||||
/// If true and the avatar starts flying during the move then land at the target.
|
||||
/// </param>
|
||||
public void MoveToTarget(Vector3 pos, bool noFly, bool landAtTarget)
|
||||
{
|
||||
m_log.DebugFormat(
|
||||
"[SCENE PRESENCE]: Avatar {0} received request to move to position {1} in {2}",
|
||||
@@ -1720,6 +1728,7 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
else if (pos.Z > terrainHeight)
|
||||
PhysicsActor.Flying = true;
|
||||
|
||||
LandAtTarget = landAtTarget;
|
||||
MovingToTarget = true;
|
||||
MoveToPositionTarget = pos;
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
|
||||
|
||||
Vector3 targetPos = startPos + new Vector3(0, 10, 0);
|
||||
sp.MoveToTarget(targetPos, false);
|
||||
sp.MoveToTarget(targetPos, false, false);
|
||||
|
||||
Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
|
||||
Assert.That(
|
||||
@@ -110,7 +110,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests
|
||||
// Try a second movement
|
||||
startPos = sp.AbsolutePosition;
|
||||
targetPos = startPos + new Vector3(10, 0, 0);
|
||||
sp.MoveToTarget(targetPos, false);
|
||||
sp.MoveToTarget(targetPos, false, false);
|
||||
|
||||
Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
|
||||
Assert.That(
|
||||
|
||||
Reference in New Issue
Block a user