aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
authorMelanie2010-06-09 16:48:37 +0100
committerMelanie2010-06-09 16:48:37 +0100
commit6b2d2413f7026c41e7abb55c72c583670cb6011d (patch)
tree6596f0132d36f74f2e57c9b1bd891d95eb0e5a33 /OpenSim/Region/Framework/Scenes/SceneGraph.cs
parentMerge branch 'master' into careminster-presence-refactor (diff)
parentAdd the BEGIN; I had missed (diff)
downloadopensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.zip
opensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.gz
opensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.bz2
opensim-SC_OLD-6b2d2413f7026c41e7abb55c72c583670cb6011d.tar.xz
Merge branch 'master' into careminster-presence-refactor
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneGraph.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneGraph.cs37
1 files changed, 37 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
index 1dab4df..80f9114 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -211,6 +211,43 @@ namespace OpenSim.Region.Framework.Scenes
211 }); 211 });
212 } 212 }
213 213
214 public void GetCoarseLocations(out List<Vector3> coarseLocations, out List<UUID> avatarUUIDs, uint maxLocations)
215 {
216 coarseLocations = new List<Vector3>();
217 avatarUUIDs = new List<UUID>();
218
219 List<ScenePresence> presences = GetScenePresences();
220 for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i)
221 {
222 ScenePresence sp = presences[i];
223 // If this presence is a child agent, we don't want its coarse locations
224 if (sp.IsChildAgent)
225 return;
226
227 if (sp.ParentID != 0)
228 {
229 // sitting avatar
230 SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
231 if (sop != null)
232 {
233 coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
234 avatarUUIDs.Add(sp.UUID);
235 }
236 else
237 {
238 // we can't find the parent.. ! arg!
239 coarseLocations.Add(sp.AbsolutePosition);
240 avatarUUIDs.Add(sp.UUID);
241 }
242 }
243 else
244 {
245 coarseLocations.Add(sp.AbsolutePosition);
246 avatarUUIDs.Add(sp.UUID);
247 }
248 }
249 }
250
214 #endregion 251 #endregion
215 252
216 #region Entity Methods 253 #region Entity Methods