aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorDiva Canto2011-12-21 15:17:26 -0800
committerDiva Canto2011-12-21 15:17:26 -0800
commitddff2f246cb4862abcac5308ae2532c9828691fb (patch)
tree4b49b5b16f1fad7c6b37feb976df3c09edd9c018 /OpenSim/Region
parentHG: Verify that the user is local (diff)
downloadopensim-SC-ddff2f246cb4862abcac5308ae2532c9828691fb.zip
opensim-SC-ddff2f246cb4862abcac5308ae2532c9828691fb.tar.gz
opensim-SC-ddff2f246cb4862abcac5308ae2532c9828691fb.tar.bz2
opensim-SC-ddff2f246cb4862abcac5308ae2532c9828691fb.tar.xz
Moved an external test into the method that uses those preconditions.
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 36d8c0b..526fab3 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 }
@@ -2741,7 +2739,8 @@ namespace OpenSim.Region.Framework.Scenes
2741 /// </remarks> 2739 /// </remarks>
2742 protected void CheckForBorderCrossing() 2740 protected void CheckForBorderCrossing()
2743 { 2741 {
2744 if (IsChildAgent) 2742 // Check that we we are not a child and have a physics actor or we're sitting on something
2743 if (IsChildAgent || (ParentID == 0 && PhysicsActor != null || ParentID != 0))
2745 return; 2744 return;
2746 2745
2747 Vector3 pos2 = AbsolutePosition; 2746 Vector3 pos2 = AbsolutePosition;
@@ -2757,7 +2756,6 @@ namespace OpenSim.Region.Framework.Scenes
2757 if (!IsInTransit) 2756 if (!IsInTransit)
2758 { 2757 {
2759 // Checks if where it's headed exists a region 2758 // Checks if where it's headed exists a region
2760
2761 bool needsTransit = false; 2759 bool needsTransit = false;
2762 if (m_scene.TestBorderCross(pos2, Cardinals.W)) 2760 if (m_scene.TestBorderCross(pos2, Cardinals.W))
2763 { 2761 {
@@ -2828,7 +2826,7 @@ namespace OpenSim.Region.Framework.Scenes
2828 Velocity = Vector3.Zero; 2826 Velocity = Vector3.Zero;
2829 AbsolutePosition = pos; 2827 AbsolutePosition = pos;
2830 2828
2831// m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition); 2829 m_log.DebugFormat("[SCENE PRESENCE]: Prevented flyoff for {0} at {1}", Name, AbsolutePosition);
2832 2830
2833 AddToPhysicalScene(isFlying); 2831 AddToPhysicalScene(isFlying);
2834 } 2832 }
@@ -2861,22 +2859,16 @@ namespace OpenSim.Region.Framework.Scenes
2861 } 2859 }
2862 } 2860 }
2863 else 2861 else
2864 { 2862 {
2865 // We must remove the agent from the physical scene if it has been placed in transit. If we don't,
2866 // then this method continues to be called from ScenePresence.Update() until the handover of the client between
2867 // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms
2868 // event queue polling response from the server), this results in the avatar pausing on the border
2869 // for the handover period.
2870 RemoveFromPhysicalScene();
2871
2872 // This constant has been inferred from experimentation 2863 // This constant has been inferred from experimentation
2873 // I'm not sure what this value should be, so I tried a few values. 2864 // I'm not sure what this value should be, so I tried a few values.
2874 timeStep = 0.04f; 2865 timeStep = 0.04f;
2875 pos2 = AbsolutePosition; 2866 pos2 = AbsolutePosition;
2876 pos2.X = pos2.X + (vel.X * timeStep); 2867 pos2.X = pos2.X + (vel.X * timeStep);
2877 pos2.Y = pos2.Y + (vel.Y * timeStep); 2868 pos2.Y = pos2.Y + (vel.Y * timeStep);
2878 pos2.Z = pos2.Z + (vel.Z * timeStep); 2869 // Don't touch the Z
2879 m_pos = pos2; 2870 m_pos = pos2;
2871 m_log.ErrorFormat("m_pos={0}", m_pos);
2880 } 2872 }
2881 } 2873 }
2882 2874