From 33f36c9010254b14fe1b9fc1dd6bdd52ae1b16c9 Mon Sep 17 00:00:00 2001 From: Teravus Ovares (Dan Olivares) Date: Sat, 29 Aug 2009 23:39:27 -0400 Subject: * Rename the RegionCombiner Module from PhysicsCombiner --- OpenSim/Region/Framework/Scenes/Border.cs | 4 +- .../Framework/Scenes/SceneCommunicationService.cs | 50 +++++++++++++--------- 2 files changed, 31 insertions(+), 23 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/Border.cs b/OpenSim/Region/Framework/Scenes/Border.cs index 9a08afe..8f02a9c 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 167d5f7..1673a22 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); } - - + 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; } -- cgit v1.1