aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-03-20 23:12:21 +0000
committerJustin Clark-Casey (justincc)2012-03-20 23:12:21 +0000
commit30b2a8c778d02926e038bc62977c4a4c9dbec5ee (patch)
tree0b35af969e4ac337cf4521d07b1f25765a5b3273 /OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
parentreduce avatar verticle jump from the absurd 5 meter jump to a less (diff)
downloadopensim-SC-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.zip
opensim-SC-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.tar.gz
opensim-SC-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.tar.bz2
opensim-SC-30b2a8c778d02926e038bc62977c4a4c9dbec5ee.tar.xz
Move frame loop entirely within Scene.Update() for better future performance analysis and stat accuracy.
Update() now accepts a frames parameter which can control the number of frames updated. -1 will update until shutdown. The watchdog updating moves above the maintc recalculation for any required sleep since it should be accounted for within the frame.
Diffstat (limited to 'OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs')
-rw-r--r--OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs12
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
index 9a7e9e8..eea0b2e 100644
--- a/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
+++ b/OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs
@@ -238,7 +238,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
238 // For now, we'll make the scene presence fly to simplify this test, but this needs to change. 238 // For now, we'll make the scene presence fly to simplify this test, but this needs to change.
239 npc.Flying = true; 239 npc.Flying = true;
240 240
241 m_scene.Update(); 241 m_scene.Update(1);
242 Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); 242 Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos));
243 243
244 Vector3 targetPos = startPos + new Vector3(0, 10, 0); 244 Vector3 targetPos = startPos + new Vector3(0, 10, 0);
@@ -249,7 +249,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
249 Assert.That( 249 Assert.That(
250 npc.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0.7071068f, 0.7071068f), 0.000001)); 250 npc.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0.7071068f, 0.7071068f), 0.000001));
251 251
252 m_scene.Update(); 252 m_scene.Update(1);
253 253
254 // We should really check the exact figure. 254 // We should really check the exact figure.
255 Assert.That(npc.AbsolutePosition.X, Is.EqualTo(startPos.X)); 255 Assert.That(npc.AbsolutePosition.X, Is.EqualTo(startPos.X));
@@ -257,8 +257,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
257 Assert.That(npc.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); 257 Assert.That(npc.AbsolutePosition.Z, Is.EqualTo(startPos.Z));
258 Assert.That(npc.AbsolutePosition.Z, Is.LessThan(targetPos.X)); 258 Assert.That(npc.AbsolutePosition.Z, Is.LessThan(targetPos.X));
259 259
260 for (int i = 0; i < 10; i++) 260 m_scene.Update(10);
261 m_scene.Update();
262 261
263 double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos); 262 double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos);
264 Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on first move"); 263 Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on first move");
@@ -275,7 +274,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
275 Assert.That( 274 Assert.That(
276 npc.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0, 1), 0.000001)); 275 npc.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0, 1), 0.000001));
277 276
278 m_scene.Update(); 277 m_scene.Update(1);
279 278
280 // We should really check the exact figure. 279 // We should really check the exact figure.
281 Assert.That(npc.AbsolutePosition.X, Is.GreaterThan(startPos.X)); 280 Assert.That(npc.AbsolutePosition.X, Is.GreaterThan(startPos.X));
@@ -283,8 +282,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests
283 Assert.That(npc.AbsolutePosition.Y, Is.EqualTo(startPos.Y)); 282 Assert.That(npc.AbsolutePosition.Y, Is.EqualTo(startPos.Y));
284 Assert.That(npc.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); 283 Assert.That(npc.AbsolutePosition.Z, Is.EqualTo(startPos.Z));
285 284
286 for (int i = 0; i < 10; i++) 285 m_scene.Update(10);
287 m_scene.Update();
288 286
289 distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos); 287 distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos);
290 Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on second move"); 288 Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on second move");