aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorUbitUmarov2015-08-30 19:17:35 +0100
committerUbitUmarov2015-08-30 19:17:35 +0100
commit0edffae7e42c0705303e015036fa85687508ecf0 (patch)
treeba27f1567c7c351e4befd032b948fb3423fa0ca4 /OpenSim/Framework/Util.cs
parent cache in memory water texture (diff)
downloadopensim-SC-0edffae7e42c0705303e015036fa85687508ecf0.zip
opensim-SC-0edffae7e42c0705303e015036fa85687508ecf0.tar.gz
opensim-SC-0edffae7e42c0705303e015036fa85687508ecf0.tar.bz2
opensim-SC-0edffae7e42c0705303e015036fa85687508ecf0.tar.xz
more on tps and crossings
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r--OpenSim/Framework/Util.cs23
1 files changed, 16 insertions, 7 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index d807e2a..5f4ab06 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -675,17 +675,26 @@ namespace OpenSim.Framework
675 /// <param name="oldy">Old region y-coord</param> 675 /// <param name="oldy">Old region y-coord</param>
676 /// <param name="newy">New region y-coord</param> 676 /// <param name="newy">New region y-coord</param>
677 /// <returns></returns> 677 /// <returns></returns>
678 public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy) 678 public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy,
679 int oldsizex, int oldsizey, int newsizex, int newsizey)
679 { 680 {
680 int dd = (int)((drawdist + Constants.RegionSize - 1) / Constants.RegionSize); 681 // we still need to make sure we see new region 1stNeighbors
681 682
682 int startX = (int)oldx - dd; 683 oldx *= Constants.RegionSize;
683 int startY = (int)oldy - dd; 684 newx *= Constants.RegionSize;
685 if (oldx + oldsizex + drawdist < newx)
686 return true;
687 if (newx + newsizex + drawdist < oldx)
688 return true;
684 689
685 int endX = (int)oldx + dd; 690 oldy *= Constants.RegionSize;
686 int endY = (int)oldy + dd; 691 newy *= Constants.RegionSize;
692 if (oldy + oldsizey + drawdist < newy)
693 return true;
694 if (newy + newsizey + drawdist< oldy)
695 return true;
687 696
688 return (newx < startX || endX < newx || newy < startY || endY < newy); 697 return false;
689 } 698 }
690 699
691 public static string FieldToString(byte[] bytes) 700 public static string FieldToString(byte[] bytes)