aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2016-07-03 15:47:20 +0100
committerUbitUmarov2016-07-03 15:47:20 +0100
commit42dd02fc321a52179dda89a49d4bee2e9c18be45 (patch)
treec8de5bff6f489209278c4b02826dec44559f9aaa /OpenSim
parenttry to place avatars on a nicer location, when they arrive into a banned parcel (diff)
downloadopensim-SC_OLD-42dd02fc321a52179dda89a49d4bee2e9c18be45.zip
opensim-SC_OLD-42dd02fc321a52179dda89a49d4bee2e9c18be45.tar.gz
opensim-SC_OLD-42dd02fc321a52179dda89a49d4bee2e9c18be45.tar.bz2
opensim-SC_OLD-42dd02fc321a52179dda89a49d4bee2e9c18be45.tar.xz
scale down position X and Y acording to region size on sending coarse Updates. Viewers need to scale up by same amount.
Diffstat (limited to 'OpenSim')
-rwxr-xr-xOpenSim/Region/Framework/Scenes/SceneGraph.cs19
1 files changed, 17 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index f9f795f..90ee1d1 100755
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -242,6 +242,19 @@ namespace OpenSim.Region.Framework.Scenes
242 coarseLocations = new List<Vector3>(); 242 coarseLocations = new List<Vector3>();
243 avatarUUIDs = new List<UUID>(); 243 avatarUUIDs = new List<UUID>();
244 244
245 // coarse locations are sent as BYTE, so limited to the 255m max of normal regions
246 // try to work around that scale down X and Y acording to region size, so reducing the resolution
247 //
248 // viewers need to scale up
249 float scaleX = m_parentScene.RegionInfo.RegionSizeX / Constants.RegionSize;
250 if (scaleX == 0)
251 scaleX = 1.0f;
252 scaleX = 1.0f / scaleX;
253 float scaleY = m_parentScene.RegionInfo.RegionSizeY / Constants.RegionSize;
254 if (scaleY == 0)
255 scaleY = 1.0f;
256 scaleY = 1.0f / scaleY;
257
245 List<ScenePresence> presences = GetScenePresences(); 258 List<ScenePresence> presences = GetScenePresences();
246 for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i) 259 for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i)
247 { 260 {
@@ -250,9 +263,11 @@ namespace OpenSim.Region.Framework.Scenes
250 // If this presence is a child agent, we don't want its coarse locations 263 // If this presence is a child agent, we don't want its coarse locations
251 if (sp.IsChildAgent) 264 if (sp.IsChildAgent)
252 continue; 265 continue;
266 Vector3 pos = sp.AbsolutePosition;
267 pos.X *= scaleX;
268 pos.Y *= scaleY;
253 269
254 coarseLocations.Add(sp.AbsolutePosition); 270 coarseLocations.Add(pos);
255
256 avatarUUIDs.Add(sp.UUID); 271 avatarUUIDs.Add(sp.UUID);
257 } 272 }
258 } 273 }