当前位置: 首页>>代码示例>>C#>>正文


C# SceneObjectGroup.AddPart方法代码示例

本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectGroup.AddPart方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectGroup.AddPart方法的具体用法?C# SceneObjectGroup.AddPart怎么用?C# SceneObjectGroup.AddPart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在OpenSim.Region.Framework.Scenes.SceneObjectGroup的用法示例。


在下文中一共展示了SceneObjectGroup.AddPart方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: TestPartSerialzationDeserialization

        public void TestPartSerialzationDeserialization()
        {
            SceneObjectPart rootPart = new SceneObjectPart(UUID.Zero, new OpenSim.Framework.PrimitiveBaseShape(), new Vector3(1, 2, 3), Quaternion.Identity, Vector3.Zero, false);
            rootPart.Name = "RootPart";
            SceneObjectPart part = Util.RandomSOP("ChildPart", 2);

            var pgrp1 = new SceneObjectGroup(rootPart);
            pgrp1.AddPart(part);

            part.InventorySerial = 1;
            part.Rezzed = DateTime.Now;
            part.TextColor = System.Drawing.Color.FromArgb(1,2,3,4);
            
            byte[] bytes = serEngine.SceneObjectSerializer.SerializePartToBytes(part, OpenSim.Region.Framework.Scenes.Serialization.SerializationFlags.None);

            SceneObjectPart rootPart2 = new SceneObjectPart(UUID.Zero, new OpenSim.Framework.PrimitiveBaseShape(), new Vector3(1, 2, 3), Quaternion.Identity, Vector3.Zero, false);
            rootPart2.Name = "RootPart2";
            SceneObjectPart deserPart = serEngine.SceneObjectSerializer.DeserializePartFromBytes(bytes);
            var pgrp2 = new SceneObjectGroup(rootPart2);
            pgrp2.AddPart(deserPart);
            deserPart.Rezzed = part.Rezzed;

            CompareObjects comp = new CompareObjects();
            comp.CompareStaticFields = false;
            comp.CompareStaticProperties = false;
            comp.ElementsToIgnore = PrimCompareIgnoreList;

            Assert.IsTrue(comp.Compare(part, deserPart), comp.DifferencesString);
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:29,代码来源:SerializerTests.cs

示例2: TestGroupSerializationDeserialization

        public void TestGroupSerializationDeserialization()
        {
            var sop1 = SceneUtil.RandomSOP("Root", 1);
            var sop2 = SceneUtil.RandomSOP("Child1", 2);
            var sop3 = SceneUtil.RandomSOP("Child2", 3);

            SceneObjectGroup group = new SceneObjectGroup(sop1);
            group.AddPart(sop2);
            group.AddPart(sop3);

            SceneObjectGroup deserGroup = null;
            string grpBytes = null;

            Assert.DoesNotThrow(() =>
            {
                grpBytes = SceneObjectSerializer.ToXml2Format(group, true);
            });

            Assert.NotNull(grpBytes);

            Assert.DoesNotThrow(() =>
            {
                deserGroup = SceneObjectSerializer.FromXml2Format(grpBytes);
            });

            CompareObjects comp = new CompareObjects();
            comp.CompareStaticFields = false;
            comp.CompareStaticProperties = false;
            comp.ElementsToIgnore = PrimCompareIgnoreList;

            Assert.IsTrue(comp.Compare(group, deserGroup), comp.DifferencesString);
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:32,代码来源:Serialization.cs

示例3: TestGroupInventorySerializationDeserialization

        public void TestGroupInventorySerializationDeserialization()
        {
            var sop1 = Util.RandomSOP("Root", 1);
            var sop2 = Util.RandomSOP("Child1", 2);
            var sop3 = Util.RandomSOP("Child2", 3);

            SceneObjectGroup group = new SceneObjectGroup(sop1);
            group.AddPart(sop2);
            group.AddPart(sop3);

            var grpBytes = serEngine.InventoryObjectSerializer.SerializeGroupToInventoryBytes(group, SerializationFlags.None);

            SceneObjectGroup deserGroup = serEngine.InventoryObjectSerializer.DeserializeGroupFromInventoryBytes(grpBytes);

            CompareObjects comp = new CompareObjects();
            comp.CompareStaticFields = false;
            comp.CompareStaticProperties = false;
            comp.ElementsToIgnore = PrimCompareIgnoreList;

            Assert.IsTrue(comp.Compare(group, deserGroup), comp.DifferencesString);
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:21,代码来源:InvSerializerTests.cs

示例4: TestDuplicateObject

        public void TestDuplicateObject()
        {
            TestHelpers.InMethod();
//            TestHelpers.EnableLogging();

            Scene scene = new SceneHelpers().SetupScene();

            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 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(so, false);
            
            SceneObjectGroup dupeSo 
                = scene.SceneGraph.DuplicateObject(
                    part1.LocalId, new Vector3(10, 0, 0), 0, ownerId, UUID.Zero, Quaternion.Identity);
            Assert.That(dupeSo.Parts.Length, Is.EqualTo(2));
            
            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));
            
            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);
            */

//            TestHelpers.DisableLogging();
        }
开发者ID:JAllard,项目名称:opensim,代码行数:46,代码来源:SceneGraphTests.cs

示例5: FromXml2Format

        public static SceneObjectGroup FromXml2Format(string xmlData)
        {
            //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
            //int time = System.Environment.TickCount;
            
            // libomv.types changes UUID to Guid
            xmlData = xmlData.Replace("<UUID>", "<Guid>");
            xmlData = xmlData.Replace("</UUID>", "</Guid>");

            // Handle Nested <UUID><UUID> property
            xmlData = xmlData.Replace("<Guid><Guid>", "<UUID><Guid>");
            xmlData = xmlData.Replace("</Guid></Guid>", "</Guid></UUID>");

            try
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xmlData);

                XmlNodeList parts = doc.GetElementsByTagName("SceneObjectPart");

                if (parts.Count == 0)
                {
                    m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed: No SceneObjectPart nodes. xml was " + xmlData);
                    return null;
                }

                StringReader sr = new StringReader(parts[0].OuterXml);
                XmlTextReader reader = new XmlTextReader(sr);
                SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
                reader.Close();
                sr.Close();

                // Then deal with the rest
                for (int i = 1; i < parts.Count; i++)
                {
                    sr = new StringReader(parts[i].OuterXml);
                    reader = new XmlTextReader(sr);
                    SceneObjectPart part = SceneObjectPart.FromXml(reader);
                    sceneObject.AddPart(part);
                    part.StoreUndoState();
                    reader.Close();
                    sr.Close();
                }

                // Script state may, or may not, exist. Not having any, is NOT
                // ever a problem.

                sceneObject.LoadScriptState(doc);
                return sceneObject;
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed with {0}.  xml was {1}", e, xmlData);
                return null;
            }
        }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:56,代码来源:SceneObjectSerializer.cs

示例6: tsuccirRezLinkset

        public UUID tsuccirRezLinkset(UUID host, UUID script, int numberOfChildPrims)
        {
            numberOfChildPrims = Math.Max(0, numberOfChildPrims);

            SceneObjectPart part = m_scene.GetSceneObjectPart(host);

            if (part == null || !m_scene.Permissions.CanRezObject(1 + numberOfChildPrims, part.OwnerID, Vector3.Zero))
                return UUID.Zero;

            SceneObjectGroup newGroup = new SceneObjectGroup(part.OwnerID, part.AbsolutePosition, Quaternion.Identity, PrimitiveBaseShape.Default);
            for (int i = 0; i < numberOfChildPrims; ++i)
            {
                newGroup.AddPart(new SceneObjectPart(part.OwnerID, PrimitiveBaseShape.Default, part.AbsolutePosition, Quaternion.Identity, Vector3.Zero));
            }

            if (!m_scene.SceneGraph.AddNewSceneObject(newGroup, true, part.AbsolutePosition, Quaternion.Identity, Vector3.Zero))
            {
                ScriptError(part, "Failed to add linkset to scene graph.");
                return UUID.Zero;
            }
            else
            {
                newGroup.FromPartID = host;
                newGroup.ScheduleGroupForFullUpdate();
                IScriptModule[] modules = m_scene.RequestModuleInterfaces<IScriptModule>();
                foreach (IScriptModule module in modules)
                {
                    module.PostObjectEvent(host, "object_rez", new object[] { new LSL_String(newGroup.UUID.ToString()) });
                }
                return newGroup.UUID;
            }
        }
开发者ID:CCIR,项目名称:TSU.CCIR.OpenSim.LSL,代码行数:32,代码来源:TSU.CCIR.OpenSim.LSL.cs

示例7: FromXml2Format

        public static SceneObjectGroup FromXml2Format(string xmlData)
        {
            //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
            //int time = System.Environment.TickCount;
            
            try
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xmlData);

                XmlNodeList parts = doc.GetElementsByTagName("SceneObjectPart");

                if (parts.Count == 0)
                {
                    m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed: No SceneObjectPart nodes. xml was " + xmlData);
                    return null;
                }

                StringReader sr = new StringReader(parts[0].OuterXml);
                XmlTextReader reader = new XmlTextReader(sr);
                SceneObjectGroup sceneObject = new SceneObjectGroup(SceneObjectPart.FromXml(reader));
                reader.Close();
                sr.Close();

                // Then deal with the rest
                for (int i = 1; i < parts.Count; i++)
                {
                    sr = new StringReader(parts[i].OuterXml);
                    reader = new XmlTextReader(sr);
                    SceneObjectPart part = SceneObjectPart.FromXml(reader);

                    int originalLinkNum = part.LinkNum;

                    sceneObject.AddPart(part);

                    // SceneObjectGroup.AddPart() tries to be smart and automatically set the LinkNum.
                    // We override that here
                    if (originalLinkNum != 0)
                        part.LinkNum = originalLinkNum;

                    reader.Close();
                    sr.Close();
                }

                // Script state may, or may not, exist. Not having any, is NOT
                // ever a problem.
                sceneObject.LoadScriptState(doc);
                
                return sceneObject;
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed with {0}.  xml was {1}", e, xmlData);
                return null;
            }
        }
开发者ID:JAllard,项目名称:opensim,代码行数:56,代码来源:SceneObjectSerializer.cs

示例8: Xml2ToSOG

        //////// Read /////////
        public static bool Xml2ToSOG(XmlTextReader reader, SceneObjectGroup sog)
        {
            reader.Read();
            reader.ReadStartElement("SceneObjectGroup");
            SceneObjectPart root = Xml2ToSOP(reader);
            if (root != null)
                sog.SetRootPart(root);
            else
            {
                return false;
            }

            if (sog.UUID == UUID.Zero)
                sog.UUID = sog.RootPart.UUID;

            reader.Read(); // OtherParts

            while (!reader.EOF)
            {
                switch (reader.NodeType)
                {
                    case XmlNodeType.Element:
                        if (reader.Name == "SceneObjectPart")
                        {
                            SceneObjectPart child = Xml2ToSOP(reader);
                            if (child != null)
                                sog.AddPart(child);
                        }
                        else
                        {
                            //Logger.Log("Found unexpected prim XML element " + reader.Name, Helpers.LogLevel.Debug);
                            reader.Read();
                        }
                        break;
                    case XmlNodeType.EndElement:
                    default:
                        reader.Read();
                        break;
                }

            }
            return true;
        }
开发者ID:pluraldj,项目名称:opensim,代码行数:44,代码来源:SceneObjectSerializer.cs

示例9: FromOriginalXmlFormat

        /// <summary>
        /// Deserialize a scene object from the original xml format
        /// </summary>
        /// <param name="serialization"></param>
        /// <returns></returns>
        public static SceneObjectGroup FromOriginalXmlFormat(UUID fromUserInventoryItemID, string xmlData)
        {
            //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
            //int time = System.Environment.TickCount;

            SceneObjectGroup sceneObject = new SceneObjectGroup();            

            // libomv.types changes UUID to Guid
            xmlData = xmlData.Replace("<UUID>", "<Guid>");
            xmlData = xmlData.Replace("</UUID>", "</Guid>");

            // Handle Nested <UUID><UUID> property
            xmlData = xmlData.Replace("<Guid><Guid>", "<UUID><Guid>");
            xmlData = xmlData.Replace("</Guid></Guid>", "</Guid></UUID>");

            try
            {
                StringReader  sr;
                XmlTextReader reader;
                XmlNodeList   parts;
                XmlDocument   doc;
                int           linkNum;

                doc = new XmlDocument();
                doc.LoadXml(xmlData);
                parts = doc.GetElementsByTagName("RootPart");

                if (parts.Count == 0)
                {
                    throw new Exception("Invalid Xml format - no root part");
                }
                else
                {
                    sr = new StringReader(parts[0].InnerXml);
                    reader = new XmlTextReader(sr);
                    sceneObject.SetRootPart(SceneObjectPart.FromXml(fromUserInventoryItemID, reader));
                    reader.Close();
                    sr.Close();
                }

                parts = doc.GetElementsByTagName("Part");

                for (int i = 0; i < parts.Count; i++)
                {
                    sr = new StringReader(parts[i].InnerXml);
                    reader = new XmlTextReader(sr);
                    SceneObjectPart part = SceneObjectPart.FromXml(reader);
                    linkNum = part.LinkNum;
                    sceneObject.AddPart(part);
                    part.LinkNum = linkNum;
                    part.TrimPermissions();
                    part.StoreUndoState();
                    reader.Close();
                    sr.Close();
                }

                // Script state may, or may not, exist. Not having any, is NOT
                // ever a problem.
                sceneObject.LoadScriptState(doc);
            }
            catch (Exception e)
            {
                m_log.ErrorFormat(
                    "[SERIALIZER]: Deserialization of xml failed with {0}.  xml was {1}", e, xmlData);
            }

            //m_log.DebugFormat("[SERIALIZER]: Finished deserialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);

            return sceneObject;
        }      
开发者ID:ChrisD,项目名称:opensim,代码行数:75,代码来源:SceneObjectSerializer.cs

示例10: FromXml2Format

        public static SceneObjectGroup FromXml2Format(string xmlData)
        {
            //m_log.DebugFormat("[SOG]: Starting deserialization of SOG");
            //int time = System.Environment.TickCount;

            SceneObjectGroup sceneObject = new SceneObjectGroup();
            
            // libomv.types changes UUID to Guid
            xmlData = xmlData.Replace("<UUID>", "<Guid>");
            xmlData = xmlData.Replace("</UUID>", "</Guid>");

            // Handle Nested <UUID><UUID> property
            xmlData = xmlData.Replace("<Guid><Guid>", "<UUID><Guid>");
            xmlData = xmlData.Replace("</Guid></Guid>", "</Guid></UUID>");

            try
            {
                XmlDocument doc = new XmlDocument();
                doc.LoadXml(xmlData);

                XmlNodeList parts = doc.GetElementsByTagName("SceneObjectPart");

                // Process the root part first
                if (parts.Count > 0)
                {
                    StringReader      sr = new StringReader(parts[0].OuterXml);
                    XmlTextReader reader = new XmlTextReader(sr);
                    sceneObject.SetRootPart(SceneObjectPart.FromXml(reader));
                    reader.Close();
                    sr.Close();
                }

                // Then deal with the rest
                for (int i = 1; i < parts.Count; i++)
                {
                    StringReader      sr = new StringReader(parts[i].OuterXml);
                    XmlTextReader reader = new XmlTextReader(sr);
                    SceneObjectPart part = SceneObjectPart.FromXml(reader);

                    int originalLinkNum = part.LinkNum;
                    sceneObject.AddPart(part);
                    // SceneObjectGroup.AddPart() tries to be smart and automatically set the LinkNum.
                    // We override that here
                    if (originalLinkNum != 0)
                        part.LinkNum = originalLinkNum;

                    part.StoreUndoState();
                    reader.Close();
                    sr.Close();
                }

                // Script state may, or may not, exist. Not having any, is NOT
                // ever a problem.

                sceneObject.LoadScriptState(doc);
                //m_log.DebugFormat("[SERIALIZER]: Finished deserialization of SOG {0}, {1}ms", Name, System.Environment.TickCount - time);
                return sceneObject;
            }
            catch (Exception e)
            {
                m_log.ErrorFormat("[SERIALIZER]: Deserialization of xml failed with {0}.  xml was {1}", e, xmlData);
            }
            return null;
        }         
开发者ID:kf6kjg,项目名称:halcyon,代码行数:64,代码来源:SceneObjectSerializer.cs

示例11: TestRenderMaterialsSerialization

        public void TestRenderMaterialsSerialization()
        {
            var sop1 = SceneUtil.RandomSOP("Root", 1);
            var sop2 = SceneUtil.RandomSOP("Child1", 2);
            var sop3 = SceneUtil.RandomSOP("Child2", 3);

            var mat1 = new RenderMaterial(UUID.Random(), UUID.Random());
            var mat2 = new RenderMaterial(UUID.Random(), UUID.Random());

            sop1.Shape.RenderMaterials.AddMaterial(mat1);
            sop2.Shape.RenderMaterials.AddMaterial(mat2);

            SceneObjectGroup group = new SceneObjectGroup(sop1);
            group.AddPart(sop2);
            group.AddPart(sop3);

            SceneObjectGroup deserGroup = null;
            string grpBytes = null;

            Assert.DoesNotThrow(() =>
            {
                grpBytes = SceneObjectSerializer.ToXml2Format(group, true);
            });

            Assert.NotNull(grpBytes);

            Assert.DoesNotThrow(() =>
            {
                deserGroup = SceneObjectSerializer.FromXml2Format(grpBytes);
            });

            var newsop1 = deserGroup.GetChildPart(1);
            var newsop2 = deserGroup.GetChildPart(2);
            var newsop3 = deserGroup.GetChildPart(3);

            Assert.That(sop1.Shape.RenderMaterials, Is.EqualTo(newsop1.Shape.RenderMaterials));
            Assert.That(sop2.Shape.RenderMaterials, Is.EqualTo(newsop2.Shape.RenderMaterials));
            Assert.That(sop3.Shape.RenderMaterials, Is.EqualTo(newsop3.Shape.RenderMaterials));
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:39,代码来源:Serialization.cs

示例12: TestNullMediaEntryIsNotAnError

        public void TestNullMediaEntryIsNotAnError()
        {
            var sop1 = SceneUtil.RandomSOP("Root", 1);
            var sop2 = SceneUtil.RandomSOP("Child1", 2);
            var sop3 = SceneUtil.RandomSOP("Child2", 3);

            sop1.Shape.Media = new PrimitiveBaseShape.PrimMedia(3);
            sop1.Shape.Media[0] = null;
            sop1.Shape.Media[1] = new MediaEntry();
            sop1.Shape.Media[2] = null;

            SceneObjectGroup group = new SceneObjectGroup(sop1);
            group.AddPart(sop2);
            group.AddPart(sop3);

            SceneObjectGroup deserGroup = null;
            string grpBytes = null;

            Assert.DoesNotThrow(() =>
            {
                grpBytes = SceneObjectSerializer.ToXml2Format(group, true);
            });

            Assert.NotNull(grpBytes);

            Assert.DoesNotThrow(() =>
            {
                deserGroup = SceneObjectSerializer.FromXml2Format(grpBytes);
            });
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:30,代码来源:Serialization.cs

示例13: LoadObject

        private SceneObjectGroup LoadObject(UUID uuid, UUID region)
        {
            SceneObjectGroup group = new SceneObjectGroup();

            ICriteria criteria = manager.GetSession().CreateCriteria(typeof(SceneObjectPart));
            criteria.Add(Expression.Eq("RegionID", region));
            criteria.Add(Expression.Eq("ParentUUID", uuid));
            criteria.AddOrder(Order.Asc("ParentID"));

            foreach (SceneObjectPart p in criteria.List())
            {
                // root part
                if (p.UUID == uuid)
                {
                    group.SetRootPart(p);
                }
                else
                {
                    group.AddPart(p);
                }
            }

            return group;
        }
开发者ID:ChrisD,项目名称:opensim,代码行数:24,代码来源:NHibernateRegionData.cs

示例14: ToSceneObjectGroup

        internal SceneObjectGroup ToSceneObjectGroup()
        {
            SceneObjectGroup sog = new SceneObjectGroup();

            SceneObjectPart rootPart = RootPart.ToSceneObjectPart();

            sog.SetRootPart(rootPart);

            if (ChildParts != null)
            {
                foreach (var partSnap in ChildParts)
                {
                    SceneObjectPart childPart = partSnap.ToSceneObjectPart();

                    int originalLinkNum = childPart.LinkNum;
                    sog.AddPart(childPart);

                    // SceneObjectGroup.AddPart() tries to be smart and automatically set the LinkNum.
                    // We override that here
                    if (originalLinkNum != 0)
                        childPart.LinkNum = originalLinkNum;

                    childPart.StoreUndoState();
                }
            }

            sog.TaintedAttachment = this.TaintedAttachment;
            sog.IsTempAttachment = this.TempAttachment;

            return sog;
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:31,代码来源:SceneObjectGroupSnapshot.cs

示例15: CreateSceneObject

 /// <summary>
 /// Create a scene object but do not add it to the scene.
 /// </summary>
 /// <param name="parts">
 /// The number of parts that should be in the scene object
 /// </param>
 /// <param name="ownerId"></param>
 /// <param name="partNamePrefix">
 /// The prefix to be given to part names.  This will be suffixed with "Part<part no>"
 /// (e.g. mynamePart1 for the root part)
 /// </param>
 /// <param name="uuidTail">
 /// The hexadecimal last part of the UUID for parts created.  A UUID of the form "00000000-0000-0000-0000-{0:XD12}"
 /// will be given to the root part, and incremented for each part thereafter.
 /// </param>
 /// <returns></returns>
 public static SceneObjectGroup CreateSceneObject(int parts, UUID ownerId, string partNamePrefix, int uuidTail)
 {            
     string rawSogId = string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail);
     
     SceneObjectGroup sog 
         = new SceneObjectGroup(
             CreateSceneObjectPart(string.Format("{0}Part1", partNamePrefix), new UUID(rawSogId), ownerId));
     
     if (parts > 1)
         for (int i = 2; i <= parts; i++)
             sog.AddPart(
                 CreateSceneObjectPart(
                     string.Format("{0}Part{1}", partNamePrefix, i), 
                     new UUID(string.Format("00000000-0000-0000-0000-{0:X12}", uuidTail + i - 1)),
                     ownerId));
     
     return sog;
 }        
开发者ID:CassieEllen,项目名称:opensim,代码行数:34,代码来源:SceneHelpers.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectGroup.AddPart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。