From dd803b4f0c50c4ac1eda5ae7622dc91b2a63db3f Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Mon, 13 Sep 2010 21:53:25 +0100 Subject: minor: Add comments which explain what's going on wrt avatar movements at various points in the main scene loop and associated methods --- OpenSim/Region/Framework/Scenes/Scene.cs | 4 ++++ OpenSim/Region/Framework/Scenes/ScenePresence.cs | 2 ++ 2 files changed, 6 insertions(+) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 6d2ae5a..ef97dfc 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -1319,6 +1319,7 @@ namespace OpenSim.Region.Framework.Scenes if (m_frame % m_update_presences == 0) m_sceneGraph.UpdatePresences(); + // Coarse locations relate to positions of green dots on the mini-map (on a SecondLife client) if (m_frame % m_update_coarse_locations == 0) { List coarseLocations; @@ -1336,9 +1337,12 @@ namespace OpenSim.Region.Framework.Scenes m_sceneGraph.UpdatePreparePhysics(); physicsMS2 = Util.EnvironmentTickCountSubtract(tmpPhysicsMS2); + // Apply any pending avatar force input to the avatar's velocity if (m_frame % m_update_entitymovement == 0) m_sceneGraph.UpdateScenePresenceMovement(); + // Perform the main physics update. This will do the actual work of moving objects and avatars according to their + // velocity int tmpPhysicsMS = Util.EnvironmentTickCount(); if (m_frame % m_update_physics == 0) { diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 51a0f2a..a77f38c 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1522,6 +1522,8 @@ namespace OpenSim.Region.Framework.Scenes } } + // If the agent update does move the avatar, then calculate the force ready for the velocity update, + // which occurs later in the main scene loop if (update_movementflag || (update_rotation && DCFlagKeyPressed)) { // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); -- cgit v1.1