diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Tests')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | 42 |
1 files changed, 30 insertions, 12 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 8a103d7..c9662ef 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | |||
@@ -48,24 +48,42 @@ namespace OpenSim.Region.Framework.Scenes.Tests | |||
48 | TestHelper.InMethod(); | 48 | TestHelper.InMethod(); |
49 | Scene scene = SceneSetupHelpers.SetupScene(); | 49 | Scene scene = SceneSetupHelpers.SetupScene(); |
50 | 50 | ||
51 | UUID ownerUuid = new UUID("00000000-0000-0000-0000-000000000010"); | 51 | UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010"); |
52 | string objName = "obj1"; | 52 | string part1Name = "part1"; |
53 | UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); | 53 | UUID part1Id = new UUID("00000000-0000-0000-0000-000000000001"); |
54 | string part2Name = "part2"; | ||
55 | UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002"); | ||
54 | 56 | ||
55 | SceneObjectPart part | 57 | SceneObjectPart part1 |
56 | = new SceneObjectPart(ownerUuid, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | 58 | = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) |
57 | { Name = objName, UUID = objUuid }; | 59 | { Name = part1Name, UUID = part1Id }; |
60 | SceneObjectGroup so = new SceneObjectGroup(part1); | ||
61 | SceneObjectPart part2 | ||
62 | = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) | ||
63 | { Name = part2Name, UUID = part2Id }; | ||
64 | so.AddPart(part2); | ||
58 | 65 | ||
59 | scene.AddNewSceneObject(new SceneObjectGroup(part), false); | 66 | scene.AddNewSceneObject(so, false); |
60 | 67 | ||
61 | SceneObjectGroup duplicatedSo | 68 | SceneObjectGroup dupeSo |
62 | = scene.SceneGraph.DuplicateObject( | 69 | = scene.SceneGraph.DuplicateObject( |
63 | part.LocalId, new Vector3(10, 0, 0), 0, ownerUuid, UUID.Zero, Quaternion.Identity); | 70 | part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); |
71 | Assert.That(dupeSo.Children.Count, Is.EqualTo(2)); | ||
64 | 72 | ||
65 | Assert.That(duplicatedSo.Children.Count, Is.EqualTo(1)); | 73 | SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1); |
66 | Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part.LocalId)); | 74 | SceneObjectPart dupePart2 = dupeSo.GetLinkNumPart(2); |
75 | Assert.That(dupePart1.LocalId, Is.Not.EqualTo(part1.LocalId)); | ||
76 | Assert.That(dupePart2.LocalId, Is.Not.EqualTo(part2.LocalId)); | ||
67 | 77 | ||
68 | //SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); | 78 | Assert.That(dupePart1.Flags, Is.EqualTo(part1.Flags)); |
79 | Assert.That(dupePart2.Flags, Is.EqualTo(part2.Flags)); | ||
80 | |||
81 | /* | ||
82 | Assert.That(part1.PhysActor, Is.Not.Null); | ||
83 | Assert.That(part2.PhysActor, Is.Not.Null); | ||
84 | Assert.That(dupePart1.PhysActor, Is.Not.Null); | ||
85 | Assert.That(dupePart2.PhysActor, Is.Not.Null); | ||
86 | */ | ||
69 | } | 87 | } |
70 | } | 88 | } |
71 | } \ No newline at end of file | 89 | } \ No newline at end of file |