diff options
author | Adam Frisby | 2009-02-23 06:55:42 +0000 |
---|---|---|
committer | Adam Frisby | 2009-02-23 06:55:42 +0000 |
commit | c2f3ff872dd88b4382b41844a4faa632129d1760 (patch) | |
tree | 5a0b731bcdcff54b4a5dcaa65acc7a60310a0116 /OpenSim/Region/Framework | |
parent | Load default assets when AssetInventory starts. (diff) | |
download | opensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.zip opensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.tar.gz opensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.tar.bz2 opensim-SC-c2f3ff872dd88b4382b41844a4faa632129d1760.tar.xz |
* Performance Changes:
* Moves Entity Updates into a seperate thread, allowing for OpenSim to utilize a computers CPU more effectively in return for potentially greater user and prim capacity.
* Removes an expensive Sqrt call performed during Update on each object. This should lower CPU requirements for high-prim regions with physics enabled.
* MXP Changes: Centers the region around 0,0 for primitives instead of 128,128. Prim display should now look more correct for MXP viewers.
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 4 |
2 files changed, 17 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 2a3f068..8d81812 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -64,6 +64,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
64 | 64 | ||
65 | protected Timer m_restartWaitTimer = new Timer(); | 65 | protected Timer m_restartWaitTimer = new Timer(); |
66 | 66 | ||
67 | protected Thread m_updateEntitiesThread; | ||
68 | |||
67 | public SimStatsReporter StatsReporter; | 69 | public SimStatsReporter StatsReporter; |
68 | 70 | ||
69 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); | 71 | protected List<RegionInfo> m_regionRestartNotifyList = new List<RegionInfo>(); |
@@ -852,7 +854,19 @@ namespace OpenSim.Region.Framework.Scenes | |||
852 | otherMS = Environment.TickCount; | 854 | otherMS = Environment.TickCount; |
853 | // run through all entities looking for updates (slow) | 855 | // run through all entities looking for updates (slow) |
854 | if (m_frame % m_update_entities == 0) | 856 | if (m_frame % m_update_entities == 0) |
855 | m_sceneGraph.UpdateEntities(); | 857 | { |
858 | if (m_updateEntitiesThread == null) | ||
859 | { | ||
860 | m_updateEntitiesThread = new Thread(m_sceneGraph.UpdateEntities); | ||
861 | ThreadTracker.Add(m_updateEntitiesThread); | ||
862 | } | ||
863 | |||
864 | if(!m_updateEntitiesThread.IsAlive) | ||
865 | m_updateEntitiesThread.Start(); | ||
866 | |||
867 | //m_sceneGraph.UpdateEntities(); | ||
868 | } | ||
869 | |||
856 | 870 | ||
857 | // run through entities that have scheduled themselves for | 871 | // run through entities that have scheduled themselves for |
858 | // updates looking for updates(faster) | 872 | // updates looking for updates(faster) |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index d1aef1c..2ca0342 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | |||
@@ -1733,12 +1733,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
1733 | //return; | 1733 | //return; |
1734 | //} | 1734 | //} |
1735 | 1735 | ||
1736 | if ((Util.GetDistanceTo(lastPhysGroupPos, AbsolutePosition) > 0.02) && UsePhysics) | 1736 | if (Util.DistanceLessThan(lastPhysGroupPos, AbsolutePosition, 0.02) && UsePhysics) |
1737 | { | 1737 | { |
1738 | m_rootPart.UpdateFlag = 1; | 1738 | m_rootPart.UpdateFlag = 1; |
1739 | lastPhysGroupPos = AbsolutePosition; | 1739 | lastPhysGroupPos = AbsolutePosition; |
1740 | } | 1740 | } |
1741 | //foreach (SceneObjectPart part in m_parts.Values) | 1741 | //foreach (SceneObjectPart part in m_parts.Values) |
1742 | //{ | 1742 | //{ |
1743 | //if (part.UpdateFlag == 0) part.UpdateFlag = 1; | 1743 | //if (part.UpdateFlag == 0) part.UpdateFlag = 1; |
1744 | //} | 1744 | //} |