diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 36 |
1 files changed, 20 insertions, 16 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ec209ed..d1d82d6 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -337,22 +337,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
337 | BordersLocked = true; | 337 | BordersLocked = true; |
338 | 338 | ||
339 | Border northBorder = new Border(); | 339 | Border northBorder = new Border(); |
340 | northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize + 1); //<--- | 340 | northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<--- |
341 | northBorder.CrossDirection = Cardinals.N; | 341 | northBorder.CrossDirection = Cardinals.N; |
342 | NorthBorders.Add(northBorder); | 342 | NorthBorders.Add(northBorder); |
343 | 343 | ||
344 | Border southBorder = new Border(); | 344 | Border southBorder = new Border(); |
345 | southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, -1); //---> | 345 | southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> |
346 | southBorder.CrossDirection = Cardinals.S; | 346 | southBorder.CrossDirection = Cardinals.S; |
347 | SouthBorders.Add(southBorder); | 347 | SouthBorders.Add(southBorder); |
348 | 348 | ||
349 | Border eastBorder = new Border(); | 349 | Border eastBorder = new Border(); |
350 | eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize + 1); //<--- | 350 | eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<--- |
351 | eastBorder.CrossDirection = Cardinals.E; | 351 | eastBorder.CrossDirection = Cardinals.E; |
352 | EastBorders.Add(eastBorder); | 352 | EastBorders.Add(eastBorder); |
353 | 353 | ||
354 | Border westBorder = new Border(); | 354 | Border westBorder = new Border(); |
355 | westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, -1); //---> | 355 | westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, 0); //---> |
356 | westBorder.CrossDirection = Cardinals.W; | 356 | westBorder.CrossDirection = Cardinals.W; |
357 | WestBorders.Add(westBorder); | 357 | WestBorders.Add(westBorder); |
358 | 358 | ||
@@ -489,22 +489,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
489 | { | 489 | { |
490 | BordersLocked = true; | 490 | BordersLocked = true; |
491 | Border northBorder = new Border(); | 491 | Border northBorder = new Border(); |
492 | northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize + 1); //<--- | 492 | northBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize); //<--- |
493 | northBorder.CrossDirection = Cardinals.N; | 493 | northBorder.CrossDirection = Cardinals.N; |
494 | NorthBorders.Add(northBorder); | 494 | NorthBorders.Add(northBorder); |
495 | 495 | ||
496 | Border southBorder = new Border(); | 496 | Border southBorder = new Border(); |
497 | southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, -1); //---> | 497 | southBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue,0); //---> |
498 | southBorder.CrossDirection = Cardinals.S; | 498 | southBorder.CrossDirection = Cardinals.S; |
499 | SouthBorders.Add(southBorder); | 499 | SouthBorders.Add(southBorder); |
500 | 500 | ||
501 | Border eastBorder = new Border(); | 501 | Border eastBorder = new Border(); |
502 | eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize + 1); //<--- | 502 | eastBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, (int)Constants.RegionSize ); //<--- |
503 | eastBorder.CrossDirection = Cardinals.E; | 503 | eastBorder.CrossDirection = Cardinals.E; |
504 | EastBorders.Add(eastBorder); | 504 | EastBorders.Add(eastBorder); |
505 | 505 | ||
506 | Border westBorder = new Border(); | 506 | Border westBorder = new Border(); |
507 | westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue, -1); //---> | 507 | westBorder.BorderLine = new Vector3(float.MinValue, float.MaxValue,0); //---> |
508 | westBorder.CrossDirection = Cardinals.W; | 508 | westBorder.CrossDirection = Cardinals.W; |
509 | WestBorders.Add(westBorder); | 509 | WestBorders.Add(westBorder); |
510 | BordersLocked = false; | 510 | BordersLocked = false; |
@@ -1709,6 +1709,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1709 | 1709 | ||
1710 | int thisx = (int)RegionInfo.RegionLocX; | 1710 | int thisx = (int)RegionInfo.RegionLocX; |
1711 | int thisy = (int)RegionInfo.RegionLocY; | 1711 | int thisy = (int)RegionInfo.RegionLocY; |
1712 | Vector3 EastCross = new Vector3(0.1f,0,0); | ||
1713 | Vector3 WestCross = new Vector3(-0.1f, 0, 0); | ||
1714 | Vector3 NorthCross = new Vector3(0, 0.1f, 0); | ||
1715 | Vector3 SouthCross = new Vector3(0, -0.1f, 0); | ||
1712 | 1716 | ||
1713 | 1717 | ||
1714 | // use this if no borders were crossed! | 1718 | // use this if no borders were crossed! |
@@ -1718,9 +1722,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1718 | 1722 | ||
1719 | Vector3 pos = attemptedPosition; | 1723 | Vector3 pos = attemptedPosition; |
1720 | 1724 | ||
1721 | if (TestBorderCross(attemptedPosition, Cardinals.W)) | 1725 | if (TestBorderCross(attemptedPosition + WestCross, Cardinals.W)) |
1722 | { | 1726 | { |
1723 | if (TestBorderCross(attemptedPosition, Cardinals.S)) | 1727 | if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) |
1724 | { | 1728 | { |
1725 | //Border crossedBorderx = GetCrossedBorder(attemptedPosition,Cardinals.W); | 1729 | //Border crossedBorderx = GetCrossedBorder(attemptedPosition,Cardinals.W); |
1726 | //Border crossedBordery = GetCrossedBorder(attemptedPosition, Cardinals.S); | 1730 | //Border crossedBordery = GetCrossedBorder(attemptedPosition, Cardinals.S); |
@@ -1733,7 +1737,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1733 | // x - 1 | 1737 | // x - 1 |
1734 | // y - 1 | 1738 | // y - 1 |
1735 | } | 1739 | } |
1736 | else if (TestBorderCross(attemptedPosition, Cardinals.N)) | 1740 | else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) |
1737 | { | 1741 | { |
1738 | pos.X = ((pos.X + Constants.RegionSize)); | 1742 | pos.X = ((pos.X + Constants.RegionSize)); |
1739 | pos.Y = ((pos.Y - Constants.RegionSize)); | 1743 | pos.Y = ((pos.Y - Constants.RegionSize)); |
@@ -1752,9 +1756,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1752 | // x - 1 | 1756 | // x - 1 |
1753 | } | 1757 | } |
1754 | } | 1758 | } |
1755 | else if (TestBorderCross(attemptedPosition, Cardinals.E)) | 1759 | else if (TestBorderCross(attemptedPosition + EastCross, Cardinals.E)) |
1756 | { | 1760 | { |
1757 | if (TestBorderCross(attemptedPosition, Cardinals.S)) | 1761 | if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) |
1758 | { | 1762 | { |
1759 | pos.X = ((pos.X - Constants.RegionSize)); | 1763 | pos.X = ((pos.X - Constants.RegionSize)); |
1760 | pos.Y = ((pos.Y + Constants.RegionSize)); | 1764 | pos.Y = ((pos.Y + Constants.RegionSize)); |
@@ -1764,7 +1768,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1764 | // x + 1 | 1768 | // x + 1 |
1765 | // y - 1 | 1769 | // y - 1 |
1766 | } | 1770 | } |
1767 | else if (TestBorderCross(attemptedPosition, Cardinals.N)) | 1771 | else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) |
1768 | { | 1772 | { |
1769 | pos.X = ((pos.X - Constants.RegionSize)); | 1773 | pos.X = ((pos.X - Constants.RegionSize)); |
1770 | pos.Y = ((pos.Y - Constants.RegionSize)); | 1774 | pos.Y = ((pos.Y - Constants.RegionSize)); |
@@ -1783,14 +1787,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1783 | // x + 1 | 1787 | // x + 1 |
1784 | } | 1788 | } |
1785 | } | 1789 | } |
1786 | else if (TestBorderCross(attemptedPosition, Cardinals.S)) | 1790 | else if (TestBorderCross(attemptedPosition + SouthCross, Cardinals.S)) |
1787 | { | 1791 | { |
1788 | pos.Y = ((pos.Y + Constants.RegionSize)); | 1792 | pos.Y = ((pos.Y + Constants.RegionSize)); |
1789 | newRegionHandle | 1793 | newRegionHandle |
1790 | = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - 1) * Constants.RegionSize)); | 1794 | = Util.UIntsToLong((uint)(thisx * Constants.RegionSize), (uint)((thisy - 1) * Constants.RegionSize)); |
1791 | // y - 1 | 1795 | // y - 1 |
1792 | } | 1796 | } |
1793 | else if (TestBorderCross(attemptedPosition, Cardinals.N)) | 1797 | else if (TestBorderCross(attemptedPosition + NorthCross, Cardinals.N)) |
1794 | { | 1798 | { |
1795 | 1799 | ||
1796 | pos.Y = ((pos.Y - Constants.RegionSize)); | 1800 | pos.Y = ((pos.Y - Constants.RegionSize)); |