本文整理汇总了C#中OpenSim.Region.Framework.Scenes.Scene.GetAvatars方法的典型用法代码示例。如果您正苦于以下问题:C# Scene.GetAvatars方法的具体用法?C# Scene.GetAvatars怎么用?C# Scene.GetAvatars使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.Scene
的用法示例。
在下文中一共展示了Scene.GetAvatars方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CollectCoarseLocations
public static void CollectCoarseLocations(Scene scene, out List<Vector3> CoarseLocations, out List<UUID> AvatarUUIDs)
{
CoarseLocations = new List<Vector3>();
AvatarUUIDs = new List<UUID>();
lock (scene.SyncRoot)
{
List<ScenePresence> avatars = scene.GetAvatars();
foreach (ScenePresence avatar in avatars)
{
lock (avatar.m_posInfo)
{
if (avatar.IsInTransit || avatar.IsDeleted)
continue;
SceneObjectPart sop = avatar.m_posInfo.Parent;
if (sop != null) // is seated?
if (sop.ParentGroup.InTransit) // and in transit
continue; // skip this one since we don't have a reliable position
CoarseLocations.Add(avatar.AbsolutePosition);
}
AvatarUUIDs.Add(avatar.UUID);
}
}
}
示例2: RegionStats
protected string RegionStats(OSHttpResponse httpResponse, Scene scene)
{
int users = scene.GetAvatars().Count;
int objects = scene.Entities.Count - users;
RestXmlWriter rxw = new RestXmlWriter(new StringWriter());
rxw.WriteStartElement(String.Empty, "region", String.Empty);
rxw.WriteStartElement(String.Empty, "stats", String.Empty);
rxw.WriteStartElement(String.Empty, "users", String.Empty);
rxw.WriteString(users.ToString());
rxw.WriteEndElement();
rxw.WriteStartElement(String.Empty, "objects", String.Empty);
rxw.WriteString(objects.ToString());
rxw.WriteEndElement();
rxw.WriteEndDocument();
return rxw.ToString();
}