From 30b2a8c778d02926e038bc62977c4a4c9dbec5ee Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 20 Mar 2012 23:12:21 +0000 Subject: 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. --- .../Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/OptionalModules/World/NPC/Tests/NPCModuleTests.cs') 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 // For now, we'll make the scene presence fly to simplify this test, but this needs to change. npc.Flying = true; - m_scene.Update(); + m_scene.Update(1); Assert.That(npc.AbsolutePosition, Is.EqualTo(startPos)); Vector3 targetPos = startPos + new Vector3(0, 10, 0); @@ -249,7 +249,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests Assert.That( npc.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0.7071068f, 0.7071068f), 0.000001)); - m_scene.Update(); + m_scene.Update(1); // We should really check the exact figure. Assert.That(npc.AbsolutePosition.X, Is.EqualTo(startPos.X)); @@ -257,8 +257,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests Assert.That(npc.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); Assert.That(npc.AbsolutePosition.Z, Is.LessThan(targetPos.X)); - for (int i = 0; i < 10; i++) - m_scene.Update(); + m_scene.Update(10); double distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos); 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 Assert.That( npc.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0, 1), 0.000001)); - m_scene.Update(); + m_scene.Update(1); // We should really check the exact figure. Assert.That(npc.AbsolutePosition.X, Is.GreaterThan(startPos.X)); @@ -283,8 +282,7 @@ namespace OpenSim.Region.OptionalModules.World.NPC.Tests Assert.That(npc.AbsolutePosition.Y, Is.EqualTo(startPos.Y)); Assert.That(npc.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); - for (int i = 0; i < 10; i++) - m_scene.Update(); + m_scene.Update(10); distanceToTarget = Util.GetDistanceTo(npc.AbsolutePosition, targetPos); Assert.That(distanceToTarget, Is.LessThan(1), "NPC not within 1 unit of target position on second move"); -- cgit v1.1