aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneGraph.cs
diff options
context:
space:
mode:
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 5902080..673674d 100644
--- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs
@@ -206,6 +206,43 @@ namespace OpenSim.Region.Framework.Scenes
206 }); 206 });
207 } 207 }
208 208
209 public void GetCoarseLocations(out List<Vector3> coarseLocations, out List<UUID> avatarUUIDs, uint maxLocations)
210 {
211 coarseLocations = new List<Vector3>();
212 avatarUUIDs = new List<UUID>();
213
214 List<ScenePresence> presences = GetScenePresences();
215 for (int i = 0; i < Math.Min(presences.Count, maxLocations); ++i)
216 {
217 ScenePresence sp = presences[i];
218 // If this presence is a child agent, we don't want its coarse locations
219 if (sp.IsChildAgent)
220 return;
221
222 if (sp.ParentID != 0)
223 {
224 // sitting avatar
225 SceneObjectPart sop = m_parentScene.GetSceneObjectPart(sp.ParentID);
226 if (sop != null)
227 {
228 coarseLocations.Add(sop.AbsolutePosition + sp.AbsolutePosition);
229 avatarUUIDs.Add(sp.UUID);
230 }
231 else
232 {
233 // we can't find the parent.. ! arg!
234 coarseLocations.Add(sp.AbsolutePosition);
235 avatarUUIDs.Add(sp.UUID);
236 }
237 }
238 else
239 {
240 coarseLocations.Add(sp.AbsolutePosition);
241 avatarUUIDs.Add(sp.UUID);
242 }
243 }
244 }
245
209 #endregion 246 #endregion
210 247
211 #region Entity Methods 248 #region Entity Methods