aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2012-04-17 01:51:13 +0100
committerJustin Clark-Casey (justincc)2012-04-17 01:51:13 +0100
commit2f2181683c9b3963da5e1cfd7fa1c6491d8a2ac0 (patch)
tree20ca1ce6481f9b86596cb74f715efe6af96a34cc /OpenSim/Region/Framework
parentMove some public methods on WebStatsModule to private to reduce some static a... (diff)
downloadopensim-SC_OLD-2f2181683c9b3963da5e1cfd7fa1c6491d8a2ac0.zip
opensim-SC_OLD-2f2181683c9b3963da5e1cfd7fa1c6491d8a2ac0.tar.gz
opensim-SC_OLD-2f2181683c9b3963da5e1cfd7fa1c6491d8a2ac0.tar.bz2
opensim-SC_OLD-2f2181683c9b3963da5e1cfd7fa1c6491d8a2ac0.tar.xz
Add test TestGetChildPartPosition()
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs28
1 files changed, 28 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
index 7a3b362..fffa3bd 100644
--- a/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
+++ b/OpenSim/Region/Framework/Scenes/Tests/SceneObjectSpatialTests.cs
@@ -86,5 +86,33 @@ namespace OpenSim.Region.Framework.Scenes.Tests
86 Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition)); 86 Assert.That(so.RootPart.RelativePosition, Is.EqualTo(partPosition));
87 Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero)); 87 Assert.That(so.RootPart.OffsetPosition, Is.EqualTo(Vector3.Zero));
88 } 88 }
89
90 [Test]
91 public void TestGetChildPartPosition()
92 {
93 TestHelpers.InMethod();
94
95 Vector3 rootPartPosition = new Vector3(10, 20, 30);
96 Vector3 childOffsetPosition = new Vector3(2, 3, 4);
97
98 SceneObjectGroup so
99 = SceneHelpers.CreateSceneObject(2, m_ownerId, "obj1", 0x10);
100 so.AbsolutePosition = rootPartPosition;
101 so.Parts[1].OffsetPosition = childOffsetPosition;
102
103 m_scene.AddNewSceneObject(so, false);
104
105 // Calculate child absolute position.
106 Vector3 childPosition = new Vector3(rootPartPosition + childOffsetPosition);
107
108 SceneObjectPart childPart = so.Parts[1];
109 Assert.That(childPart.AbsolutePosition, Is.EqualTo(childPosition));
110 Assert.That(childPart.GroupPosition, Is.EqualTo(rootPartPosition));
111 Assert.That(childPart.GetWorldPosition(), Is.EqualTo(childPosition));
112 Assert.That(childPart.RelativePosition, Is.EqualTo(childOffsetPosition));
113 Assert.That(childPart.OffsetPosition, Is.EqualTo(childOffsetPosition));
114
115 // TODO: Write test for child part position after rotation.
116 }
89 } 117 }
90} \ No newline at end of file 118} \ No newline at end of file