aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Framework/Util.cs
diff options
context:
space:
mode:
authorMelanie2011-02-24 02:37:21 +0000
committerMelanie2011-02-24 02:37:21 +0000
commit9be1d2aef1dff06a7bfdb8da38dd6317bf5b0bb7 (patch)
tree0cf76dba6e5b7255a3d3168c1eec228def3a205f /OpenSim/Framework/Util.cs
parentMerge branch 'careminster-presence-refactor' of ssh://3dhosting.de/var/git/ca... (diff)
parentOn a Grid Handler exception, explicitly log the exception message and stack t... (diff)
downloadopensim-SC-9be1d2aef1dff06a7bfdb8da38dd6317bf5b0bb7.zip
opensim-SC-9be1d2aef1dff06a7bfdb8da38dd6317bf5b0bb7.tar.gz
opensim-SC-9be1d2aef1dff06a7bfdb8da38dd6317bf5b0bb7.tar.bz2
opensim-SC-9be1d2aef1dff06a7bfdb8da38dd6317bf5b0bb7.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to '')
-rw-r--r--OpenSim/Framework/Util.cs13
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs
index 821f1a0..3f676f9 100644
--- a/OpenSim/Framework/Util.cs
+++ b/OpenSim/Framework/Util.cs
@@ -471,10 +471,17 @@ namespace OpenSim.Framework
471 /// <param name="oldy">Old region y-coord</param> 471 /// <param name="oldy">Old region y-coord</param>
472 /// <param name="newy">New region y-coord</param> 472 /// <param name="newy">New region y-coord</param>
473 /// <returns></returns> 473 /// <returns></returns>
474 public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy) 474 public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy)
475 { 475 {
476 // Eventually this will be a function of the draw distance / camera position too. 476 int dd = (int)((drawdist + Constants.RegionSize - 1) / Constants.RegionSize);
477 return (((int)Math.Abs((int)(oldx - newx)) > 1) || ((int)Math.Abs((int)(oldy - newy)) > 1)); 477
478 int startX = (int)oldx - dd;
479 int startY = (int)oldy - dd;
480
481 int endX = (int)oldx + dd;
482 int endY = (int)oldy + dd;
483
484 return (newx < startX || endX < newx || newy < startY || endY < newy);
478 } 485 }
479 486
480 public static string FieldToString(byte[] bytes) 487 public static string FieldToString(byte[] bytes)