diff options
author | Justin Clark-Casey (justincc) | 2012-03-20 23:12:21 +0000 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2012-03-20 23:12:21 +0000 |
commit | 30b2a8c778d02926e038bc62977c4a4c9dbec5ee (patch) | |
tree | 0b35af969e4ac337cf4521d07b1f25765a5b3273 /OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs | |
parent | reduce avatar verticle jump from the absurd 5 meter jump to a less (diff) | |
download | opensim-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/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs index 442cb8b..cfea10d 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/ScenePresenceAutopilotTests.cs | |||
@@ -81,7 +81,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
81 | // For now, we'll make the scene presence fly to simplify this test, but this needs to change. | 81 | // For now, we'll make the scene presence fly to simplify this test, but this needs to change. |
82 | sp.Flying = true; | 82 | sp.Flying = true; |
83 | 83 | ||
84 | m_scene.Update(); | 84 | m_scene.Update(1); |
85 | Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos)); | 85 | Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos)); |
86 | 86 | ||
87 | Vector3 targetPos = startPos + new Vector3(0, 10, 0); | 87 | Vector3 targetPos = startPos + new Vector3(0, 10, 0); |
@@ -91,7 +91,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
91 | Assert.That( | 91 | Assert.That( |
92 | sp.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0.7071068f, 0.7071068f), 0.000001)); | 92 | sp.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0.7071068f, 0.7071068f), 0.000001)); |
93 | 93 | ||
94 | m_scene.Update(); | 94 | m_scene.Update(1); |
95 | 95 | ||
96 | // We should really check the exact figure. | 96 | // We should really check the exact figure. |
97 | Assert.That(sp.AbsolutePosition.X, Is.EqualTo(startPos.X)); | 97 | Assert.That(sp.AbsolutePosition.X, Is.EqualTo(startPos.X)); |
@@ -99,8 +99,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
99 | Assert.That(sp.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); | 99 | Assert.That(sp.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); |
100 | Assert.That(sp.AbsolutePosition.Z, Is.LessThan(targetPos.X)); | 100 | Assert.That(sp.AbsolutePosition.Z, Is.LessThan(targetPos.X)); |
101 | 101 | ||
102 | for (int i = 0; i < 10; i++) | 102 | m_scene.Update(10); |
103 | m_scene.Update(); | ||
104 | 103 | ||
105 | double distanceToTarget = Util.GetDistanceTo(sp.AbsolutePosition, targetPos); | 104 | double distanceToTarget = Util.GetDistanceTo(sp.AbsolutePosition, targetPos); |
106 | Assert.That(distanceToTarget, Is.LessThan(1), "Avatar not within 1 unit of target position on first move"); | 105 | Assert.That(distanceToTarget, Is.LessThan(1), "Avatar not within 1 unit of target position on first move"); |
@@ -116,7 +115,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
116 | Assert.That( | 115 | Assert.That( |
117 | sp.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0, 1), 0.000001)); | 116 | sp.Rotation, new QuaternionToleranceConstraint(new Quaternion(0, 0, 0, 1), 0.000001)); |
118 | 117 | ||
119 | m_scene.Update(); | 118 | m_scene.Update(1); |
120 | 119 | ||
121 | // We should really check the exact figure. | 120 | // We should really check the exact figure. |
122 | Assert.That(sp.AbsolutePosition.X, Is.GreaterThan(startPos.X)); | 121 | Assert.That(sp.AbsolutePosition.X, Is.GreaterThan(startPos.X)); |
@@ -124,8 +123,7 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
124 | Assert.That(sp.AbsolutePosition.Y, Is.EqualTo(startPos.Y)); | 123 | Assert.That(sp.AbsolutePosition.Y, Is.EqualTo(startPos.Y)); |
125 | Assert.That(sp.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); | 124 | Assert.That(sp.AbsolutePosition.Z, Is.EqualTo(startPos.Z)); |
126 | 125 | ||
127 | for (int i = 0; i < 10; i++) | 126 | m_scene.Update(10); |
128 | m_scene.Update(); | ||
129 | 127 | ||
130 | distanceToTarget = Util.GetDistanceTo(sp.AbsolutePosition, targetPos); | 128 | distanceToTarget = Util.GetDistanceTo(sp.AbsolutePosition, targetPos); |
131 | Assert.That(distanceToTarget, Is.LessThan(1), "Avatar not within 1 unit of target position on second move"); | 129 | Assert.That(distanceToTarget, Is.LessThan(1), "Avatar not within 1 unit of target position on second move"); |