aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/CoreModules/World
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-08-29 03:36:41 -0400
committerTeravus Ovares (Dan Olivares)2009-08-29 03:36:41 -0400
commitd45f871d8f3abcc58556d6f5a834b132da6ec0ab (patch)
tree8bf9f262ad2d3c5d783115583031ae1e0a13c7b7 /OpenSim/Region/CoreModules/World
parent* Deal with teleports to other virtual regions in the same scene. (diff)
downloadopensim-SC_OLD-d45f871d8f3abcc58556d6f5a834b132da6ec0ab.zip
opensim-SC_OLD-d45f871d8f3abcc58556d6f5a834b132da6ec0ab.tar.gz
opensim-SC_OLD-d45f871d8f3abcc58556d6f5a834b132da6ec0ab.tar.bz2
opensim-SC_OLD-d45f871d8f3abcc58556d6f5a834b132da6ec0ab.tar.xz
* Only lock the Borders when they're being changed, otherwise one avatar's movement could hinder another avatar's movement.
Diffstat (limited to 'OpenSim/Region/CoreModules/World')
-rw-r--r--OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs73
1 files changed, 54 insertions, 19 deletions
diff --git a/OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs b/OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs
index 22ef107..2fc1623 100644
--- a/OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs
+++ b/OpenSim/Region/CoreModules/World/Land/PhysicsCombiner.cs
@@ -236,20 +236,31 @@ namespace OpenSim.Region.CoreModules.World.Land
236 m_log.DebugFormat("Scene: {0} to the west of Scene{1} Offset: {2}. Extents:{3}", 236 m_log.DebugFormat("Scene: {0} to the west of Scene{1} Offset: {2}. Extents:{3}",
237 conn.RegionScene.RegionInfo.RegionName, 237 conn.RegionScene.RegionInfo.RegionName,
238 regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); 238 regionConnections.RegionScene.RegionInfo.RegionName, offset, extents);
239 239
240
241 scene.BordersLocked = true;
242 conn.RegionScene.BordersLocked = true;
240 conn.RegionScene.PhysicsScene.Combine(null, Vector3.Zero, extents); 243 conn.RegionScene.PhysicsScene.Combine(null, Vector3.Zero, extents);
241 scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero); 244 scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero);
242 245
243 conn.RegionScene.EastBorders[0].BorderLine.Z += (int)Constants.RegionSize; 246 lock (conn.RegionScene.EastBorders)
244 conn.RegionScene.NorthBorders[0].BorderLine.Y += (int)Constants.RegionSize; 247 conn.RegionScene.EastBorders[0].BorderLine.Z += (int)Constants.RegionSize;
245 conn.RegionScene.SouthBorders[0].BorderLine.Y += (int)Constants.RegionSize; 248
249 lock (conn.RegionScene.NorthBorders)
250 conn.RegionScene.NorthBorders[0].BorderLine.Y += (int)Constants.RegionSize;
251
252 lock (conn.RegionScene.SouthBorders)
253 conn.RegionScene.SouthBorders[0].BorderLine.Y += (int)Constants.RegionSize;
246 254
247 scene.WestBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport West 255 lock (scene.WestBorders)
256 scene.WestBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport West
248 257
249 // Reset Terrain.. since terrain normally loads first. 258 // Reset Terrain.. since terrain normally loads first.
250 // 259 //
251 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); 260 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
252 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); 261 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised());
262 conn.RegionScene.BordersLocked = false;
263 scene.BordersLocked = false;
253 264
254 connectedYN = true; 265 connectedYN = true;
255 break; 266 break;
@@ -277,23 +288,33 @@ namespace OpenSim.Region.CoreModules.World.Land
277 extents.X = conn.XEnd; 288 extents.X = conn.XEnd;
278 conn.UpdateExtents(extents); 289 conn.UpdateExtents(extents);
279 290
291
292 scene.BordersLocked = true;
293 conn.RegionScene.BordersLocked = true;
294
280 m_log.DebugFormat("Scene: {0} to the northeast of Scene{1} Offset: {2}. Extents:{3}", 295 m_log.DebugFormat("Scene: {0} to the northeast of Scene{1} Offset: {2}. Extents:{3}",
281 conn.RegionScene.RegionInfo.RegionName, 296 conn.RegionScene.RegionInfo.RegionName,
282 regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); 297 regionConnections.RegionScene.RegionInfo.RegionName, offset, extents);
283 conn.RegionScene.PhysicsScene.Combine(null,Vector3.Zero,extents); 298 conn.RegionScene.PhysicsScene.Combine(null,Vector3.Zero,extents);
284 scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero); 299 scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero);
285 300
286 conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; 301 lock(conn.RegionScene.NorthBorders)
287 conn.RegionScene.EastBorders[0].BorderLine.Y += (int)Constants.RegionSize; 302 conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize;
288 conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize; 303 lock(conn.RegionScene.EastBorders)
289 304 conn.RegionScene.EastBorders[0].BorderLine.Y += (int)Constants.RegionSize;
290 scene.SouthBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport south 305 lock(conn.RegionScene.WestBorders)
306 conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize;
307 lock(scene.SouthBorders)
308 scene.SouthBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport south
291 309
292 // Reset Terrain.. since terrain normally loads first. 310 // Reset Terrain.. since terrain normally loads first.
293 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); 311 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised());
294 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); 312 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
295 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); 313 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised());
296 314
315 scene.BordersLocked = false;
316 conn.RegionScene.BordersLocked = false;
317
297 connectedYN = true; 318 connectedYN = true;
298 break; 319 break;
299 } 320 }
@@ -318,36 +339,48 @@ namespace OpenSim.Region.CoreModules.World.Land
318 extents.X = regionConnections.XEnd + conn.XEnd; 339 extents.X = regionConnections.XEnd + conn.XEnd;
319 conn.UpdateExtents(extents); 340 conn.UpdateExtents(extents);
320 341
342 scene.BordersLocked = true;
343 conn.RegionScene.BordersLocked = true;
344
321 m_log.DebugFormat("Scene: {0} to the NorthEast of Scene{1} Offset: {2}. Extents:{3}", 345 m_log.DebugFormat("Scene: {0} to the NorthEast of Scene{1} Offset: {2}. Extents:{3}",
322 conn.RegionScene.RegionInfo.RegionName, 346 conn.RegionScene.RegionInfo.RegionName,
323 regionConnections.RegionScene.RegionInfo.RegionName, offset, extents); 347 regionConnections.RegionScene.RegionInfo.RegionName, offset, extents);
324 348
325 conn.RegionScene.PhysicsScene.Combine(null, Vector3.Zero, extents); 349 conn.RegionScene.PhysicsScene.Combine(null, Vector3.Zero, extents);
326 scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero); 350 scene.PhysicsScene.Combine(conn.RegionScene.PhysicsScene, offset, Vector3.Zero);
327 351 lock(conn.RegionScene.NorthBorders)
328 if (conn.RegionScene.NorthBorders.Count == 1)// && 2) 352 if (conn.RegionScene.NorthBorders.Count == 1)// && 2)
329 { 353 {
330 //compound border 354 //compound border
355 // already locked above
331 conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize; 356 conn.RegionScene.NorthBorders[0].BorderLine.Z += (int)Constants.RegionSize;
332 conn.RegionScene.EastBorders[0].BorderLine.Y += (int)Constants.RegionSize; 357
333 conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize; 358 lock(conn.RegionScene.EastBorders)
359 conn.RegionScene.EastBorders[0].BorderLine.Y += (int)Constants.RegionSize;
360 lock(conn.RegionScene.WestBorders)
361 conn.RegionScene.WestBorders[0].BorderLine.Y += (int)Constants.RegionSize;
334 362
335 363
336 364
337 } 365 }
338 366 lock(scene.SouthBorders)
339 scene.SouthBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport south 367 scene.SouthBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport south
340 368
369 lock(conn.RegionScene.EastBorders)
341 if (conn.RegionScene.EastBorders.Count == 1)// && conn.RegionScene.EastBorders.Count == 2) 370 if (conn.RegionScene.EastBorders.Count == 1)// && conn.RegionScene.EastBorders.Count == 2)
342 { 371 {
343 372
344 conn.RegionScene.EastBorders[0].BorderLine.Z += (int)Constants.RegionSize; 373 conn.RegionScene.EastBorders[0].BorderLine.Z += (int)Constants.RegionSize;
345 conn.RegionScene.NorthBorders[0].BorderLine.Y += (int)Constants.RegionSize; 374 lock(conn.RegionScene.NorthBorders)
346 conn.RegionScene.SouthBorders[0].BorderLine.Y += (int)Constants.RegionSize; 375 conn.RegionScene.NorthBorders[0].BorderLine.Y += (int)Constants.RegionSize;
376 lock(conn.RegionScene.SouthBorders)
377 conn.RegionScene.SouthBorders[0].BorderLine.Y += (int)Constants.RegionSize;
347 378
348 379
349 } 380 }
350 scene.WestBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport West 381
382 lock (scene.WestBorders)
383 scene.WestBorders[0].BorderLine.Z += (int)Constants.RegionSize; //auto teleport West
351/* 384/*
352 else 385 else
353 { 386 {
@@ -363,6 +396,8 @@ namespace OpenSim.Region.CoreModules.World.Land
363 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); 396 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised());
364 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); 397 scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised());
365 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised()); 398 //conn.RegionScene.PhysicsScene.SetTerrain(conn.RegionScene.Heightmap.GetFloatsSerialised());
399 scene.BordersLocked = false;
400 conn.RegionScene.BordersLocked = false;
366 401
367 connectedYN = true; 402 connectedYN = true;
368 403