From 932a1321167814ab13a21121a9b9a8bf2eca1641 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 20 Feb 2008 00:08:04 +0000 Subject: * Made a quickupdate method to run through only entities that have scheduled themselves for updates looking for changes. This runs 10 times a second. * Set the massively slow UpdateEntities method to run every 2 seconds instead of 10 times a second. This method runs through *all* of the entities can calls the virtual update(). * Documented some of the code in the scene.Update method. --- OpenSim/Region/Environment/Scenes/InnerScene.cs | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs') diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs index 57b8ae7..38bcb03 100644 --- a/OpenSim/Region/Environment/Scenes/InnerScene.cs +++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs @@ -62,6 +62,7 @@ namespace OpenSim.Region.Environment.Scenes protected RegionInfo m_regInfo; protected Scene m_parentScene; protected PermissionManager PermissionsMngr; + protected List m_updateList = new List(); protected int m_numRootAgents = 0; protected int m_numPrim = 0; protected int m_numChildAgents = 0; @@ -146,6 +147,15 @@ namespace OpenSim.Region.Environment.Scenes } } + internal void UpdatePresences() + { + List updateScenePresences = GetScenePresences(); + foreach (ScenePresence pres in updateScenePresences) + { + pres.Update(); + } + } + internal float UpdatePhysics(double elapsed) { lock (m_syncRoot) @@ -194,6 +204,29 @@ namespace OpenSim.Region.Environment.Scenes } } + internal void AddToUpdateList(EntityBase obj) + { + lock (m_updateList) + { + if (!m_updateList.Contains(obj)) + { + m_updateList.Add(obj); + } + } + } + + internal void ProcessUpdates() + { + lock (m_updateList) + { + for (int i = 0; i < m_updateList.Count; i++) + { + m_updateList[i].Update(); + } + m_updateList.Clear(); + } + } + public void AddPhysicalPrim(int number) { m_physicalPrim++; -- cgit v1.1