diff options
author | Robert Adams | 2013-11-08 20:53:37 -0800 |
---|---|---|
committer | Robert Adams | 2013-11-08 20:53:37 -0800 |
commit | beeec1c46726a266edf5c8260f9cf4e4e6f91c8a (patch) | |
tree | ac749f4db4d4ee640bf9091b9684d2a36eedb284 /OpenSim/Services | |
parent | varregion: Massive work to LandManagementModule and LandObject to (diff) | |
download | opensim-SC-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.zip opensim-SC-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.tar.gz opensim-SC-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.tar.bz2 opensim-SC-beeec1c46726a266edf5c8260f9cf4e4e6f91c8a.tar.xz |
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.
Diffstat (limited to 'OpenSim/Services')
-rw-r--r-- | OpenSim/Services/Interfaces/IGridService.cs | 8 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginResponse.cs | 25 | ||||
-rw-r--r-- | OpenSim/Services/LLLoginService/LLLoginService.cs | 2 |
3 files changed, 25 insertions, 10 deletions
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 | |||
168 | /// <summary> | 168 | /// <summary> |
169 | /// The co-ordinate of this region. | 169 | /// The co-ordinate of this region. |
170 | /// </summary> | 170 | /// </summary> |
171 | public int RegionCoordX { get { return RegionLocX / (int)Constants.RegionSize; } } | 171 | public int RegionCoordX { get { return (int)Util.WorldToRegionLoc((uint)RegionLocX); } } |
172 | 172 | ||
173 | /// <summary> | 173 | /// <summary> |
174 | /// The co-ordinate of this region | 174 | /// The co-ordinate of this region |
175 | /// </summary> | 175 | /// </summary> |
176 | public int RegionCoordY { get { return RegionLocY / (int)Constants.RegionSize; } } | 176 | public int RegionCoordY { get { return (int)Util.WorldToRegionLoc((uint)RegionLocY); } } |
177 | 177 | ||
178 | /// <summary> | 178 | /// <summary> |
179 | /// The location of this region in meters. | 179 | /// The location of this region in meters. |
@@ -246,8 +246,8 @@ namespace OpenSim.Services.Interfaces | |||
246 | 246 | ||
247 | public GridRegion(uint xcell, uint ycell) | 247 | public GridRegion(uint xcell, uint ycell) |
248 | { | 248 | { |
249 | m_regionLocX = (int)(xcell * Constants.RegionSize); | 249 | m_regionLocX = (int)Util.RegionToWorldLoc(xcell); |
250 | m_regionLocY = (int)(ycell * Constants.RegionSize); | 250 | m_regionLocY = (int)Util.RegionToWorldLoc(ycell); |
251 | RegionSizeX = (int)Constants.RegionSize; | 251 | RegionSizeX = (int)Constants.RegionSize; |
252 | RegionSizeY = (int)Constants.RegionSize; | 252 | RegionSizeY = (int)Constants.RegionSize; |
253 | } | 253 | } |
diff --git a/OpenSim/Services/LLLoginService/LLLoginResponse.cs b/OpenSim/Services/LLLoginService/LLLoginResponse.cs index f96480c..ff51f09 100644 --- a/OpenSim/Services/LLLoginService/LLLoginResponse.cs +++ b/OpenSim/Services/LLLoginService/LLLoginResponse.cs | |||
@@ -362,7 +362,9 @@ namespace OpenSim.Services.LLLoginService | |||
362 | 362 | ||
363 | private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) | 363 | private void FillOutHomeData(GridUserInfo pinfo, GridRegion home) |
364 | { | 364 | { |
365 | int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; | 365 | // int x = 1000 * (int)Constants.RegionSize, y = 1000 * (int)Constants.RegionSize; |
366 | int x = (int)Util.RegionToWorldLoc(1000); | ||
367 | int y = (int)Util.RegionToWorldLoc(1000); | ||
366 | if (home != null) | 368 | if (home != null) |
367 | { | 369 | { |
368 | x = home.RegionLocX; | 370 | x = home.RegionLocX; |
@@ -436,10 +438,23 @@ namespace OpenSim.Services.LLLoginService | |||
436 | ErrorReason = "key"; | 438 | ErrorReason = "key"; |
437 | welcomeMessage = "Welcome to OpenSim!"; | 439 | welcomeMessage = "Welcome to OpenSim!"; |
438 | seedCapability = String.Empty; | 440 | seedCapability = String.Empty; |
439 | home = "{'region_handle':[r" + (1000*Constants.RegionSize).ToString() + ",r" + (1000*Constants.RegionSize).ToString() + "], 'position':[r" + | 441 | home = "{'region_handle':[r" |
440 | userProfile.homepos.X.ToString() + ",r" + userProfile.homepos.Y.ToString() + ",r" + | 442 | + Util.RegionToWorldLoc(1000).ToString() |
441 | userProfile.homepos.Z.ToString() + "], 'look_at':[r" + userProfile.homelookat.X.ToString() + ",r" + | 443 | + ",r" |
442 | userProfile.homelookat.Y.ToString() + ",r" + userProfile.homelookat.Z.ToString() + "]}"; | 444 | + Util.RegionToWorldLoc(1000).ToString() |
445 | + "], 'position':[r" | ||
446 | + userProfile.homepos.X.ToString() | ||
447 | + ",r" | ||
448 | + userProfile.homepos.Y.ToString() | ||
449 | + ",r" | ||
450 | + userProfile.homepos.Z.ToString() | ||
451 | + "], 'look_at':[r" | ||
452 | + userProfile.homelookat.X.ToString() | ||
453 | + ",r" | ||
454 | + userProfile.homelookat.Y.ToString() | ||
455 | + ",r" | ||
456 | + userProfile.homelookat.Z.ToString() | ||
457 | + "]}"; | ||
443 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; | 458 | lookAt = "[r0.99949799999999999756,r0.03166859999999999814,r0]"; |
444 | RegionX = (uint) 255232; | 459 | RegionX = (uint) 255232; |
445 | RegionY = (uint) 254976; | 460 | RegionY = (uint) 254976; |
diff --git a/OpenSim/Services/LLLoginService/LLLoginService.cs b/OpenSim/Services/LLLoginService/LLLoginService.cs index e2f9966..150c2c0 100644 --- a/OpenSim/Services/LLLoginService/LLLoginService.cs +++ b/OpenSim/Services/LLLoginService/LLLoginService.cs | |||
@@ -684,7 +684,7 @@ namespace OpenSim.Services.LLLoginService | |||
684 | private GridRegion FindAlternativeRegion(UUID scopeID) | 684 | private GridRegion FindAlternativeRegion(UUID scopeID) |
685 | { | 685 | { |
686 | List<GridRegion> hyperlinks = null; | 686 | List<GridRegion> hyperlinks = null; |
687 | List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, 1000 * (int)Constants.RegionSize, 1000 * (int)Constants.RegionSize); | 687 | List<GridRegion> regions = m_GridService.GetFallbackRegions(scopeID, (int)Util.RegionToWorldLoc(1000), (int)Util.RegionToWorldLoc(1000)); |
688 | if (regions != null && regions.Count > 0) | 688 | if (regions != null && regions.Count > 0) |
689 | { | 689 | { |
690 | hyperlinks = m_GridService.GetHyperlinks(scopeID); | 690 | hyperlinks = m_GridService.GetHyperlinks(scopeID); |