aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-08-03 23:40:05 +0100
committerJustin Clark-Casey (justincc)2011-08-03 23:40:05 +0100
commit31fb6b2d72081a7ab27199f57e6a40fc1e478bc2 (patch)
tree4e4160247f868de2202b5bc5a25d3342a542ead5 /OpenSim/Region
parentrename NPC.Autopilot to NPC.MoveToTarget internally. Add method doc to INPCM... (diff)
downloadopensim-SC_OLD-31fb6b2d72081a7ab27199f57e6a40fc1e478bc2.zip
opensim-SC_OLD-31fb6b2d72081a7ab27199f57e6a40fc1e478bc2.tar.gz
opensim-SC_OLD-31fb6b2d72081a7ab27199f57e6a40fc1e478bc2.tar.bz2
opensim-SC_OLD-31fb6b2d72081a7ab27199f57e6a40fc1e478bc2.tar.xz
remove move to duck walk compensation - no longer required.
extends npc move to regression test to check stop after sufficient sim updates
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs24
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs6
2 files changed, 17 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index f482974..6a3e79a 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1568,9 +1568,9 @@ namespace OpenSim.Region.Framework.Scenes
1568 if (allowUpdate && (m_moveToPositionInProgress && !m_autopilotMoving)) 1568 if (allowUpdate && (m_moveToPositionInProgress && !m_autopilotMoving))
1569 { 1569 {
1570 double distanceToTarget = Util.GetDistanceTo(AbsolutePosition, MoveToPositionTarget); 1570 double distanceToTarget = Util.GetDistanceTo(AbsolutePosition, MoveToPositionTarget);
1571 m_log.DebugFormat( 1571// m_log.DebugFormat(
1572 "[SCENE PRESENCE]: Abs pos of {0} is {1}, target {2}, distance {3}", 1572// "[SCENE PRESENCE]: Abs pos of {0} is {1}, target {2}, distance {3}",
1573 Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget); 1573// Name, AbsolutePosition, MoveToPositionTarget, distanceToTarget);
1574 1574
1575 // Check the error term of the current position in relation to the target position 1575 // Check the error term of the current position in relation to the target position
1576 if (distanceToTarget <= 1) 1576 if (distanceToTarget <= 1)
@@ -1688,15 +1688,15 @@ namespace OpenSim.Region.Framework.Scenes
1688 || pos.Z < 0) 1688 || pos.Z < 0)
1689 return; 1689 return;
1690 1690
1691 Vector3 heightAdjust = new Vector3(0, 0, Appearance.AvatarHeight / 2); 1691// Vector3 heightAdjust = new Vector3(0, 0, Appearance.AvatarHeight / 2);
1692 pos += heightAdjust; 1692// pos += heightAdjust;
1693 1693//
1694 // Anti duck-walking measure 1694// // Anti duck-walking measure
1695 if (Math.Abs(pos.Z - AbsolutePosition.Z) < 0.2f) 1695// if (Math.Abs(pos.Z - AbsolutePosition.Z) < 0.2f)
1696 { 1696// {
1697// m_log.DebugFormat("[SCENE PRESENCE]: Adjusting MoveToPosition from {0} to {1}", pos, AbsolutePosition); 1697//// m_log.DebugFormat("[SCENE PRESENCE]: Adjusting MoveToPosition from {0} to {1}", pos, AbsolutePosition);
1698 pos.Z = AbsolutePosition.Z; 1698// pos.Z = AbsolutePosition.Z;
1699 } 1699// }
1700 1700
1701 m_moveToPositionInProgress = true; 1701 m_moveToPositionInProgress = true;
1702 MoveToPositionTarget = pos; 1702 MoveToPositionTarget = pos;
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index 2e3d431..57847f7 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -125,7 +125,11 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
125 Assert.That(npc.AbsolutePosition.Z, Is.GreaterThan(startPos.Z)); 125 Assert.That(npc.AbsolutePosition.Z, Is.GreaterThan(startPos.Z));
126 Assert.That(npc.AbsolutePosition.Z, Is.LessThan(targetPos.Z)); 126 Assert.That(npc.AbsolutePosition.Z, Is.LessThan(targetPos.Z));
127 127
128 // Not yet complete 128 for (int i = 0; i < 10; i++)
129 scene.Update();
130
131 double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos);
132 Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position");
129 } 133 }
130 } 134 }
131} \ No newline at end of file 135} \ No newline at end of file