remove move to duck walk compensation - no longer required.

extends npc move to regression test to check stop after sufficient sim updates
bulletsim
Justin Clark-Casey (justincc) 2011-08-03 23:40:05 +01:00
parent 61d49d4f63
commit 31fb6b2d72
2 changed files with 17 additions and 13 deletions

View File

@ -1568,9 +1568,9 @@ namespace OpenSim.Region.Framework.Scenes
if (allowUpdate && (m_moveToPositionInProgress && !m_autopilotMoving))
{
double distanceToTarget = Util.GetDistanceTo(AbsolutePosition, MoveToPositionTarget);
m_log.DebugFormat(
"[SCENE PRESENCE]: Abs pos of {0} is {1}, target {2}, distance {3}",
Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
// m_log.DebugFormat(
// "[SCENE PRESENCE]: Abs pos of {0} is {1}, target {2}, distance {3}",
// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
// Check the error term of the current position in relation to the target position
if (distanceToTarget <= 1)
@ -1688,15 +1688,15 @@ namespace OpenSim.Region.Framework.Scenes
|| pos.Z < 0)
return;
Vector3 heightAdjust = new Vector3(0, 0, Appearance.AvatarHeight / 2);
pos += heightAdjust;
// Anti duck-walking measure
if (Math.Abs(pos.Z - AbsolutePosition.Z) < 0.2f)
{
// m_log.DebugFormat("[SCENE PRESENCE]: Adjusting MoveToPosition from {0} to {1}", pos, AbsolutePosition);
pos.Z = AbsolutePosition.Z;
}
// Vector3 heightAdjust = new Vector3(0, 0, Appearance.AvatarHeight / 2);
// pos += heightAdjust;
//
// // Anti duck-walking measure
// if (Math.Abs(pos.Z - AbsolutePosition.Z) < 0.2f)
// {
//// m_log.DebugFormat("[SCENE PRESENCE]: Adjusting MoveToPosition from {0} to {1}", pos, AbsolutePosition);
// pos.Z = AbsolutePosition.Z;
// }
m_moveToPositionInProgress = true;
MoveToPositionTarget = pos;

View File

@ -125,7 +125,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
Assert.That(npc.AbsolutePosition.Z, Is.GreaterThan(startPos.Z));
Assert.That(npc.AbsolutePosition.Z, Is.LessThan(targetPos.Z));
// Not yet complete
for (int i = 0; i < 10; i++)
scene.Update();
double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos);
Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position");
}
}
}