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


C# SceneObjectPart类代码示例

本文整理汇总了C#中SceneObjectPart的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectPart类的具体用法?C# SceneObjectPart怎么用?C# SceneObjectPart使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


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

示例1: GetAssetIdFromItemName

        /// <summary>
        /// Get an asset id given an item name and an item type.
        /// </summary>
        /// <returns>UUID.Zero if the name and type did not match any item.</returns>
        /// <param name='part'></param>
        /// <param name='name'></param>
        /// <param name='type'></param>
        public static UUID GetAssetIdFromItemName(SceneObjectPart part, string name, int type)
        {
            TaskInventoryItem item = part.Inventory.GetInventoryItem(name);

            if (item != null && item.Type == type)
                return item.AssetID;
            else
                return UUID.Zero;
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:16,代码来源:ScriptUtils.cs

示例2: Enqueue

 public void Enqueue(SceneObjectPart part)
 {
     lock (m_syncObject)
     {
         if (!m_ids.ContainsKey(part.UUID)) {
             m_ids.Add(part.UUID, true);
             m_queue.Enqueue(part);
         }
     }
 }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:10,代码来源:UpdateQueue.cs

示例3: GetAssetIdFromKeyOrItemName

        /// <summary>
        /// accepts a valid UUID, -or- a name of an inventory item.
        /// Returns a valid UUID or UUID.Zero if key invalid and item not found
        /// in prim inventory.
        /// </summary>
        /// <param name="part">Scene object part to search for inventory item</param>
        /// <param name="key"></param>
        /// <returns></returns>
        public static UUID GetAssetIdFromKeyOrItemName(SceneObjectPart part, string identifier)
        {
            UUID key;

            // if we can parse the string as a key, use it.
            // else try to locate the name in inventory of object. found returns key,
            // not found returns UUID.Zero
            if (!UUID.TryParse(identifier, out key))
            {
                TaskInventoryItem item = part.Inventory.GetInventoryItem(identifier);

                if (item != null)
                    key = item.AssetID;
                else
                    key = UUID.Zero;
            }

            return key;
        }
开发者ID:BogusCurry,项目名称:arribasim-dev,代码行数:27,代码来源:ScriptUtils.cs

示例4: SOPToXml2

        public void SOPToXml2(XmlTextWriter writer, SceneObjectPart sop, Dictionary<string, object> options)
        {
            writer.WriteStartElement("SceneObjectPart");
            writer.WriteAttributeString("xmlns:xsi", "http://www.w3.org/2001/XMLSchema-instance");
            writer.WriteAttributeString("xmlns:xsd", "http://www.w3.org/2001/XMLSchema");

            writer.WriteElementString("AllowedDrop", sop.AllowedDrop.ToString().ToLower());
            WriteUUID(writer, "CreatorID", sop.CreatorID, options);

            if (!string.IsNullOrEmpty(sop.CreatorData))
                writer.WriteElementString("CreatorData", sop.CreatorData);

            writer.WriteElementString("InventorySerial", sop.InventorySerial.ToString());

            WriteTaskInventory(writer, sop.TaskInventory, options, sop.ParentEntity.Scene);

            WriteUUID(writer, "UUID", sop.UUID, options);
            writer.WriteElementString("LocalId", sop.LocalId.ToString());
            writer.WriteElementString("Name", sop.Name);
            writer.WriteElementString("Material", sop.Material.ToString());
            writer.WriteElementString("PassTouch", sop.PassTouch.ToString());
            writer.WriteElementString("PassCollisions", sop.PassCollisions.ToString());
            writer.WriteElementString("ScriptAccessPin", sop.ScriptAccessPin.ToString());

            WriteVector(writer, "GroupPosition", sop.GroupPosition);
            WriteVector(writer, "OffsetPosition", sop.OffsetPosition);

            WriteQuaternion(writer, "RotationOffset", sop.RotationOffset);
            WriteVector(writer, "Velocity", sop.Velocity);
            WriteVector(writer, "AngularVelocity", sop.AngularVelocity);
            WriteVector(writer, "Acceleration", sop.Acceleration);
            writer.WriteElementString("Description", sop.Description);
            writer.WriteStartElement("Color");
            writer.WriteElementString("R", sop.Color.R.ToString(Utils.EnUsCulture));
            writer.WriteElementString("G", sop.Color.G.ToString(Utils.EnUsCulture));
            writer.WriteElementString("B", sop.Color.B.ToString(Utils.EnUsCulture));
            writer.WriteElementString("A", sop.Color.G.ToString(Utils.EnUsCulture));
            writer.WriteEndElement();

            writer.WriteElementString("Text", sop.Text);
            writer.WriteElementString("SitName", sop.SitName);
            writer.WriteElementString("TouchName", sop.TouchName);

            writer.WriteElementString("LinkNum", sop.LinkNum.ToString());
            writer.WriteElementString("ClickAction", sop.ClickAction.ToString());

            WriteShape(writer, sop.Shape, options);

            WriteVector(writer, "Scale", sop.Scale);
            writer.WriteElementString("UpdateFlag", ((byte) 0).ToString());
            WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation);
            WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition);
            writer.WriteElementString("ParentID", sop.ParentID.ToString());
            writer.WriteElementString("CreationDate", sop.CreationDate.ToString());
            writer.WriteElementString("Category", sop.Category.ToString());
            writer.WriteElementString("SalePrice", sop.SalePrice.ToString());
            writer.WriteElementString("ObjectSaleType", sop.ObjectSaleType.ToString());
            writer.WriteElementString("OwnershipCost", sop.OwnershipCost.ToString());
            WriteUUID(writer, "GroupID", sop.GroupID, options);
            WriteUUID(writer, "OwnerID", sop.OwnerID, options);
            WriteUUID(writer, "LastOwnerID", sop.LastOwnerID, options);
            writer.WriteElementString("BaseMask", sop.BaseMask.ToString());
            writer.WriteElementString("OwnerMask", sop.OwnerMask.ToString());
            writer.WriteElementString("GroupMask", sop.GroupMask.ToString());
            writer.WriteElementString("EveryoneMask", sop.EveryoneMask.ToString());
            writer.WriteElementString("NextOwnerMask", sop.NextOwnerMask.ToString());
            writer.WriteElementString("Flags", sop.Flags.ToString());
            WriteUUID(writer, "CollisionSound", sop.CollisionSound, options);
            writer.WriteElementString("CollisionSoundVolume", sop.CollisionSoundVolume.ToString());
            if (sop.MediaUrl != null)
                writer.WriteElementString("MediaUrl", sop.MediaUrl);
            WriteBytes(writer, "TextureAnimation", sop.TextureAnimation);
            WriteBytes(writer, "ParticleSystem", sop.ParticleSystem);
            writer.WriteElementString("PayPrice0", sop.PayPrice[0].ToString());
            writer.WriteElementString("PayPrice1", sop.PayPrice[1].ToString());
            writer.WriteElementString("PayPrice2", sop.PayPrice[2].ToString());
            writer.WriteElementString("PayPrice3", sop.PayPrice[3].ToString());
            writer.WriteElementString("PayPrice4", sop.PayPrice[4].ToString());
            writer.WriteElementString("FromUserInventoryItemID", sop.FromUserInventoryItemID.ToString());
            writer.WriteElementString("FromUserInventoryAssetID", sop.FromUserInventoryAssetID.ToString());

            writer.WriteElementString("RETURN_AT_EDGE", sop.RETURN_AT_EDGE.ToString().ToLower());
            writer.WriteElementString("BlockGrab", sop.BlockGrab.ToString().ToLower());
            writer.WriteElementString("BlockGrabObject", sop.BlockGrabObject.ToString().ToLower());
            writer.WriteElementString("StatusSandbox", sop.StatusSandbox.ToString().ToLower());
            WriteVector(writer, "StatusSandboxPos", sop.StatusSandboxPos);

            writer.WriteElementString("STATUS_ROTATE_X", sop.STATUS_ROTATE_X.ToString());
            writer.WriteElementString("STATUS_ROTATE_Y", sop.STATUS_ROTATE_Y.ToString());
            writer.WriteElementString("STATUS_ROTATE_Z", sop.STATUS_ROTATE_Z.ToString());

            WriteVector(writer, "SitTargetPosition", sop.SitTargetPosition);
            WriteQuaternion(writer, "SitTargetOrientation", sop.SitTargetOrientation);
            WriteVector(writer, "OmegaAxis", sop.OmegaAxis);

            writer.WriteElementString("OmegaSpinRate", sop.OmegaSpinRate.ToString());
            writer.WriteElementString("OmegaGain", sop.OmegaGain.ToString());
            writer.WriteElementString("PhysicsType", sop.PhysicsType.ToString());
            writer.WriteElementString("Density", sop.Density.ToString());
            writer.WriteElementString("Friction", sop.Friction.ToString());
//.........这里部分代码省略.........
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:101,代码来源:SceneObjectSerializer.cs

示例5: GenericByte

 private void GenericByte(SceneObjectPart obj, XmlTextReader reader, string name, Type SOPType)
 {
     SOPType.GetProperty(name)
            .SetValue(obj, byte.Parse(reader.ReadElementContentAsString(name, String.Empty)), null);
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:5,代码来源:SceneObjectSerializer.cs

示例6: ProcessFromUserInventoryItemID

 private void ProcessFromUserInventoryItemID(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.FromUserInventoryItemID = ReadUUID(reader, "FromUserInventoryItemID");
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:4,代码来源:SceneObjectSerializer.cs

示例7: ProcessParticleSystem

 private void ProcessParticleSystem(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.ParticleSystem =
         Convert.FromBase64String(reader.ReadElementContentAsString("ParticleSystem", String.Empty));
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:5,代码来源:SceneObjectSerializer.cs

示例8: ProcessMediaUrl

 private void ProcessMediaUrl(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.MediaUrl = reader.ReadElementContentAsString("MediaUrl", String.Empty);
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:4,代码来源:SceneObjectSerializer.cs

示例9: ProcessCollisionSound

 private void ProcessCollisionSound(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.CollisionSound = ReadUUID(reader, "CollisionSound");
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:4,代码来源:SceneObjectSerializer.cs

示例10: ProcessParentID

 private void ProcessParentID(SceneObjectPart obj, XmlTextReader reader)
 {
     string str = reader.ReadElementContentAsString("ParentID", String.Empty);
     obj.ParentID = Convert.ToUInt32(str);
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:5,代码来源:SceneObjectSerializer.cs

示例11: ProcessSitTargetPosition

 private void ProcessSitTargetPosition(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.SitTargetPosition = ReadVector(reader, "SitTargetPosition");
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:4,代码来源:SceneObjectSerializer.cs

示例12: ProcessSitTargetOrientation

 private void ProcessSitTargetOrientation(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.SitTargetOrientation = ReadQuaternion(reader, "SitTargetOrientation");
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:4,代码来源:SceneObjectSerializer.cs

示例13: ProcessUpdateFlag

 private void ProcessUpdateFlag(SceneObjectPart obj, XmlTextReader reader)
 {
     reader.Read();
     //InternalUpdateFlags flags = (InternalUpdateFlags)(byte)reader.ReadElementContentAsInt("UpdateFlag", String.Empty);
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:5,代码来源:SceneObjectSerializer.cs

示例14: ProcessScale

 private void ProcessScale(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.Scale = ReadVector(reader, "Scale");
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:4,代码来源:SceneObjectSerializer.cs

示例15: ProcessShape

 private void ProcessShape(SceneObjectPart obj, XmlTextReader reader)
 {
     obj.Shape = ReadShape(reader, "Shape");
 }
开发者ID:velus,项目名称:Async-Sim-Testing,代码行数:4,代码来源:SceneObjectSerializer.cs


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