aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs35
1 files changed, 30 insertions, 5 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
index 10c78b5..7a3b362 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
@@ -44,22 +44,47 @@ namespace OpenSim.Region.Framework.Scenes.Tests
44 [TestFixture] 44 [TestFixture]
45 public class SceneObjectSpatialTests 45 public class SceneObjectSpatialTests
46 { 46 {
47 TestScene m_scene;
48 UUID m_ownerId = TestHelpers.ParseTail(0x1);
49
50 [SetUp]
51 public void SetUp()
52 {
53 m_scene = SceneHelpers.SetupScene();
54 }
55
56 [Test]
57 public void TestGetSceneObjectGroupPosition()
58 {
59 TestHelpers.InMethod();
60
61 Vector3 position = new Vector3(10, 20, 30);
62
63 SceneObjectGroup so
64 = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10);
65 so.AbsolutePosition = position;
66 m_scene.AddNewSceneObject(so, false);
67
68 Assert.That(so.AbsolutePosition, Is.EqualTo(position));
69 }
70
47 [Test] 71 [Test]
48 public void TestGetRootPartPosition() 72 public void TestGetRootPartPosition()
49 { 73 {
50 TestHelpers.InMethod(); 74 TestHelpers.InMethod();
51 75
52 Scene scene = SceneHelpers.SetupScene();
53 UUID ownerId = TestHelpers.ParseTail(0x1);
54 Vector3 partPosition = new Vector3(10, 20, 30); 76 Vector3 partPosition = new Vector3(10, 20, 30);
55 77
56 SceneObjectGroup so 78 SceneObjectGroup so
57 = SceneHelpers.CreateSceneObject(1, ownerId, "obj1", 0x10); 79 = SceneHelpers.CreateSceneObject(1, m_ownerId, "obj1", 0x10);
58 so.AbsolutePosition = partPosition; 80 so.AbsolutePosition = partPosition;
59 scene.AddNewSceneObject(so, false); 81 m_scene.AddNewSceneObject(so, false);
60 82
61 Assert.That(so.AbsolutePosition, Is.EqualTo(partPosition));
62 Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition)); 83 Assert.That(so.RootPart.AbsolutePosition, Is.EqualTo(partPosition));
84 Assert.That(so.RootPart.GroupPosition, Is.EqualTo(partPosition));
85 Assert.That(so.RootPart.GetWorldPosition(), Is.EqualTo(partPosition));
86 Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition));
87 Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero));
63 } 88 }
64 } 89 }
65} \ No newline at end of file 90} \ No newline at end of file