From 85fc2dfe3c9c8fc1881833385d13e1c6aae13fe9 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 10 Aug 2010 16:16:57 +0100 Subject: extend TestDuplicateObject() to a two prim object --- .../Framework/Scenes/Tests/SceneGraphTests.cs | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index 8a103d7..bb6e540 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -48,22 +48,31 @@ namespace OpenSim.Region.Framework.Scenes.Tests TestHelper.InMethod(); Scene scene = SceneSetupHelpers.SetupScene(); - UUID ownerUuid = new UUID("00000000-0000-0000-0000-000000000010"); - string objName = "obj1"; - UUID objUuid = new UUID("00000000-0000-0000-0000-000000000001"); + UUID ownerId = new UUID("00000000-0000-0000-0000-000000000010"); + string part1Name = "part1"; + UUID part1Id = new UUID("00000000-0000-0000-0000-000000000001"); + string part2Name = "part2"; + UUID part2Id = new UUID("00000000-0000-0000-0000-000000000002"); - SceneObjectPart part - = new SceneObjectPart(ownerUuid, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) - { Name = objName, UUID = objUuid }; + SceneObjectPart part1 + = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = part1Name, UUID = part1Id }; + SceneObjectGroup so = new SceneObjectGroup(part1); + SceneObjectPart part2 + = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) + { Name = part2Name, UUID = part2Id }; + so.AddPart(part2); - scene.AddNewSceneObject(new SceneObjectGroup(part), false); + scene.AddNewSceneObject(so, false); + + uint part1LocalId = part1.LocalId; SceneObjectGroup duplicatedSo = scene.SceneGraph.DuplicateObject( - part.LocalId, new Vector3(10, 0, 0), 0, ownerUuid, UUID.Zero, Quaternion.Identity); + part1LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); - Assert.That(duplicatedSo.Children.Count, Is.EqualTo(1)); - Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part.LocalId)); + Assert.That(duplicatedSo.Children.Count, Is.EqualTo(2)); + Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part1.LocalId)); //SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); } -- cgit v1.1 From 7203feb83c3fd4ca7af7ec717ca919fc419bcffd Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 10 Aug 2010 16:50:36 +0100 Subject: Extend DuplicateObject() test to check flags on the duplicated object --- OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index bb6e540..d7da9cb 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -65,16 +65,18 @@ namespace OpenSim.Region.Framework.Scenes.Tests scene.AddNewSceneObject(so, false); - uint part1LocalId = part1.LocalId; - - SceneObjectGroup duplicatedSo + SceneObjectGroup dupeSo = scene.SceneGraph.DuplicateObject( - part1LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); + part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity); + Assert.That(dupeSo.Children.Count, Is.EqualTo(2)); - Assert.That(duplicatedSo.Children.Count, Is.EqualTo(2)); - Assert.That(duplicatedSo.RootPart.LocalId, Is.Not.EqualTo(part1.LocalId)); + SceneObjectPart dupePart1 = dupeSo.GetLinkNumPart(1); + SceneObjectPart dupePart2 = dupeSo.GetLinkNumPart(2); + Assert.That(dupePart1.LocalId, Is.Not.EqualTo(part1.LocalId)); + Assert.That(dupePart2.LocalId, Is.Not.EqualTo(part2.LocalId)); - //SceneObjectPart retrievedPart = scene.GetSceneObjectPart(objUuid); + Assert.That(dupePart1.Flags, Is.EqualTo(part1.Flags)); + Assert.That(dupePart2.Flags, Is.EqualTo(part2.Flags)); } } } \ No newline at end of file -- cgit v1.1 From 2a1c11fda9b4ab948b7821ef2423270793a5e577 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Tue, 10 Aug 2010 20:15:44 +0100 Subject: On shift-copy of an object, set up a new physics actor (as appropriate) for every copied prim, not just the root This addresses http://opensimulator.org/mantis/view.php?id=4295 --- OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs') diff --git a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs index d7da9cb..c9662ef 100644 --- a/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs +++ b/OpenSim/Region/Framework/Scenes/Tests/SceneGraphTests.cs @@ -77,6 +77,13 @@ namespace OpenSim.Region.Framework.Scenes.Tests Assert.That(dupePart1.Flags, Is.EqualTo(part1.Flags)); Assert.That(dupePart2.Flags, Is.EqualTo(part2.Flags)); + + /* + Assert.That(part1.PhysActor, Is.Not.Null); + Assert.That(part2.PhysActor, Is.Not.Null); + Assert.That(dupePart1.PhysActor, Is.Not.Null); + Assert.That(dupePart2.PhysActor, Is.Not.Null); + */ } } } \ No newline at end of file -- cgit v1.1