aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorDiva Canto2009-09-21 17:16:30 -0700
committerDiva Canto2009-09-21 17:16:30 -0700
commitae07b220c61cc92453c67e602907f0b3c8fcc707 (patch)
tree9eaf8edaa9a9315348a65ed928cfb26b5017d903
parentAdd the headers collection to the keysvals for HTT requests (diff)
downloadopensim-SC_OLD-ae07b220c61cc92453c67e602907f0b3c8fcc707.zip
opensim-SC_OLD-ae07b220c61cc92453c67e602907f0b3c8fcc707.tar.gz
opensim-SC_OLD-ae07b220c61cc92453c67e602907f0b3c8fcc707.tar.bz2
opensim-SC_OLD-ae07b220c61cc92453c67e602907f0b3c8fcc707.tar.xz
Changed position methods so that they assume the input params are in meters.
-rw-r--r--OpenSim/Services/GridService/GridService.cs15
1 files changed, 12 insertions, 3 deletions
diff --git a/OpenSim/Services/GridService/GridService.cs b/OpenSim/Services/GridService/GridService.cs
index 2229421..dd529f5 100644
--- a/OpenSim/Services/GridService/GridService.cs
+++ b/OpenSim/Services/GridService/GridService.cs
@@ -95,7 +95,9 @@ namespace OpenSim.Services.GridService
95 if (region != null) 95 if (region != null)
96 { 96 {
97 // Not really? Maybe? 97 // Not really? Maybe?
98 List<RegionData> rdatas = m_Database.Get(region.posX - 1, region.posY - 1, region.posX + 1, region.posY + 1, scopeID); 98 List<RegionData> rdatas = m_Database.Get(region.posX - (int)Constants.RegionSize, region.posY - (int)Constants.RegionSize,
99 region.posX + (int)Constants.RegionSize, region.posY + (int)Constants.RegionSize, scopeID);
100
99 foreach (RegionData rdata in rdatas) 101 foreach (RegionData rdata in rdatas)
100 rinfos.Add(RegionData2RegionInfo(rdata)); 102 rinfos.Add(RegionData2RegionInfo(rdata));
101 103
@@ -114,7 +116,9 @@ namespace OpenSim.Services.GridService
114 116
115 public SimpleRegionInfo GetRegionByPosition(UUID scopeID, int x, int y) 117 public SimpleRegionInfo GetRegionByPosition(UUID scopeID, int x, int y)
116 { 118 {
117 RegionData rdata = m_Database.Get(x, y, scopeID); 119 int snapX = (int)(x / Constants.RegionSize) * (int)Constants.RegionSize;
120 int snapY = (int)(y / Constants.RegionSize) * (int)Constants.RegionSize;
121 RegionData rdata = m_Database.Get(snapX, snapY, scopeID);
118 if (rdata != null) 122 if (rdata != null)
119 return RegionData2RegionInfo(rdata); 123 return RegionData2RegionInfo(rdata);
120 124
@@ -151,7 +155,12 @@ namespace OpenSim.Services.GridService
151 155
152 public List<SimpleRegionInfo> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax) 156 public List<SimpleRegionInfo> GetRegionRange(UUID scopeID, int xmin, int xmax, int ymin, int ymax)
153 { 157 {
154 List<RegionData> rdatas = m_Database.Get(xmin, ymin, xmax, ymax, scopeID); 158 int xminSnap = (int)(xmin / Constants.RegionSize) * (int)Constants.RegionSize;
159 int xmaxSnap = (int)(xmax / Constants.RegionSize) * (int)Constants.RegionSize;
160 int yminSnap = (int)(ymin / Constants.RegionSize) * (int)Constants.RegionSize;
161 int ymaxSnap = (int)(ymax / Constants.RegionSize) * (int)Constants.RegionSize;
162
163 List<RegionData> rdatas = m_Database.Get(xminSnap, yminSnap, xmaxSnap, ymaxSnap, scopeID);
155 List<SimpleRegionInfo> rinfos = new List<SimpleRegionInfo>(); 164 List<SimpleRegionInfo> rinfos = new List<SimpleRegionInfo>();
156 foreach (RegionData rdata in rdatas) 165 foreach (RegionData rdata in rdatas)
157 rinfos.Add(RegionData2RegionInfo(rdata)); 166 rinfos.Add(RegionData2RegionInfo(rdata));