mirror of
https://github.com/opensim/opensim.git
synced 2026-06-29 18:55:37 +08:00
Cleaned up access to scenepresences in scenegraph. GetScenePresences and GetAvatars have been removed to consolidate locking and iteration within SceneGraph. All callers which used these to then iterate over presences have been refactored to instead pass their delegates to Scene.ForEachScenePresence(Action<ScenePresence>).
This commit is contained in:
@@ -88,12 +88,12 @@ namespace OpenSim.Region.Examples.SimpleModule
|
||||
m_scene.AgentCrossing(m_character.AgentId, Vector3.Zero, false);
|
||||
}
|
||||
|
||||
List<ScenePresence> avatars = m_scene.GetAvatars();
|
||||
foreach (ScenePresence avatar in avatars)
|
||||
m_scene.ForEachScenePresence(delegate(ScenePresence sp)
|
||||
{
|
||||
avatar.AbsolutePosition =
|
||||
new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
|
||||
}
|
||||
if (!sp.IsChildAgent)
|
||||
sp.AbsolutePosition =
|
||||
new Vector3((float)Util.RandomClass.Next(100, 200), (float)Util.RandomClass.Next(30, 200), 2);
|
||||
});
|
||||
}
|
||||
|
||||
// private void AddComplexObjects(RegionInfo regionInfo, Vector3 pos)
|
||||
|
||||
Reference in New Issue
Block a user