mirror of
https://github.com/opensim/opensim.git
synced 2026-08-05 08:55:56 +08:00
region handle things
This commit is contained in:
@@ -446,6 +446,48 @@ namespace OpenSim.Framework
|
||||
return regionCoord << 8;
|
||||
}
|
||||
|
||||
public static bool CompareRegionHandles(ulong handle, Vector3 handleOffset, RegionInfo region, out Vector3 regionOffset)
|
||||
{
|
||||
RegionHandleToWorldLoc(handle, out uint uhX, out uint uhY);
|
||||
double px = uhX - region.WorldLocX + (double)handleOffset.X;
|
||||
double py = uhY - region.WorldLocY + (double)handleOffset.Y;
|
||||
if (px >= 0 && px < region.RegionSizeX && py >= 0 && py < region.RegionSizeY)
|
||||
{
|
||||
regionOffset = new Vector3((float)px, (float)py, handleOffset.Z);
|
||||
return true;
|
||||
}
|
||||
regionOffset = Vector3.Zero;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CompareRegionHandler(ulong handle, Vector3 handleOffset, ulong regionhandle, int regionSizeX, int regionSizeY, out Vector3 regionOffset)
|
||||
{
|
||||
RegionHandleToWorldLoc(handle, out uint uhX, out uint uhY);
|
||||
RegionHandleToWorldLoc(regionhandle, out uint urX, out uint urY);
|
||||
double px = uhX - urX + (double)handleOffset.X;
|
||||
double py = uhY - urY + (double)handleOffset.Y;
|
||||
if (px >= 0 && px < regionSizeX && py >= 0 && py < regionSizeY)
|
||||
{
|
||||
regionOffset = new Vector3((float)px, (float)py, handleOffset.Z);
|
||||
return true;
|
||||
}
|
||||
regionOffset = Vector3.Zero;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool CompareRegionHandlers(ulong handle, Vector3 handleOffset, int regionX, int regionY, int regionSizeX, int regionSizeY, out Vector3 regionOffset)
|
||||
{
|
||||
RegionHandleToWorldLoc(handle, out uint uhX, out uint uhY);
|
||||
double px = uhX - regionX + (double)handleOffset.X;
|
||||
double py = uhY - regionY + (double)handleOffset.Y;
|
||||
if (px >= 0 && px < regionSizeX && py >= 0 && py < regionSizeY)
|
||||
{
|
||||
regionOffset = new Vector3((float)px, (float)py, handleOffset.Z);
|
||||
return true;
|
||||
}
|
||||
regionOffset = Vector3.Zero;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static bool checkServiceURI(string uristr, out string serviceURI, out string serviceHost, out string serviceIPstr)
|
||||
{
|
||||
|
||||
@@ -425,9 +425,10 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
RegionInfo spRi = sp.Scene.RegionInfo;
|
||||
try
|
||||
{
|
||||
if (regionHandle == sp.Scene.RegionInfo.RegionHandle)
|
||||
if (Util.CompareRegionHandles(regionHandle, position, spRi, out Vector3 roffset))
|
||||
{
|
||||
if(!sp.AllowMovement)
|
||||
{
|
||||
@@ -436,9 +437,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
return;
|
||||
}
|
||||
|
||||
destinationRegionName = sp.Scene.RegionInfo.RegionName;
|
||||
|
||||
TeleportAgentWithinRegion(sp, position, lookAt, teleportFlags);
|
||||
destinationRegionName = spRi.RegionName;
|
||||
TeleportAgentWithinRegion(sp, roffset, lookAt, teleportFlags);
|
||||
}
|
||||
else // Another region possibly in another simulator
|
||||
{
|
||||
@@ -508,7 +508,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer
|
||||
float posZLimit = 22;
|
||||
|
||||
// TODO: Check other Scene HeightField
|
||||
posZLimit = (float)sp.Scene.Heightmap[(int)position.X, (int)position.Y];
|
||||
posZLimit = sp.Scene.Heightmap[(int)position.X, (int)position.Y];
|
||||
|
||||
posZLimit += localHalfAVHeight + 0.1f;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user