* Rename the RegionCombiner Module from PhysicsCombiner

remotes/origin/0.6.7-post-fixes
Teravus Ovares (Dan Olivares) 2009-08-29 23:39:27 -04:00
parent 44b7c39c93
commit 33f36c9010
4 changed files with 45 additions and 36 deletions

View File

@ -10,7 +10,7 @@
<Extension path = "/OpenSim/RegionModules">
<RegionModule id="CapabilitiesModule" type="OpenSim.Region.CoreModules.Agent.Capabilities.CapabilitiesModule" />
<RegionModule id="TerrainModule" type="OpenSim.Region.CoreModules.World.Terrain.TerrainModule" />
<RegionModule id="PhysicsCombiner" type="OpenSim.Region.CoreModules.World.Land.PhysicsCombiner" />
<RegionModule id="RegionCombinerModule" type="OpenSim.Region.CoreModules.World.Land.RegionCombinerModule" />
<RegionModule id="WorldMapModule" type="OpenSim.Region.CoreModules.World.WorldMap.WorldMapModule" />
<RegionModule id="HGWorldMapModule" type="OpenSim.Region.CoreModules.Hypergrid.HGWorldMapModule" />
<RegionModule id="UrlModule" type="OpenSim.Region.CoreModules.Scripting.LSLHttp.UrlModule" />

View File

@ -10,11 +10,11 @@ using OpenSim.Region.Framework.Scenes;
namespace OpenSim.Region.CoreModules.World.Land
{
public class PhysicsCombiner : ISharedRegionModule
public class RegionCombinerModule : ISharedRegionModule
{
private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
public string Name { get { return "PhysicsCombiner";} }
public string Name { get { return "RegionCombinerModule"; } }
public Type ReplaceableInterface
{
get { return null; }
@ -23,10 +23,11 @@ namespace OpenSim.Region.CoreModules.World.Land
public Type ReplacableInterface { get { return null; } }
private Dictionary<UUID, RegionConnections> m_regions = new Dictionary<UUID, RegionConnections>();
private bool enabledYN = true;
private bool enabledYN = false;
public void Initialise(IConfigSource source)
{
IConfig myConfig = source.Configs["Startup"];
enabledYN = myConfig.GetBoolean("CombineContiguiousRegions", false);
}
public void Close()

View File

@ -103,7 +103,7 @@ namespace OpenSim.Region.Framework.Scenes
case Cardinals.SE: // x+1, y-1
break;
case Cardinals.S: // x+0, y-1
if (position.X >= BorderLine.X && position.X <= BorderLine.Y && position.Y < BorderLine.Z)
if (position.X >= BorderLine.X && position.X <= BorderLine.Y && position.Y-1 < BorderLine.Z)
{
return true;
}
@ -111,7 +111,7 @@ namespace OpenSim.Region.Framework.Scenes
case Cardinals.SW: // x-1, y-1
break;
case Cardinals.W: // x-1, y+0
if (position.Y >= BorderLine.X && position.Y <= BorderLine.Y && position.X < BorderLine.Z)
if (position.Y >= BorderLine.X && position.Y <= BorderLine.Y && position.X-1 < BorderLine.Z)
{
return true;
}

View File

@ -1180,55 +1180,63 @@ namespace OpenSim.Region.Framework.Scenes
Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z);
uint neighbourx = m_regionInfo.RegionLocX;
uint neighboury = m_regionInfo.RegionLocY;
const float boundaryDistance = 1.7f;
Vector3 northCross = new Vector3(0, boundaryDistance, 0);
Vector3 southCross = new Vector3(0, -1 * boundaryDistance, 0);
Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
// distance to edge that will trigger crossing
const float boundaryDistance = 1.7f;
// distance into new region to place avatar
const float enterDistance = 0.1f;
const float enterDistance = 0.5f;
if (scene.TestBorderCross(pos, Cardinals.W))
if (scene.TestBorderCross(pos + westCross, Cardinals.W))
{
if (scene.TestBorderCross(pos, Cardinals.N))
if (scene.TestBorderCross(pos + northCross, Cardinals.N))
{
Border b = scene.GetCrossedBorder(pos, Cardinals.N);
Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
neighboury += (uint)(int)(b.BorderLine.Z/(int)Constants.RegionSize);
}
else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
{
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
neighbourx--;
newpos.X = Constants.RegionSize - enterDistance;
}
else if (scene.TestBorderCross(pos, Cardinals.E))
else if (scene.TestBorderCross(pos + eastCross, Cardinals.E))
{
if (scene.TestBorderCross(pos, Cardinals.S))
Border b = scene.GetCrossedBorder(pos + eastCross, Cardinals.E);
neighbourx += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
newpos.X = enterDistance;
if (scene.TestBorderCross(pos + southCross, Cardinals.S))
{
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
else if (scene.TestBorderCross(pos, Cardinals.N))
else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
{
Border b = scene.GetCrossedBorder(pos, Cardinals.N);
neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
Border c = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize);
newpos.Y = enterDistance;
}
else
{
Border b = scene.GetCrossedBorder(pos, Cardinals.E);
neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
newpos.X = enterDistance;
}
}
else if (scene.TestBorderCross(pos, Cardinals.S))
else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
{
neighboury--;
newpos.Y = Constants.RegionSize - enterDistance;
}
else if (scene.TestBorderCross(pos, Cardinals.N))
else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
{
Border b = scene.GetCrossedBorder(pos, Cardinals.N);
Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
newpos.Y = enterDistance;
}