diff options
author | Mic Bowman | 2011-02-22 13:23:54 -0800 |
---|---|---|
committer | Mic Bowman | 2011-02-22 13:23:54 -0800 |
commit | 5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d (patch) | |
tree | 0021a13a22e089fd373619f3f636199fb636ce95 /OpenSim/Framework/Util.cs | |
parent | GetRegion(s)ByName with SQLite behaves like it does with other databases. (diff) | |
download | opensim-SC_OLD-5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d.zip opensim-SC_OLD-5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d.tar.gz opensim-SC_OLD-5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d.tar.bz2 opensim-SC_OLD-5a16fa882c0f1a6200bc3fdb63b0f4564acf0e6d.tar.xz |
Parameterizes the view distance used to compute and manage
child agents in neighbor regions. This means you can extend
the view on a simulator beyond the default 3x3 regions.
This uses a region default draw distance and should be
replaced at some point by the avatar specified draw distance.
That will require more careful, dynamic recomputation of child
agents every time the draw distance changes.
WARNING: this is experimental and has known instabilities. specifically
all regions "within site" should be running the same default draw distance
or agents will not be closed correctly.
Diffstat (limited to 'OpenSim/Framework/Util.cs')
-rw-r--r-- | OpenSim/Framework/Util.cs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/OpenSim/Framework/Util.cs b/OpenSim/Framework/Util.cs index 533e53a..5a5046e 100644 --- a/OpenSim/Framework/Util.cs +++ b/OpenSim/Framework/Util.cs | |||
@@ -459,10 +459,17 @@ namespace OpenSim.Framework | |||
459 | /// <param name="oldy">Old region y-coord</param> | 459 | /// <param name="oldy">Old region y-coord</param> |
460 | /// <param name="newy">New region y-coord</param> | 460 | /// <param name="newy">New region y-coord</param> |
461 | /// <returns></returns> | 461 | /// <returns></returns> |
462 | public static bool IsOutsideView(uint oldx, uint newx, uint oldy, uint newy) | 462 | public static bool IsOutsideView(float drawdist, uint oldx, uint newx, uint oldy, uint newy) |
463 | { | 463 | { |
464 | // Eventually this will be a function of the draw distance / camera position too. | 464 | int dd = (int)((drawdist + Constants.RegionSize - 1) / Constants.RegionSize); |
465 | return (((int)Math.Abs((int)(oldx - newx)) > 1) || ((int)Math.Abs((int)(oldy - newy)) > 1)); | 465 | |
466 | int startX = (int)oldx - dd; | ||
467 | int startY = (int)oldy - dd; | ||
468 | |||
469 | int endX = (int)oldx + dd; | ||
470 | int endY = (int)oldy + dd; | ||
471 | |||
472 | return (newx < startX || endX < newx || newy < startY || endY < newy); | ||
466 | } | 473 | } |
467 | 474 | ||
468 | public static string FieldToString(byte[] bytes) | 475 | public static string FieldToString(byte[] bytes) |