aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-29 23:39:27 -0400
committerTeravus Ovares (Dan Olivares)2009-08-29 23:39:27 -0400
commit33f36c9010254b14fe1b9fc1dd6bdd52ae1b16c9 (patch)
treeee67cd60c8c2cb1f760294e83ae57f9cbac7a4af /OpenSim/Region/Framework
parent* Fix the reason why physical vehicles have a problem in virtual regions. (diff)
downloadopensim-SC_OLD-33f36c9010254b14fe1b9fc1dd6bdd52ae1b16c9.zip
opensim-SC_OLD-33f36c9010254b14fe1b9fc1dd6bdd52ae1b16c9.tar.gz
opensim-SC_OLD-33f36c9010254b14fe1b9fc1dd6bdd52ae1b16c9.tar.bz2
opensim-SC_OLD-33f36c9010254b14fe1b9fc1dd6bdd52ae1b16c9.tar.xz
* Rename the RegionCombiner Module from PhysicsCombiner
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Border.cs4
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneCommunicationService.cs50
2 files changed, 31 insertions, 23 deletions
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
103 case Cardinals.SE: // x+1, y-1 103 case Cardinals.SE: // x+1, y-1
104 break; 104 break;
105 case Cardinals.S: // x+0, y-1 105 case Cardinals.S: // x+0, y-1
106 if (position.X >= BorderLine.X && position.X <= BorderLine.Y && position.Y < BorderLine.Z) 106 if (position.X >= BorderLine.X && position.X <= BorderLine.Y && position.Y-1 < BorderLine.Z)
107 { 107 {
108 return true; 108 return true;
109 } 109 }
@@ -111,7 +111,7 @@ namespace OpenSim.Region.Framework.Scenes
111 case Cardinals.SW: // x-1, y-1 111 case Cardinals.SW: // x-1, y-1
112 break; 112 break;
113 case Cardinals.W: // x-1, y+0 113 case Cardinals.W: // x-1, y+0
114 if (position.Y >= BorderLine.X && position.Y <= BorderLine.Y && position.X < BorderLine.Z) 114 if (position.Y >= BorderLine.X && position.Y <= BorderLine.Y && position.X-1 < BorderLine.Z)
115 { 115 {
116 return true; 116 return true;
117 } 117 }
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 }