aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs30
1 files changed, 11 insertions, 19 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index b8ae553..6f02475 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1161,10 +1161,10 @@ namespace OpenSim.Region.Framework.Scenes
1161 public void CompleteMovement(IClientAPI client, bool openChildAgents) 1161 public void CompleteMovement(IClientAPI client, bool openChildAgents)
1162 { 1162 {
1163// DateTime startTime = DateTime.Now; 1163// DateTime startTime = DateTime.Now;
1164 1164
1165// m_log.DebugFormat( 1165 m_log.DebugFormat(
1166// "[SCENE PRESENCE]: Completing movement of {0} into region {1}", 1166 "[SCENE PRESENCE]: Completing movement of {0} into region {1} in position {2}",
1167// client.Name, Scene.RegionInfo.RegionName); 1167 client.Name, Scene.RegionInfo.RegionName, AbsolutePosition);
1168 1168
1169 Vector3 look = Velocity; 1169 Vector3 look = Velocity;
1170 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) 1170 if ((look.X == 0) && (look.Y == 0) && (look.Z == 0))
@@ -2383,9 +2383,7 @@ namespace OpenSim.Region.Framework.Scenes
2383 m_lastVelocity = Velocity; 2383 m_lastVelocity = Velocity;
2384 } 2384 }
2385 2385
2386 // followed suggestion from mic bowman. reversed the two lines below. 2386 CheckForBorderCrossing();
2387 if (ParentID == 0 && PhysicsActor != null || ParentID != 0) // Check that we have a physics actor or we're sitting on something
2388 CheckForBorderCrossing();
2389 2387
2390 CheckForSignificantMovement(); // sends update to the modules. 2388 CheckForSignificantMovement(); // sends update to the modules.
2391 } 2389 }
@@ -2738,7 +2736,8 @@ namespace OpenSim.Region.Framework.Scenes
2738 /// </remarks> 2736 /// </remarks>
2739 protected void CheckForBorderCrossing() 2737 protected void CheckForBorderCrossing()
2740 { 2738 {
2741 if (IsChildAgent) 2739 // Check that we we are not a child and have a physics actor or we're sitting on something
2740 if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0))
2742 return; 2741 return;
2743 2742
2744 Vector3 pos2 = AbsolutePosition; 2743 Vector3 pos2 = AbsolutePosition;
@@ -2754,7 +2753,6 @@ namespace OpenSim.Region.Framework.Scenes
2754 if (!IsInTransit) 2753 if (!IsInTransit)
2755 { 2754 {
2756 // Checks if where it's headed exists a region 2755 // Checks if where it's headed exists a region
2757
2758 bool needsTransit = false; 2756 bool needsTransit = false;
2759 if (m_scene.TestBorderCross(pos2, Cardinals.W)) 2757 if (m_scene.TestBorderCross(pos2, Cardinals.W))
2760 { 2758 {
@@ -2825,7 +2823,7 @@ namespace OpenSim.Region.Framework.Scenes
2825 Velocity = Vector3.Zero; 2823 Velocity = Vector3.Zero;
2826 AbsolutePosition = pos; 2824 AbsolutePosition = pos;
2827 2825
2828// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); 2826 m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition);
2829 2827
2830 AddToPhysicalScene(isFlying); 2828 AddToPhysicalScene(isFlying);
2831 } 2829 }
@@ -2858,22 +2856,16 @@ namespace OpenSim.Region.Framework.Scenes
2858 } 2856 }
2859 } 2857 }
2860 else 2858 else
2861 { 2859 {
2862 // We must remove the agent from the physical scene if it has been placed in transit. If we don't,
2863 // then this method continues to be called from ScenePresence.Update() until the handover of the client between
2864 // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms
2865 // event queue polling response from the server), this results in the avatar pausing on the border
2866 // for the handover period.
2867 RemoveFromPhysicalScene();
2868
2869 // This constant has been inferred from experimentation 2860 // This constant has been inferred from experimentation
2870 // I'm not sure what this value should be, so I tried a few values. 2861 // I'm not sure what this value should be, so I tried a few values.
2871 timeStep = 0.04f; 2862 timeStep = 0.04f;
2872 pos2 = AbsolutePosition; 2863 pos2 = AbsolutePosition;
2873 pos2.X = pos2.X + (vel.X * timeStep); 2864 pos2.X = pos2.X + (vel.X * timeStep);
2874 pos2.Y = pos2.Y + (vel.Y * timeStep); 2865 pos2.Y = pos2.Y + (vel.Y * timeStep);
2875 pos2.Z = pos2.Z + (vel.Z * timeStep); 2866 // Don't touch the Z
2876 m_pos = pos2; 2867 m_pos = pos2;
2868 m_log.ErrorFormat("m_pos={0}", m_pos);
2877 } 2869 }
2878 } 2870 }
2879 2871