aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.cs53
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneBase.cs2
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs20
3 files changed, 13 insertions, 62 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs
index 10421ff..5a7e2dd 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.cs
@@ -1099,8 +1099,6 @@ namespace OpenSim.Region.Framework.Scenes
1099 /// <returns>True after all operations complete, throws exceptions otherwise.</returns> 1099 /// <returns>True after all operations complete, throws exceptions otherwise.</returns>
1100 public override void OtherRegionUp(GridRegion otherRegion) 1100 public override void OtherRegionUp(GridRegion otherRegion)
1101 { 1101 {
1102 // uint xcell = (uint)((int)otherRegion.RegionLocX / (int)Constants.RegionSize);
1103 // uint ycell = (uint)((int)otherRegion.RegionLocY / (int)Constants.RegionSize);
1104 uint xcell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocX); 1102 uint xcell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocX);
1105 uint ycell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocY); 1103 uint ycell = Util.WorldToRegionLoc((uint)otherRegion.RegionLocY);
1106 1104
@@ -2450,9 +2448,9 @@ namespace OpenSim.Region.Framework.Scenes
2450 int xx = (int)Math.Floor(pos.X); 2448 int xx = (int)Math.Floor(pos.X);
2451 int yy = (int)Math.Floor(pos.Y); 2449 int yy = (int)Math.Floor(pos.Y);
2452 if (xx < 0 2450 if (xx < 0
2453 || xx > RegionInfo.RegionSizeX 2451 || xx >= RegionInfo.RegionSizeX
2454 || yy < 0 2452 || yy < 0
2455 || yy > RegionInfo.RegionSizeY) 2453 || yy >= RegionInfo.RegionSizeY)
2456 ret = false; 2454 ret = false;
2457 return ret; 2455 return ret;
2458 2456
@@ -4581,53 +4579,6 @@ namespace OpenSim.Region.Framework.Scenes
4581 ScenePresence sp = GetScenePresence(remoteClient.AgentId); 4579 ScenePresence sp = GetScenePresence(remoteClient.AgentId);
4582 if (sp != null) 4580 if (sp != null)
4583 { 4581 {
4584 /*
4585 uint regionX = RegionInfo.LegacyRegionLocX;
4586 uint regionY = RegionInfo.LegacyRegionLocY;
4587
4588 Util.RegionHandleToWorldLoc(regionHandle, out regionX, out regionY);
4589 Utils.LongToUInts(regionHandle, out regionX, out regionY);
4590
4591 int shiftx = (int) regionX - (int) RegionInfo.LegacyRegionLocX * (int)Constants.RegionSize;
4592 int shifty = (int) regionY - (int) RegionInfo.LegacyRegionLocY * (int)Constants.RegionSize;
4593 */
4594
4595 uint regionX, regionY;
4596 Util.RegionHandleToWorldLoc(regionHandle, out regionX, out regionY);
4597
4598 int shiftx = (int) regionX - (int)RegionInfo.WorldLocX;
4599 int shifty = (int) regionY - (int)RegionInfo.WorldLocY;
4600
4601 position.X += shiftx;
4602 position.Y += shifty;
4603
4604 bool result = false;
4605
4606 if (TestBorderCross(position,Cardinals.N))
4607 result = true;
4608
4609 if (TestBorderCross(position, Cardinals.S))
4610 result = true;
4611
4612 if (TestBorderCross(position, Cardinals.E))
4613 result = true;
4614
4615 if (TestBorderCross(position, Cardinals.W))
4616 result = true;
4617
4618 // bordercross if position is outside of region
4619
4620 if (!result)
4621 {
4622 regionHandle = RegionInfo.RegionHandle;
4623 }
4624 else
4625 {
4626 // not in this region, undo the shift!
4627 position.X -= shiftx;
4628 position.Y -= shifty;
4629 }
4630
4631 if (EntityTransferModule != null) 4582 if (EntityTransferModule != null)
4632 { 4583 {
4633 EntityTransferModule.Teleport(sp, regionHandle, position, lookAt, teleportFlags); 4584 EntityTransferModule.Teleport(sp, regionHandle, position, lookAt, teleportFlags);
diff --git a/OpenSim/Region/Framework/Scenes/SceneBase.cs b/OpenSim/Region/Framework/Scenes/SceneBase.cs
index f95220d..b059ecf 100644
--- a/OpenSim/Region/Framework/Scenes/SceneBase.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneBase.cs
@@ -42,7 +42,7 @@ namespace OpenSim.Region.Framework.Scenes
42{ 42{
43 public abstract class SceneBase : IScene 43 public abstract class SceneBase : IScene
44 { 44 {
45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 45 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
46 private static readonly string LogHeader = "[SCENE]"; 46 private static readonly string LogHeader = "[SCENE]";
47 47
48 #region Events 48 #region Events
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index d4cbf7d..44c476c 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -331,7 +331,7 @@ namespace OpenSim.Region.Framework.Scenes
331 { 331 {
332 get 332 get
333 { 333 {
334 Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize); 334 Vector3 minScale = new Vector3(Constants.MaximumRegionSize, Constants.MaximumRegionSize, Constants.MaximumRegionSize);
335 Vector3 maxScale = Vector3.Zero; 335 Vector3 maxScale = Vector3.Zero;
336 Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f); 336 Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
337 337
@@ -517,14 +517,14 @@ namespace OpenSim.Region.Framework.Scenes
517 m_scene.CrossPrimGroupIntoNewRegion(val, this, true); 517 m_scene.CrossPrimGroupIntoNewRegion(val, this, true);
518 518
519 // Normalize 519 // Normalize
520 if (val.X >= Constants.RegionSize) 520 if (val.X >= m_scene.RegionInfo.RegionSizeX)
521 val.X -= Constants.RegionSize; 521 val.X -= m_scene.RegionInfo.RegionSizeX;
522 if (val.Y >= Constants.RegionSize) 522 if (val.Y >= m_scene.RegionInfo.RegionSizeY)
523 val.Y -= Constants.RegionSize; 523 val.Y -= m_scene.RegionInfo.RegionSizeY;
524 if (val.X < 0) 524 if (val.X < 0)
525 val.X += Constants.RegionSize; 525 val.X += m_scene.RegionInfo.RegionSizeX;
526 if (val.Y < 0) 526 if (val.Y < 0)
527 val.Y += Constants.RegionSize; 527 val.Y += m_scene.RegionInfo.RegionSizeY;
528 528
529 // If it's deleted, crossing was successful 529 // If it's deleted, crossing was successful
530 if (IsDeleted) 530 if (IsDeleted)
@@ -572,9 +572,9 @@ namespace OpenSim.Region.Framework.Scenes
572 } 572 }
573 } 573 }
574 Vector3 oldp = AbsolutePosition; 574 Vector3 oldp = AbsolutePosition;
575 val.X = Util.Clamp<float>(oldp.X, 0.5f, (float)Constants.RegionSize - 0.5f); 575 val.X = Util.Clamp<float>(oldp.X, 0.5f, (float)m_scene.RegionInfo.RegionSizeX - 0.5f);
576 val.Y = Util.Clamp<float>(oldp.Y, 0.5f, (float)Constants.RegionSize - 0.5f); 576 val.Y = Util.Clamp<float>(oldp.Y, 0.5f, (float)m_scene.RegionInfo.RegionSizeY - 0.5f);
577 val.Z = Util.Clamp<float>(oldp.Z, 0.5f, 4096.0f); 577 val.Z = Util.Clamp<float>(oldp.Z, 0.5f, Constants.RegionHeight);
578 } 578 }
579 } 579 }
580 580