當前位置: 首頁>>代碼示例>>C#>>正文


C# SceneObjectGroup.DelinkFromGroup方法代碼示例

本文整理匯總了C#中OpenSim.Region.Framework.Scenes.SceneObjectGroup.DelinkFromGroup方法的典型用法代碼示例。如果您正苦於以下問題:C# SceneObjectGroup.DelinkFromGroup方法的具體用法?C# SceneObjectGroup.DelinkFromGroup怎麽用?C# SceneObjectGroup.DelinkFromGroup使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Region.Framework.Scenes.SceneObjectGroup的用法示例。


在下文中一共展示了SceneObjectGroup.DelinkFromGroup方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: TestDelinkPersistence

        public void TestDelinkPersistence()
        {
            TestHelpers.InMethod();
            //log4net.Config.XmlConfigurator.Configure();
            
            TestScene scene = SceneHelpers.SetupScene();
            
            string rootPartName = "rootpart";
            UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
            string linkPartName = "linkpart";
            UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000");

            SceneObjectPart rootPart
                = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 
                    { Name = rootPartName, UUID = rootPartUuid };
            SceneObjectPart linkPart
                = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 
                    { Name = linkPartName, UUID = linkPartUuid };

            SceneObjectGroup sog = new SceneObjectGroup(rootPart);
            sog.AddPart(linkPart);
            scene.AddNewSceneObject(sog, true);            
            
            // In a test, we have to crank the backup handle manually.  Normally this would be done by the timer invoked
            // scene backup thread.
            scene.Backup(true);
                        
            // These changes should occur immediately without waiting for a backup pass
            SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
            
            Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.True);
            scene.DeleteSceneObject(groupToDelete, false);
            Assert.That(groupToDelete.HasGroupChangedDueToDelink, Is.False);
            
            List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);
            
            Assert.That(storedObjects.Count, Is.EqualTo(1));
            Assert.That(storedObjects[0].Parts.Length, Is.EqualTo(1));
            Assert.That(storedObjects[0].ContainsPart(rootPartUuid));
        }
開發者ID:4U2NV,項目名稱:opensim,代碼行數:40,代碼來源:SceneObjectLinkingTests.cs

示例2: TestDelinkPersistence

        public void TestDelinkPersistence()
        {
            TestHelpers.InMethod();
            //log4net.Config.XmlConfigurator.Configure();
            
            TestScene scene = new SceneHelpers().SetupScene();
            
            string rootPartName = "rootpart";
            UUID rootPartUuid = new UUID("00000000-0000-0000-0000-000000000001");
            string linkPartName = "linkpart";
            UUID linkPartUuid = new UUID("00000000-0000-0000-0001-000000000000");

            SceneObjectPart rootPart
                = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 
                    { Name = rootPartName, UUID = rootPartUuid };
            
            SceneObjectPart linkPart
                = new SceneObjectPart(UUID.Zero, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 
                    { Name = linkPartName, UUID = linkPartUuid };
            SceneObjectGroup linkGroup = new SceneObjectGroup(linkPart);
            scene.AddNewSceneObject(linkGroup, true);

            SceneObjectGroup sog = new SceneObjectGroup(rootPart);
            scene.AddNewSceneObject(sog, true);

            Assert.IsFalse(sog.GroupContainsForeignPrims);
            sog.LinkToGroup(linkGroup);
            Assert.IsTrue(sog.GroupContainsForeignPrims);

            scene.Backup(true);
            Assert.AreEqual(1, scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID).Count);

            // These changes should occur immediately without waiting for a backup pass
            SceneObjectGroup groupToDelete = sog.DelinkFromGroup(linkPart, false);
            Assert.IsFalse(groupToDelete.GroupContainsForeignPrims);

/* backup is async            
            scene.DeleteSceneObject(groupToDelete, false);

            List<SceneObjectGroup> storedObjects = scene.SimulationDataService.LoadObjects(scene.RegionInfo.RegionID);

            Assert.AreEqual(1, storedObjects.Count);
            Assert.AreEqual(1, storedObjects[0].Parts.Length);
            Assert.IsTrue(storedObjects[0].ContainsPart(rootPartUuid));
*/
        }
開發者ID:CassieEllen,項目名稱:opensim,代碼行數:46,代碼來源:SceneObjectLinkingTests.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectGroup.DelinkFromGroup方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。