* Change the order of Update so Physics processes a frame before the scene manipulates the physics Scene.cs

* Remove the draconic locking around adding an avatar to the Scene
* Handle an extreme error case when border crossing fails and user uses map to teleport to a different region on the same instance causing control commands to go to a child agent.
* Make the Set Appearance method use the proper 'remove from physics scene' method.
* It *may* help border crossings.   
* It *may* help the 'on avatar rez' lag, that people have been seeing the past week.
* It may also cause physics to crash more often on failed teleports (though..  I think I got the cases covered).
This commit is contained in:
Teravus Ovares
2009-07-17 07:28:09 +00:00
parent 01446074b1
commit f74622c65f
2 changed files with 90 additions and 55 deletions

View File

@@ -901,24 +901,7 @@ namespace OpenSim.Region.Framework.Scenes
if (m_frame == Int32.MaxValue)
m_frame = 0;
physicsMS2 = Environment.TickCount;
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
m_sceneGraph.UpdatePreparePhysics();
physicsMS2 = Environment.TickCount - physicsMS2;
if (m_frame % m_update_entitymovement == 0)
m_sceneGraph.UpdateEntityMovement();
physicsMS = Environment.TickCount;
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
physicsFPS = m_sceneGraph.UpdatePhysics(
Math.Max(SinceLastFrame.TotalSeconds, m_timespan)
);
if (m_frame % m_update_physics == 0 && SynchronizeScene != null)
SynchronizeScene(this);
physicsMS = Environment.TickCount - physicsMS;
physicsMS += physicsMS2;
otherMS = Environment.TickCount;
// run through all entities looking for updates (slow)
@@ -949,6 +932,25 @@ namespace OpenSim.Region.Framework.Scenes
if (m_frame % m_update_presences == 0)
m_sceneGraph.UpdatePresences();
physicsMS2 = Environment.TickCount;
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
m_sceneGraph.UpdatePreparePhysics();
physicsMS2 = Environment.TickCount - physicsMS2;
if (m_frame % m_update_entitymovement == 0)
m_sceneGraph.UpdateEntityMovement();
physicsMS = Environment.TickCount;
if ((m_frame % m_update_physics == 0) && m_physics_enabled)
physicsFPS = m_sceneGraph.UpdatePhysics(
Math.Max(SinceLastFrame.TotalSeconds, m_timespan)
);
if (m_frame % m_update_physics == 0 && SynchronizeScene != null)
SynchronizeScene(this);
physicsMS = Environment.TickCount - physicsMS;
physicsMS += physicsMS2;
// Delete temp-on-rez stuff
if (m_frame % m_update_backup == 0)
CleanTempObjects();