當前位置: 首頁>>代碼示例>>C#>>正文


C# ScenePresence.GetPosInfo方法代碼示例

本文整理匯總了C#中OpenSim.Region.Framework.Scenes.ScenePresence.GetPosInfo方法的典型用法代碼示例。如果您正苦於以下問題:C# ScenePresence.GetPosInfo方法的具體用法?C# ScenePresence.GetPosInfo怎麽用?C# ScenePresence.GetPosInfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在OpenSim.Region.Framework.Scenes.ScenePresence的用法示例。


在下文中一共展示了ScenePresence.GetPosInfo方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: handleAvatarChangingParcel

        public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, UUID regionID)
        {
            if (m_scene.RegionInfo.RegionID == regionID)
            {
                ILandObject parcelAvatarIsEntering;
                lock (m_landList)
                {
                    parcelAvatarIsEntering = m_landList[localLandID];
                }

                if (parcelAvatarIsEntering != null)
                {
                    Vector3 pos = avatar.AbsolutePosition;
                    if (pos.Z < LandChannel.BAN_LINE_SAFETY_HEIGHT)
                    {
                        ParcelPropertiesStatus reason;
                        if (parcelAvatarIsEntering.DenyParcelAccess(avatar.UUID, out reason))
                        {
                            EntityBase.PositionInfo avatarPos = avatar.GetPosInfo();
                            if (avatarPos.Parent == null)   // not seated
                                RemoveAvatarFromParcel(avatar);
                            SendNoEntryNotice(avatar, reason);
                            return;
                        }
                    }
                    avatar.lastKnownAllowedPosition = pos;
                }
            }
        }
開發者ID:M-O-S-E-S,項目名稱:halcyon,代碼行數:29,代碼來源:LandManagementModule.cs

示例2: handleAvatarChangingParcel

        public void handleAvatarChangingParcel(ScenePresence avatar, int localLandID, UUID regionID)
        {
            if (m_scene.RegionInfo.RegionID == regionID)
            {
                ILandObject parcelAvatarIsEntering;
                lock (m_landList)
                {
                    parcelAvatarIsEntering = m_landList[localLandID];
                }

                if (parcelAvatarIsEntering != null)
                {
                    Vector3 pos = avatar.AbsolutePosition;
                    if (pos.Z < LandChannel.BAN_LINE_SAFETY_HEIGHT)
                    {
                        ParcelPropertiesStatus reason;
                        if (parcelAvatarIsEntering.DenyParcelAccess(avatar.UUID, out reason))
                        {
                            // Check if the avatar is seated and unsit before reposition/teleport in SendNoEntryNotice.
                            EntityBase.PositionInfo posInfo = avatar.GetPosInfo();
                            if (posInfo.Parent != null)
                                avatar.StandUp(null, false, true);
                            SendNoEntryNotice(avatar, reason);
                        }
                        else
                        {
                            avatar.lastKnownAllowedPosition = new Vector3(pos);
                        }
                    }
                    else
                    {
                        avatar.lastKnownAllowedPosition = new Vector3(pos);
                    }
                }
            }
        }
開發者ID:BogusCurry,項目名稱:halcyon,代碼行數:36,代碼來源:LandManagementModule.cs

示例3: RemoveAvatarFromParcel

        public void RemoveAvatarFromParcel(ScenePresence avatar)
        {
            EntityBase.PositionInfo posInfo = avatar.GetPosInfo();

            if (posInfo.Parent != null)
            {
                // can't find the prim seated on, stand up
                avatar.StandUp(null, false, true);

                // fall through to unseated avatar code.
            }

            // If they are moving, stop them.  This updates the physics object as well.
            avatar.Velocity = Vector3.Zero;

            Vector3 pos = avatar.AbsolutePosition;  // may have changed from posInfo by StandUp above.

            ParcelPropertiesStatus reason2;
            if (!avatar.lastKnownAllowedPosition.Equals(Vector3.Zero))
            {
                pos = avatar.lastKnownAllowedPosition;
            }
            else
            {
                // Still a forbidden parcel, they must have been above the limit or entering region for the first time.
                // Let's put them up higher, over the restricted parcel.
                // We could add 50m to avatar.Scene.Heightmap[x,y] but then we need subscript checks, etc.
                // For now, this is simple and safer than TPing them home.
                pos.Z += 50.0f;
            }

            ILandObject parcel = landChannel.GetLandObject(pos.X, pos.Y);
            if ((parcel != null) && parcel.DenyParcelAccess(avatar.UUID, out reason2))
            {
                float minZ = LandChannel.BAN_LINE_SAFETY_HEIGHT + AVATAR_BOUNCE;
                if (pos.Z < minZ)
                    pos.Z = minZ;
            }

            // Now force the non-sitting avatar to a position above the parcel
            avatar.Teleport(pos);   // this is really just a move
        }
開發者ID:M-O-S-E-S,項目名稱:halcyon,代碼行數:42,代碼來源:LandManagementModule.cs

示例4: RemoveAvatarFromParcel

        // Bounce constants are how far above a no-entry parcel we'll place an object or avatar.
        public void RemoveAvatarFromParcel(ScenePresence avatar)
        {
            EntityBase.PositionInfo posInfo = avatar.GetPosInfo();

            if (posInfo.Parent != null)
            {
                // can't find the prim seated on, stand up
                avatar.StandUp(false, true);

                // fall through to unseated avatar code.
            }

            // If they are moving, stop them.  This updates the physics object as well.
            // The avatar needs to be stopped before entering the parcel otherwise there
            // are timing windows where the avatar can just pound away at the parcel border
            // and get across it due to physics placing them there.
            avatar.Velocity = Vector3.Zero;

            Vector3 pos = avatar.AbsolutePosition;  // may have changed from posInfo by StandUp above.

            ParcelPropertiesStatus reason2;
            if (!avatar.lastKnownAllowedPosition.Equals(Vector3.Zero))
            {
                pos = avatar.lastKnownAllowedPosition;
            }

            ILandObject parcel = landChannel.GetLandObject(pos.X, pos.Y);
            float minZ;
            if ((parcel != null) && m_scene.TestBelowHeightLimit(avatar.UUID, pos, parcel, out minZ, out reason2))
            {
                float groundZ = (float)m_scene.Heightmap.CalculateHeightAt(pos.X, pos.Y);
                minZ += groundZ;

                // make them bounce above the banned parcel if being removed
                if (pos.Z < minZ)
                    pos.Z = minZ + Constants.AVATAR_BOUNCE;
            }

            // Now force the non-sitting avatar to a position above the parcel
            avatar.Teleport(pos);   // this is really just a move
        }
開發者ID:emperorstarfinder,項目名稱:halcyon,代碼行數:42,代碼來源:LandManagementModule.cs


注:本文中的OpenSim.Region.Framework.Scenes.ScenePresence.GetPosInfo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。