diff --git a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml index e38c755fcf..88317910a5 100644 --- a/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml +++ b/OpenSim/Region/CoreModules/Resources/CoreModulePlugin.addin.xml @@ -10,7 +10,7 @@ - + diff --git a/OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs similarity index 98% rename from OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs rename to OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs index 89210857a6..5ba6f39d88 100644 --- a/OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs +++ b/OpenSim/Region/CoreModules/World/Land/RegionCombinerModule.cs @@ -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 m_regions = new Dictionary(); - 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() diff --git a/OpenSim/Region/Framework/Scenes/Border.cs b/OpenSim/Region/Framework/Scenes/Border.cs index 9a08afe904..8f02a9ccbb 100644 --- a/OpenSim/Region/Framework/Scenes/Border.cs +++ b/OpenSim/Region/Framework/Scenes/Border.cs @@ -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; } diff --git a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs index 167d5f77c1..1673a22b8a 100644 --- a/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs +++ b/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs @@ -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); } - - - neighbourx--; - newpos.X = Constants.RegionSize - enterDistance; - - } - else if (scene.TestBorderCross(pos, Cardinals.E)) - { - 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)) - { - Border b = scene.GetCrossedBorder(pos, Cardinals.N); - neighboury += (uint)(int)(b.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; - } + + neighbourx--; + newpos.X = Constants.RegionSize - enterDistance; } - else if (scene.TestBorderCross(pos, Cardinals.S)) + else if (scene.TestBorderCross(pos + eastCross, Cardinals.E)) + { + 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 + northCross, Cardinals.N)) + { + Border c = scene.GetCrossedBorder(pos + northCross, Cardinals.N); + neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize); + newpos.Y = enterDistance; + } + + + } + 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; }