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


C# Scene.AllocateLocalId方法代码示例

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


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

示例1: ScenePresence

        public ScenePresence(
            IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
        {            
            m_scene = world;
            AttachmentsSyncLock = new Object();
            AllowMovement = true;
            IsChildAgent = true;
            IsLoggingIn = false;
            m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
            Animator = new ScenePresenceAnimator(this);
            Overrides = new MovementAnimationOverrides();
            PresenceType = type;
            DrawDistance = world.DefaultDrawDistance;
            RegionHandle = world.RegionInfo.RegionHandle;
            ControllingClient = client;
            Firstname = ControllingClient.FirstName;
            Lastname = ControllingClient.LastName;
            m_name = String.Format("{0} {1}", Firstname, Lastname);
            m_uuid = client.AgentId;
            LocalId = m_scene.AllocateLocalId();
            LegacySitOffsets = m_scene.LegacySitOffsets;

            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
            if (account != null)
                m_userFlags = account.UserFlags;
            else
                m_userFlags = 0;

            if (account != null)
                UserLevel = account.UserLevel;

            IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            if (gm != null)
               Grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
            
            AbsolutePosition = posLastSignificantMove = CameraPosition =
                m_lastCameraPosition = ControllingClient.StartPos;

            m_reprioritization_timer = new Timer(world.ReprioritizationInterval);
            m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize);
            m_reprioritization_timer.AutoReset = false;

            AdjustKnownSeeds();

            RegisterToEvents();
            SetDirectionVectors();

            Appearance = appearance;

            m_stateMachine = new ScenePresenceStateMachine(this);
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:53,代码来源:ScenePresence.cs

示例2: AttachToScene

        /// <summary>
        /// Attach this object to a scene.  It will also now appear to agents.
        /// </summary>
        /// <param name="scene"></param>
        public void AttachToScene(Scene scene)
        {
            m_scene = scene;
            RegionHandle = m_scene.RegionInfo.RegionHandle;

            if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
                m_rootPart.ParentID = 0;
            if (m_rootPart.LocalId == 0)
                m_rootPart.LocalId = m_scene.AllocateLocalId();

            SceneObjectPart[] parts = m_parts.GetArray();
            for (int i = 0; i < parts.Length; i++)
            {
                SceneObjectPart part = parts[i];
                if (Object.ReferenceEquals(part, m_rootPart))
                    continue;

                if (part.LocalId == 0)
                    part.LocalId = m_scene.AllocateLocalId();

                part.ParentID = m_rootPart.LocalId;
                //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
            }

            ApplyPhysics();

            // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
            // for the same object with very different properties.  The caller must schedule the update.
            //ScheduleGroupForFullUpdate();
        }
开发者ID:justasabc,项目名称:opensim75grid,代码行数:34,代码来源:SceneObjectGroup.cs

示例3: AttachToScene

        /// <summary>
        /// Attach this object to a scene.  It will also now appear to agents.
        /// </summary>
        /// <param name="scene"></param>
        public void AttachToScene(Scene scene)
        {
            m_scene = scene;
            RegionHandle = m_scene.RegionInfo.RegionHandle;

            if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
                m_rootPart.ParentID = 0;
            if (m_rootPart.LocalId == 0)
                m_rootPart.LocalId = m_scene.AllocateLocalId();

            // No need to lock here since the object isn't yet in a scene
            foreach (SceneObjectPart part in m_parts.Values)
            {
                if (Object.ReferenceEquals(part, m_rootPart))
                {
                    continue;
                }

                if (part.LocalId == 0)
                {
                    part.LocalId = m_scene.AllocateLocalId();
                }

                part.ParentID = m_rootPart.LocalId;
                //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
            }
            
            ApplyPhysics(m_scene.m_physicalPrim);

            // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
            // for the same object with very different properties.  The caller must schedule the update.
            //ScheduleGroupForFullUpdate();
        }
开发者ID:gumho,项目名称:diva-distribution,代码行数:37,代码来源:SceneObjectGroup.cs

示例4: ScenePresence

        private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this()
        {
            m_rootRegionHandle = reginfo.RegionHandle;
            m_controllingClient = client;
            m_firstname = m_controllingClient.FirstName;
            m_lastname = m_controllingClient.LastName;
            m_name = String.Format("{0} {1}", m_firstname, m_lastname);
            m_scene = world;
            m_uuid = client.AgentId;
            m_regionInfo = reginfo;
            m_localId = m_scene.AllocateLocalId();

            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);

            if (account != null)
                m_userLevel = account.UserLevel;

            IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            if (gm != null)
                m_grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
            
            AbsolutePosition = posLastSignificantMove = m_CameraCenter =
                m_lastCameraCenter = m_controllingClient.StartPos;

            m_reprioritization_timer = new Timer(world.ReprioritizationInterval);
            m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize);
            m_reprioritization_timer.AutoReset = false;

            AdjustKnownSeeds();

            // TODO: I think, this won't send anything, as we are still a child here...
            Animator.TrySetMovementAnimation("STAND"); 

            // we created a new ScenePresence (a new child agent) in a fresh region.
            // Request info about all the (root) agents in this region
            // Note: This won't send data *to* other clients in that region (children don't send)
            SendInitialFullUpdateToAllClients();

            RegisterToEvents();
            SetDirectionVectors();
        }
开发者ID:dreamerc,项目名称:diva-distribution,代码行数:43,代码来源:ScenePresence.cs

示例5: ScenePresence

        private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
        {
            m_regionHandle = reginfo.RegionHandle;
            m_controllingClient = client;
            Firstname = m_controllingClient.FirstName;
            Lastname = m_controllingClient.LastName;
            m_name = String.Format("{0} {1}", Firstname, Lastname);
            m_scene = world;
            m_uuid = client.AgentId;
            m_regionInfo = reginfo;
            m_localId = m_scene.AllocateLocalId();

            m_useFlySlow = m_scene.m_useFlySlow;
            m_usePreJump = m_scene.m_usePreJump;

            IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            if (gm != null)
                m_grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();

            ISceneViewModule sceneViewModule = m_scene.RequestModuleInterface<ISceneViewModule>();
            if (sceneViewModule != null)
                m_sceneView = sceneViewModule.CreateSceneView(this);
            else
                m_log.Warn("[SCENE PRESENCE]: Failed to create a scene view");

            SetAgentPositionInfo(null, true, m_controllingClient.StartPos, null, Vector3.Zero, m_velocity);

            m_animPersistUntil = 0;
            
            RegisterToEvents();
            SetDirectionVectors();
            SetDirectionFlags();

            m_remotePresences = new AvatarRemotePresences(world, this);
            m_connection = world.ConnectionManager.GetConnection(this.UUID);
            if (m_connection != null)   // can be null for bots which don't have a LLCV
                m_connection.ScenePresence = this;

            // Prime (cache) the user's group list.
            m_scene.UserGroupsGet(this.UUID);
        }
开发者ID:emperorstarfinder,项目名称:halcyon,代码行数:43,代码来源:ScenePresence.cs

示例6: AttachToScene

        /// <summary>
        /// Attach this object to a scene.  It will also now appear to agents.
        /// </summary>
        /// <param name="scene"></param>
        public void AttachToScene(Scene scene, bool fromStorage)
        {
            m_scene = scene;
            RegionHandle = m_scene.RegionInfo.RegionHandle;

            if (!IsAttachment)
                m_rootPart.ParentID = 0;
            if (m_rootPart.LocalId == 0)
                m_rootPart.LocalId = m_scene.AllocateLocalId();

            // No need to lock here since the object isn't yet in a scene
            foreach (SceneObjectPart part in m_parts.Values)
            {
                if (Object.ReferenceEquals(part, m_rootPart))
                    continue;
                if (part.LocalId == 0)
                    part.LocalId = m_scene.AllocateLocalId();
                part.ParentID = m_rootPart.LocalId;
                //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
            }

            if (RootPart.PhysActor == null) //don't apply physics if we already have a physactor.
            {
                ApplyPhysics(m_scene.m_physicalPrim, fromStorage);
                ScheduleGroupForFullUpdate();
            }

            // Need the bounding box now.
            BoundingBox();
        }
开发者ID:zwagoth,项目名称:halcyon,代码行数:34,代码来源:SceneObjectGroup.cs

示例7: AttachToScene

        /// <summary>
        /// Attach this object to a scene.  It will also now appear to agents.
        /// </summary>
        /// <param name="scene"></param>
        public void AttachToScene(Scene scene)
        {
            m_scene = scene;
            RegionHandle = m_scene.RegionInfo.RegionHandle;

            if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
                m_rootPart.ParentID = 0;
            if (m_rootPart.LocalId==0)
                m_rootPart.LocalId = m_scene.AllocateLocalId();

            // No need to lock here since the object isn't yet in a scene
            foreach (SceneObjectPart part in m_parts.Values)
            {
                if (Object.ReferenceEquals(part, m_rootPart))
                {
                    continue;
                }

                if (part.LocalId == 0)
                {
                    part.LocalId = m_scene.AllocateLocalId();
                }

                part.ParentID = m_rootPart.LocalId;
                //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
            }
            
            ApplyPhysics(m_scene.m_physicalPrim);
            
            ScheduleGroupForFullUpdate();
        }
开发者ID:intari,项目名称:OpenSimMirror,代码行数:35,代码来源:SceneObjectGroup.cs

示例8: ScenePresence

        private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo)
        {
            m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
            CreateSceneViewer();
            m_regionHandle = reginfo.RegionHandle;
            m_controllingClient = client;
            m_firstname = m_controllingClient.FirstName;
            m_lastname = m_controllingClient.LastName;
            m_name = String.Format("{0} {1}", m_firstname, m_lastname);
            m_scene = world;
            m_uuid = client.AgentId;
            m_regionInfo = reginfo;
            m_localId = m_scene.AllocateLocalId();

            m_useFlySlow = m_scene.m_useFlySlow;
            m_usePreJump = m_scene.m_usePreJump;

            IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            if (gm != null)
                m_grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();

            AbsolutePosition = m_controllingClient.StartPos;
            AdjustKnownSeeds();

            TrySetMovementAnimation("STAND"); // TODO: I think, this won't send anything, as we are still a child here...

            // we created a new ScenePresence (a new child agent) in a fresh region.
            // Request info about all the (root) agents in this region
            // Note: This won't send data *to* other clients in that region (children don't send)
            SendInitialFullUpdateToAllClients();

            RegisterToEvents();
            SetDirectionVectors();

        }
开发者ID:Ideia-Boa,项目名称:diva-distribution,代码行数:37,代码来源:ScenePresence.cs

示例9: ScenePresence

        public ScenePresence(
            IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
        {
            m_scene = world;
            AttachmentsSyncLock = new Object();
            AllowMovement = true;
            IsChildAgent = true;
            IsLoggingIn = false;
            m_sendCoarseLocationsMethod = SendCoarseLocationsDefault;
            Animator = new ScenePresenceAnimator(this);
            Overrides = new MovementAnimationOverrides();
            PresenceType = type;
            DrawDistance = world.DefaultDrawDistance;
            RegionHandle = world.RegionInfo.RegionHandle;
            ControllingClient = client;
            Firstname = ControllingClient.FirstName;
            Lastname = ControllingClient.LastName;
            m_name = String.Format("{0} {1}", Firstname, Lastname);
            m_uuid = client.AgentId;
            LocalId = m_scene.AllocateLocalId();
            LegacySitOffsets = m_scene.LegacySitOffsets;

            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
            if (account != null)
                m_userFlags = account.UserFlags;
            else
                m_userFlags = 0;

            if (account != null)
                UserLevel = account.UserLevel;

            //           IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            //           if (gm != null)
            //              Grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();

            AbsolutePosition = posLastMove = posLastSignificantMove = CameraPosition =
               m_reprioritizationLastPosition = ControllingClient.StartPos;

            m_reprioritizationLastDrawDistance = DrawDistance;

            // disable updates workjobs for now
            childUpdatesBusy = true;
            m_reprioritizationBusy = true;

            AdjustKnownSeeds();

            RegisterToEvents();
            SetDirectionVectors();

            Appearance = appearance;

            m_stateMachine = new ScenePresenceStateMachine(this);

            HealRate = 0.5f;

            IConfig sconfig = m_scene.Config.Configs["EntityTransfer"];
            if (sconfig != null)
            {
                string lpb = sconfig.GetString("LandingPointBehavior", "LandingPointBehavior_OS");
                if (lpb == "LandingPointBehavior_SL")
                    m_LandingPointBehavior = LandingPointBehavior.SL;
            }

        }
开发者ID:emperorstarfinder,项目名称:Opensim2,代码行数:66,代码来源:ScenePresence.cs

示例10: AttachToScene

        /// <summary>
        /// Attach this object to a scene.  It will also now appear to agents.
        /// </summary>
        /// <param name="scene"></param>
        public void AttachToScene(Scene scene)
        {
            m_scene = scene;

            if (m_rootPart.Shape == null)
            {
                m_log.Warn("[SceneObjectGroup]: Found null shape for prim " + UUID + ", creating default box shape");
                m_rootPart.Shape = new PrimitiveBaseShape();
            }

            if (m_rootPart.Shape.PCode != 9 || m_rootPart.Shape.State == 0)
                m_rootPart.SetParentLocalId(0);
            bool changedLocalIDs = false;
            if (m_rootPart.LocalId == 0)
            {
                m_rootPart.LocalId = m_scene.AllocateLocalId();
                changedLocalIDs = true;
            }

            // No need to lock here since the object isn't yet in a scene
            foreach (SceneObjectPart part in m_partsList)
            {
                if (Object.ReferenceEquals(part, m_rootPart))
                    continue;

                if (part.LocalId == 0)
                {
                    part.LocalId = m_scene.AllocateLocalId();
                    changedLocalIDs = true;
                }

                part.SetParentLocalId(m_rootPart.LocalId);
                //m_log.DebugFormat("[SCENE]: Given local id {0} to part {1}, linknum {2}, parent {3} {4}", part.LocalId, part.UUID, part.LinkNum, part.ParentID, part.ParentUUID);
            }

            IOpenRegionSettingsModule WSModule = Scene.RequestModuleInterface<IOpenRegionSettingsModule>();
            if (WSModule != null) 
                ApplyPhysics(WSModule.AllowPhysicalPrims);
            else
                ApplyPhysics(true);

            if (changedLocalIDs)
            {
                m_scene.Entities.Remove(LocalId);
                m_scene.Entities.Remove(UUID);
                m_scene.Entities.Add(this);
            }

            // Don't trigger the update here - otherwise some client issues occur when multiple updates are scheduled
            // for the same object with very different properties.  The caller must schedule the update.
            //ScheduleGroupForFullUpdate();
        }
开发者ID:shangcheng,项目名称:Aurora,代码行数:56,代码来源:SceneObjectGroup.cs

示例11: AttachToScene

        /// <summary>
        /// Attach this object to a scene.  It will also now appear to agents.
        /// </summary>
        /// <param name="scene"></param>
        public void AttachToScene(Scene scene, bool fromStorage)
        {
            m_scene = scene;
            RegionHandle = m_scene.RegionInfo.RegionHandle;

            if (!IsAttachment)
                m_rootPart.ParentID = 0;
            if (m_rootPart.LocalId == 0)
                m_rootPart.LocalId = m_scene.AllocateLocalId();
            
            m_childParts.ForEachPart((SceneObjectPart part) => {
                if (Object.ReferenceEquals(part, m_rootPart))
                    return;

                if (part.LocalId == 0)
                    part.LocalId = m_scene.AllocateLocalId();
                part.ParentID = m_rootPart.LocalId;
            });

            if (RootPart.PhysActor == null) //don't apply physics if we already have a physactor.
            {
                ApplyPhysics(m_scene.m_physicalPrim, fromStorage);
                ScheduleGroupForFullUpdate(PrimUpdateFlags.ForcedFullUpdate);
            }

            // Need the bounding box now.
            BoundingBox();

            //Signal a new object appearing in the scene
            Scene.EventManager.TriggerObjectAddedToScene(this);
        }
开发者ID:kf6kjg,项目名称:halcyon,代码行数:35,代码来源:SceneObjectGroup.cs

示例12: ScenePresence

        public ScenePresence(
            IClientAPI client, Scene world, AvatarAppearance appearance, PresenceType type)
        {
            AttachmentsSyncLock = new Object();

            m_sendCourseLocationsMethod = SendCoarseLocationsDefault;
            Animator = new ScenePresenceAnimator(this);
            PresenceType = type;
            DrawDistance = world.DefaultDrawDistance;
            RegionHandle = world.RegionInfo.RegionHandle;
            ControllingClient = client;
            Firstname = ControllingClient.FirstName;
            Lastname = ControllingClient.LastName;
            m_name = String.Format("{0} {1}", Firstname, Lastname);
            m_scene = world;
            m_uuid = client.AgentId;
            LocalId = m_scene.AllocateLocalId();

            UserAccount account = m_scene.UserAccountService.GetUserAccount(m_scene.RegionInfo.ScopeID, m_uuid);
            if (account != null)
                m_userFlags = account.UserFlags;
            else
                m_userFlags = 0;

            if (account != null)
                UserLevel = account.UserLevel;

            IGroupsModule gm = m_scene.RequestModuleInterface<IGroupsModule>();
            if (gm != null)
                Grouptitle = gm.GetGroupTitle(m_uuid);

            m_scriptEngines = m_scene.RequestModuleInterfaces<IScriptModule>();
            
            AbsolutePosition = posLastSignificantMove = CameraPosition =
                m_lastCameraPosition = ControllingClient.StartPos;

            m_reprioritization_timer = new Timer(world.ReprioritizationInterval);
            m_reprioritization_timer.Elapsed += new ElapsedEventHandler(Reprioritize);
            m_reprioritization_timer.AutoReset = false;

            AdjustKnownSeeds();

            // TODO: I think, this won't send anything, as we are still a child here...
            Animator.TrySetMovementAnimation("STAND"); 

            // we created a new ScenePresence (a new child agent) in a fresh region.
            // Request info about all the (root) agents in this region
            // Note: This won't send data *to* other clients in that region (children don't send)

// MIC: This gets called again in CompleteMovement
            // SendInitialFullUpdateToAllClients();
            SendOtherAgentsAvatarDataToMe();
            SendOtherAgentsAppearanceToMe();

            RegisterToEvents();
            SetDirectionVectors();

            Appearance = appearance;
        }
开发者ID:justasabc,项目名称:opensim,代码行数:59,代码来源:ScenePresence.cs


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