From beeec1c46726a266edf5c8260f9cf4e4e6f91c8a Mon Sep 17 00:00:00 2001 From: Robert Adams Date: Fri, 8 Nov 2013 20:53:37 -0800 Subject: 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. --- OpenSim/Services/Interfaces/IGridService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Services/Interfaces/IGridService.cs') diff --git a/OpenSim/Services/Interfaces/IGridService.cs b/OpenSim/Services/Interfaces/IGridService.cs index a830f17..e1a3cef 100644 --- a/OpenSim/Services/Interfaces/IGridService.cs +++ b/OpenSim/Services/Interfaces/IGridService.cs @@ -168,12 +168,12 @@ namespace OpenSim.Services.Interfaces /// /// The co-ordinate of this region. /// - public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } } + public int RegionCoordX { get { return (int)Util.WorldToRegionLoc((uint)RegionLocX); } } /// /// The co-ordinate of this region /// - public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } } + public int RegionCoordY { get { return (int)Util.WorldToRegionLoc((uint)RegionLocY); } } /// /// 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; } -- cgit v1.1