29 using System.Collections.Generic;
30 using System.Reflection;
33 using NUnit.Framework;
35 using OpenSim.Framework;
36 using OpenSim.Region.Framework.Interfaces;
37 using OpenSim.Region.Framework.Scenes;
38 using OpenSim.Tests.Common;
40 namespace OpenSim.
Region.Framework.Scenes.Tests
51 Util.FireAndForgetMethod = FireAndForgetMethod.None;
59 Util.FireAndForgetMethod = Util.DefaultFireAndForgetMethod;
71 TestHelpers.InMethod();
74 ScenePresence sp = SceneHelpers.AddScenePresence(m_scene, TestHelpers.ParseTail(0x1));
76 Vector3 startPos = sp.AbsolutePosition;
83 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
85 Vector3 targetPos = startPos +
new Vector3(0, 10, 0);
86 sp.MoveToTarget(targetPos,
false,
false);
88 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
95 Assert.That(sp.AbsolutePosition.X, Is.EqualTo(startPos.X));
96 Assert.That(sp.AbsolutePosition.Y, Is.GreaterThan(startPos.Y));
97 Assert.That(sp.AbsolutePosition.Z, Is.EqualTo(startPos.Z));
98 Assert.That(sp.AbsolutePosition.Z, Is.LessThan(targetPos.X));
102 double distanceToTarget = Util.GetDistanceTo(sp.AbsolutePosition, targetPos);
103 Assert.That(distanceToTarget, Is.LessThan(1),
"Avatar not within 1 unit of target position on first move");
104 Assert.That(sp.AbsolutePosition, Is.EqualTo(targetPos));
105 Assert.That(sp.AgentControlFlags, Is.EqualTo((uint)AgentManager.ControlFlags.NONE));
108 startPos = sp.AbsolutePosition;
109 targetPos = startPos +
new Vector3(10, 0, 0);
110 sp.MoveToTarget(targetPos,
false,
false);
112 Assert.That(sp.AbsolutePosition, Is.EqualTo(startPos));
119 Assert.That(sp.AbsolutePosition.X, Is.GreaterThan(startPos.X));
120 Assert.That(sp.AbsolutePosition.X, Is.LessThan(targetPos.X));
121 Assert.That(sp.AbsolutePosition.Y, Is.EqualTo(startPos.Y));
122 Assert.That(sp.AbsolutePosition.Z, Is.EqualTo(startPos.Z));
126 distanceToTarget = Util.GetDistanceTo(sp.AbsolutePosition, targetPos);
127 Assert.That(distanceToTarget, Is.LessThan(1),
"Avatar not within 1 unit of target position on second move");
128 Assert.That(sp.AbsolutePosition, Is.EqualTo(targetPos));
Helpers for setting up scenes.