varregion: elimination of Constants.RegionSize from all over OpenSimulator.

Routines in Util to compute region world coordinates from region coordinates
as well as the conversion to and from region handles. These routines have
replaced a lot of math scattered throughout the simulator.
Should be no functional changes.
This commit is contained in:
Robert Adams
2013-11-08 20:53:37 -08:00
parent a7a837550e
commit beeec1c467
24 changed files with 156 additions and 90 deletions

View File

@@ -168,12 +168,12 @@ namespace OpenSim.Services.Interfaces
/// <summary>
/// The co-ordinate of this region.
/// </summary>
public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } }
public int RegionCoordX { get { return (int)Util.WorldToRegionLoc((uint)RegionLocX); } }
/// <summary>
/// The co-ordinate of this region
/// </summary>
public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } }
public int RegionCoordY { get { return (int)Util.WorldToRegionLoc((uint)RegionLocY); } }
/// <summary>
/// The location of this region in meters.
@@ -246,8 +246,8 @@ namespace OpenSim.Services.Interfaces
public GridRegion(uint xcell, uint ycell)
{
m_regionLocX = (int)(xcell * Constants.RegionSize);
m_regionLocY = (int)(ycell * Constants.RegionSize);
m_regionLocX = (int)Util.RegionToWorldLoc(xcell);
m_regionLocY = (int)Util.RegionToWorldLoc(ycell);
RegionSizeX = (int)Constants.RegionSize;
RegionSizeY = (int)Constants.RegionSize;
}