本文整理汇总了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;
}
}
}
示例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);
}
}
}
}
示例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
}
示例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
}