當前位置: 首頁>>代碼示例>>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: 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

示例6: 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

示例7: 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

示例8: 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

示例9: 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

示例10: 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

示例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;未經允許,請勿轉載。