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


C# Scenes.SceneObjectPart类代码示例

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


SceneObjectPart类属于OpenSim.Region.Framework.Scenes命名空间,在下文中一共展示了SceneObjectPart类的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: PlaybackState

        public void PlaybackState(SceneObjectPart part)
        {
            if (part != null)
            {
                part.Undoing = true;

                if (part.ParentID == 0)
                {
                    if (Position != Vector3.Zero)
                        part.ParentGroup.AbsolutePosition = Position;
                    part.RotationOffset = Rotation;
                    if (Scale != Vector3.Zero)
                        part.Resize(Scale);
                    part.ParentGroup.ScheduleGroupForTerseUpdate();
                }
                else
                {
                    if (Position != Vector3.Zero)
                        part.OffsetPosition = Position;
                    part.UpdateRotation(Rotation);
                    if (Scale != Vector3.Zero)
                        part.Resize(Scale); part.ScheduleTerseUpdate();
                }
                part.Undoing = false;

            }
        }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:27,代码来源:UndoState.cs

示例3: Initialize

 public void Initialize(IScriptModulePlugin ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module)
 {
     m_itemID = itemID;
     m_ScriptEngine = ScriptEngine;
     m_host = host;
     ScriptProtection = module;
 }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:7,代码来源:Bot_API.cs

示例4: QueuePartForUpdate

 /// <summary>
 /// Add the part to the queue of parts for which we need to send an update to the client
 /// </summary>
 /// <param name="part"></param>
 public void QueuePartForUpdate(SceneObjectPart part)
 {
     lock (m_partsUpdateQueue)
     {
         m_partsUpdateQueue.Enqueue(part);
     }
 }
开发者ID:BackupTheBerlios,项目名称:seleon,代码行数:11,代码来源:SceneViewer.cs

示例5: TestDeRezSceneObject

        public void TestDeRezSceneObject()
        {
            TestHelper.InMethod();
//            log4net.Config.XmlConfigurator.Configure();
                        
            UUID userId = UUID.Parse("10000000-0000-0000-0000-000000000001");
            
            TestScene scene = SceneSetupHelpers.SetupScene();
            IConfigSource configSource = new IniConfigSource();
            IConfig config = configSource.AddConfig("Startup");
            config.Set("serverside_object_permissions", true);
            SceneSetupHelpers.SetupSceneModules(scene, configSource, new object[] { new PermissionsModule() });
            TestClient client = SceneSetupHelpers.AddRootAgent(scene, userId);
            
            // Turn off the timer on the async sog deleter - we'll crank it by hand for this test.
            AsyncSceneObjectGroupDeleter sogd = scene.SceneObjectGroupDeleter;
            sogd.Enabled = false;            
            
            SceneObjectPart part
                = new SceneObjectPart(userId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero);
            part.Name = "obj1";
            scene.AddNewSceneObject(new SceneObjectGroup(part), false);
            List<uint> localIds = new List<uint>();
            localIds.Add(part.LocalId);

            scene.DeRezObjects(client, localIds, UUID.Zero, DeRezAction.Delete, UUID.Zero);
            sogd.InventoryDeQueueAndDelete();
            
            SceneObjectPart retrievedPart = scene.GetSceneObjectPart(part.LocalId);
            Assert.That(retrievedPart, Is.Null);
        }
开发者ID:phantasmagoric,项目名称:InfiniteGrid-Opensim,代码行数:31,代码来源:SceneObjectDeRezTests.cs

示例6: UndoState

        /// <summary>
        /// Constructor.
        /// </summary>
        /// <param name="part"></param>
        /// <param name="change">bit field with what is changed</param>
        /// 
        public UndoState(SceneObjectPart part, ObjectChangeType change)
        {
            data = new ObjectChangeData();
            data.change = change;
            creationtime = DateTime.UtcNow;

            if (part.ParentGroup.RootPart == part)
            {
                if ((change & ObjectChangeType.Position) != 0)
                    data.position = part.ParentGroup.AbsolutePosition;
                if ((change & ObjectChangeType.Rotation) != 0)
                    data.rotation = part.RotationOffset;
                if ((change & ObjectChangeType.Scale) != 0)
                    data.scale = part.Shape.Scale;
            }
            else
            {
                if ((change & ObjectChangeType.Position) != 0)
                    data.position = part.OffsetPosition;
                if ((change & ObjectChangeType.Rotation) != 0)
                    data.rotation = part.RotationOffset;
                if ((change & ObjectChangeType.Scale) != 0)
                    data.scale = part.Shape.Scale;
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:31,代码来源:UndoState.cs

示例7: SOPObjectMaterial

 public SOPObjectMaterial(int m_face, SceneObjectPart m_parent)
 {
     this.m_face = m_face;
     this.m_parent = m_parent;
     CurrentCount++;
     TotalCount++;
 }
开发者ID:JohnMcCaffery,项目名称:XMRM,代码行数:7,代码来源:SOPObjectMaterial.cs

示例8: CreatePointEntity

        private void CreatePointEntity(Scene scene, UUID uuid, Vector3 groupPos)
        {
            SceneObjectPart y = new SceneObjectPart();

            //Initialize part
            y.Name = "Very Small Point";
            y.RegionHandle = scene.RegionInfo.RegionHandle;
            y.CreationDate = (Int32) (DateTime.UtcNow - new DateTime(1970, 1, 1)).TotalSeconds;
            y.OwnerID = UUID.Zero;
            y.CreatorID = UUID.Zero;
            y.LastOwnerID = UUID.Zero;
            y.UUID = uuid;

            y.Shape = PrimitiveBaseShape.CreateBox();
            y.Scale = new Vector3(0.01f,0.01f,0.01f);
            y.LastOwnerID = UUID.Zero;
            y.GroupPosition = groupPos;
            y.OffsetPosition = new Vector3(0, 0, 0);
            y.RotationOffset = new Quaternion(0,0,0,0);
            y.Velocity = new Vector3(0, 0, 0);
            y.RotationalVelocity = new Vector3(0, 0, 0);
            y.AngularVelocity = new Vector3(0, 0, 0);
            y.Acceleration = new Vector3(0, 0, 0);

            y.Flags = 0;
            y.TrimPermissions();

            //Initialize group and add part as root part
            SceneObjectGroup x = new SceneObjectGroup(y);
            x.SetScene(scene);
            x.RegionHandle = scene.RegionInfo.RegionHandle;
            x.SetScene(scene);

            m_Entity = x;
        }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:35,代码来源:PointMetaEntity.cs

示例9: Compare

        public bool Compare(SceneObjectPart part)
        {
            if (part != null)
            {
                if (part.ParentID == 0)
                {
                    if (Position == part.ParentGroup.AbsolutePosition && Rotation == part.RotationOffset &&
                        Scale == part.Shape.Scale)
                        return true;
                    else
                        return false;
                }
                else
                {
                    if (Position == part.OffsetPosition && Rotation == part.RotationOffset &&
                        Scale == part.Shape.Scale)
                    {
                        return ParentRotation == part.ParentGroup.RootPart.RotationOffset;
                    }
                    else
                        return false;

                }
            }
            return false;
        }
开发者ID:zwagoth,项目名称:halcyon,代码行数:26,代码来源:UndoState.cs

示例10: Enqueue

 public void Enqueue(SceneObjectPart part)
 {
     lock (m_syncObject)
     {
         if (m_ids.Add(part.UUID))
             m_queue.Enqueue(part);
     }
 }
开发者ID:AlphaStaxLLC,项目名称:taiga,代码行数:8,代码来源:UpdateQueue.cs

示例11: Initialize

 public void Initialize(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module)
 {
     m_itemID = itemID;
     m_ScriptEngine = ScriptEngine;
     m_host = host;
     ScriptProtection = module;
     AssetConnector = Aurora.DataManager.DataManager.RequestPlugin<IAssetConnector>();
 }
开发者ID:shangcheng,项目名称:Aurora,代码行数:8,代码来源:AA_API.cs

示例12: CreateSO1

 protected SceneObjectGroup CreateSO1(Scene scene, UUID ownerId)
 {
     string part1Name = "part1";
     UUID part1Id = UUID.Parse("10000000-0000-0000-0000-000000000000");
     SceneObjectPart part1
         = new SceneObjectPart(ownerId, PrimitiveBaseShape.Default, Vector3.Zero, Quaternion.Identity, Vector3.Zero) 
             { Name = part1Name, UUID = part1Id };
     return new SceneObjectGroup(part1);
 }
开发者ID:phantasmagoric,项目名称:InfiniteGrid-Opensim,代码行数:9,代码来源:TaskInventoryTests.cs

示例13: 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:CassieEllen,项目名称:opensim,代码行数:10,代码来源:UpdateQueue.cs

示例14: Initialize

        public void Initialize(ScriptEngine ScriptEngine, SceneObjectPart host, uint localID, UUID itemID, ScriptProtectionModule module)
        {
            m_ScriptEngine = ScriptEngine;
            m_host = host;
            m_localID = localID;
            m_itemID = itemID;
            ScriptProtection = module;

            m_comms = World.RequestModuleInterface<IScriptModuleComms>();
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:10,代码来源:MOD_Api.cs

示例15: QueuePartForUpdate

 /// <summary>
 /// Add the part to the queue of parts for which we need to send an update to the client
 /// </summary>
 /// <param name="part"></param>
 public void QueuePartForUpdate(SceneObjectPart part, PrimUpdateFlags UpdateFlags)
 {
     lock (m_partsUpdateQueue)
     {
         PrimUpdate update = new PrimUpdate();
         update.Part = part;
         update.UpdateFlags = UpdateFlags;
         m_partsUpdateQueue.Enqueue(update);
     }
 }
开发者ID:shangcheng,项目名称:Aurora,代码行数:14,代码来源:SceneViewer.cs


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