aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs50
1 files changed, 29 insertions, 21 deletions
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
1180 Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z); 1180 Vector3 newpos = new Vector3(pos.X, pos.Y, pos.Z);
1181 uint neighbourx = m_regionInfo.RegionLocX; 1181 uint neighbourx = m_regionInfo.RegionLocX;
1182 uint neighboury = m_regionInfo.RegionLocY; 1182 uint neighboury = m_regionInfo.RegionLocY;
1183 const float boundaryDistance = 1.7f;
1184 Vector3 northCross = new Vector3(0, boundaryDistance, 0);
1185 Vector3 southCross = new Vector3(0, -1 * boundaryDistance, 0);
1186 Vector3 eastCross = new Vector3(boundaryDistance, 0, 0);
1187 Vector3 westCross = new Vector3(-1 * boundaryDistance, 0, 0);
1183 1188
1184 // distance to edge that will trigger crossing 1189 // distance to edge that will trigger crossing
1185 const float boundaryDistance = 1.7f; 1190
1186 1191
1187 // distance into new region to place avatar 1192 // distance into new region to place avatar
1188 const float enterDistance = 0.1f; 1193 const float enterDistance = 0.5f;
1189 1194
1190 if (scene.TestBorderCross(pos, Cardinals.W)) 1195 if (scene.TestBorderCross(pos + westCross, Cardinals.W))
1191 { 1196 {
1192 if (scene.TestBorderCross(pos, Cardinals.N)) 1197 if (scene.TestBorderCross(pos + northCross, Cardinals.N))
1193 { 1198 {
1194 Border b = scene.GetCrossedBorder(pos, Cardinals.N); 1199 Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
1195 neighboury += (uint)(int)(b.BorderLine.Z/(int)Constants.RegionSize); 1200 neighboury += (uint)(int)(b.BorderLine.Z/(int)Constants.RegionSize);
1196 } 1201 }
1197 1202 else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
1198 1203 {
1204 neighboury--;
1205 newpos.Y = Constants.RegionSize - enterDistance;
1206 }
1207
1199 neighbourx--; 1208 neighbourx--;
1200 newpos.X = Constants.RegionSize - enterDistance; 1209 newpos.X = Constants.RegionSize - enterDistance;
1201 1210
1202 } 1211 }
1203 else if (scene.TestBorderCross(pos, Cardinals.E)) 1212 else if (scene.TestBorderCross(pos + eastCross, Cardinals.E))
1204 { 1213 {
1205 if (scene.TestBorderCross(pos, Cardinals.S)) 1214 Border b = scene.GetCrossedBorder(pos + eastCross, Cardinals.E);
1215 neighbourx += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
1216 newpos.X = enterDistance;
1217
1218 if (scene.TestBorderCross(pos + southCross, Cardinals.S))
1206 { 1219 {
1207 neighboury--; 1220 neighboury--;
1208 newpos.Y = Constants.RegionSize - enterDistance; 1221 newpos.Y = Constants.RegionSize - enterDistance;
1209 } 1222 }
1210 else if (scene.TestBorderCross(pos, Cardinals.N)) 1223 else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
1211 { 1224 {
1212 Border b = scene.GetCrossedBorder(pos, Cardinals.N); 1225 Border c = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
1213 neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); 1226 neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize);
1214 newpos.Y = enterDistance; 1227 newpos.Y = enterDistance;
1215 } 1228 }
1216 else 1229
1217 {
1218 Border b = scene.GetCrossedBorder(pos, Cardinals.E);
1219 neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
1220 newpos.X = enterDistance;
1221 }
1222 1230
1223 } 1231 }
1224 else if (scene.TestBorderCross(pos, Cardinals.S)) 1232 else if (scene.TestBorderCross(pos + southCross, Cardinals.S))
1225 { 1233 {
1226 neighboury--; 1234 neighboury--;
1227 newpos.Y = Constants.RegionSize - enterDistance; 1235 newpos.Y = Constants.RegionSize - enterDistance;
1228 } 1236 }
1229 else if (scene.TestBorderCross(pos, Cardinals.N)) 1237 else if (scene.TestBorderCross(pos + northCross, Cardinals.N))
1230 { 1238 {
1231 Border b = scene.GetCrossedBorder(pos, Cardinals.N); 1239 Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N);
1232 neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); 1240 neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize);
1233 newpos.Y = enterDistance; 1241 newpos.Y = enterDistance;
1234 } 1242 }