mirror of
https://github.com/opensim/opensim.git
synced 2026-08-04 08:06:27 +08:00
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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user