From f32de6fe885915b11fd349c0d8f3e6a98d4dd2bf Mon Sep 17 00:00:00 2001 From: Melanie Date: Wed, 2 Sep 2009 03:33:31 +0100 Subject: Thank you, dslake, for a set of patches to improve OpenSim startup and idle performance. --- OpenSim/Region/Framework/Scenes/Scene.cs | 2 +- OpenSim/Region/Framework/Scenes/SceneGraph.cs | 4 ++-- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 7 +++---- OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 5 +++++ OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 5 +++++ OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 10 +++++----- 6 files changed, 21 insertions(+), 12 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 33afc40..ec209ed 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -998,7 +998,7 @@ namespace OpenSim.Region.Framework.Scenes physicsMS2 = Environment.TickCount - physicsMS2; if (m_frame % m_update_entitymovement == 0) - m_sceneGraph.UpdateEntityMovement(); + m_sceneGraph.UpdateScenePresenceMovement(); physicsMS = Environment.TickCount; if ((m_frame % m_update_physics == 0) && m_physics_enabled) diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 3007598..48dea07 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs @@ -198,9 +198,9 @@ namespace OpenSim.Region.Framework.Scenes } } - protected internal void UpdateEntityMovement() + protected internal void UpdateScenePresenceMovement() { - List moveEntities = GetEntities(); + List moveEntities = GetScenePresences(); foreach (EntityBase entity in moveEntities) { diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index d72ed7d..5be074e 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -1904,7 +1904,7 @@ namespace OpenSim.Region.Framework.Scenes //return; //} - if (Util.DistanceLessThan(lastPhysGroupPos, AbsolutePosition, 0.02) && UsePhysics) + if (UsePhysics && Util.DistanceLessThan(lastPhysGroupPos, AbsolutePosition, 0.02)) { m_rootPart.UpdateFlag = 1; lastPhysGroupPos = AbsolutePosition; @@ -1916,11 +1916,10 @@ namespace OpenSim.Region.Framework.Scenes checkAtTargets(); - if (((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) + if (UsePhysics && ((Math.Abs(lastPhysGroupRot.W - GroupRotation.W) > 0.1) || (Math.Abs(lastPhysGroupRot.X - GroupRotation.X) > 0.1) || (Math.Abs(lastPhysGroupRot.Y - GroupRotation.Y) > 0.1) - || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1)) - && UsePhysics) + || (Math.Abs(lastPhysGroupRot.Z - GroupRotation.Z) > 0.1))) { m_rootPart.UpdateFlag = 1; diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 38df751..dd58a4e 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs @@ -223,6 +223,11 @@ namespace OpenSim.Region.Physics.OdePlugin set { m_localID = value; } } + public override int GetHashCode() + { + return (int)m_localID; + } + public override bool Grabbed { set { return; } diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index d0f77e6..673ae39 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -260,6 +260,11 @@ namespace OpenSim.Region.Physics.OdePlugin m_localID = value; } } + public override int GetHashCode() + { + return (int)m_localID; + } + public override bool Grabbed { set { return; } diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 817cc22..e702d5e 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -235,11 +235,11 @@ namespace OpenSim.Region.Physics.OdePlugin private d.NearCallback nearCallback; public d.TriCallback triCallback; public d.TriArrayCallback triArrayCallback; - private readonly List _characters = new List(); - private readonly List _prims = new List(); - private readonly List _activeprims = new List(); - private readonly List _taintedPrim = new List(); - private readonly List _taintedActors = new List(); + private readonly HashSet _characters = new HashSet(); + private readonly HashSet _prims = new HashSet(); + private readonly HashSet _activeprims = new HashSet(); + private readonly HashSet _taintedPrim = new HashSet(); + private readonly HashSet _taintedActors = new HashSet(); private readonly List _perloopContact = new List(); private readonly List _collisionEventPrim = new List(); public Dictionary geom_name_map = new Dictionary(); -- cgit v1.1