aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs52
1 files changed, 43 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index cd70de8..00a1487 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -626,7 +626,7 @@ namespace OpenSim.Region.Framework.Scenes
626 Utils.LongToUInts(handle, out x, out y); 626 Utils.LongToUInts(handle, out x, out y);
627 x = x / Constants.RegionSize; 627 x = x / Constants.RegionSize;
628 y = y / Constants.RegionSize; 628 y = y / Constants.RegionSize;
629 if (Util.IsOutsideView(x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY)) 629 if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY))
630 { 630 {
631 old.Add(handle); 631 old.Add(handle);
632 } 632 }
@@ -700,6 +700,7 @@ namespace OpenSim.Region.Framework.Scenes
700 700
701 private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() 701 private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this()
702 { 702 {
703 m_DrawDistance = world.DefaultDrawDistance;
703 m_rootRegionHandle = reginfo.RegionHandle; 704 m_rootRegionHandle = reginfo.RegionHandle;
704 m_controllingClient = client; 705 m_controllingClient = client;
705 m_firstname = m_controllingClient.FirstName; 706 m_firstname = m_controllingClient.FirstName;
@@ -1161,7 +1162,9 @@ namespace OpenSim.Region.Framework.Scenes
1161 if (m_agentTransfer != null) 1162 if (m_agentTransfer != null)
1162 m_agentTransfer.EnableChildAgents(this); 1163 m_agentTransfer.EnableChildAgents(this);
1163 else 1164 else
1164 m_log.DebugFormat("[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active"); 1165 m_log.DebugFormat(
1166 "[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active for region {0}",
1167 m_scene.RegionInfo.RegionName);
1165 1168
1166 IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); 1169 IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>();
1167 if (friendsModule != null) 1170 if (friendsModule != null)
@@ -1277,7 +1280,11 @@ namespace OpenSim.Region.Framework.Scenes
1277 m_CameraUpAxis = agentData.CameraUpAxis; 1280 m_CameraUpAxis = agentData.CameraUpAxis;
1278 1281
1279 // The Agent's Draw distance setting 1282 // The Agent's Draw distance setting
1280 m_DrawDistance = agentData.Far; 1283 // When we get to the point of re-computing neighbors everytime this
1284 // changes, then start using the agent's drawdistance rather than the
1285 // region's draw distance.
1286 // m_DrawDistance = agentData.Far;
1287 m_DrawDistance = Scene.DefaultDrawDistance;
1281 1288
1282 // Check if Client has camera in 'follow cam' or 'build' mode. 1289 // Check if Client has camera in 'follow cam' or 'build' mode.
1283 Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation); 1290 Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation);
@@ -2435,7 +2442,7 @@ namespace OpenSim.Region.Framework.Scenes
2435 // If we are using the the cached appearance then send it out to everyone 2442 // If we are using the the cached appearance then send it out to everyone
2436 if (cachedappearance) 2443 if (cachedappearance)
2437 { 2444 {
2438 m_log.InfoFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); 2445 m_log.DebugFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name);
2439 2446
2440 // If the avatars baked textures are all in the cache, then we have a 2447 // If the avatars baked textures are all in the cache, then we have a
2441 // complete appearance... send it out, if not, then we'll send it when 2448 // complete appearance... send it out, if not, then we'll send it when
@@ -2652,8 +2659,11 @@ namespace OpenSim.Region.Framework.Scenes
2652 #region Border Crossing Methods 2659 #region Border Crossing Methods
2653 2660
2654 /// <summary> 2661 /// <summary>
2655 /// Checks to see if the avatar is in range of a border and calls CrossToNewRegion 2662 /// Starts the process of moving an avatar into another region if they are crossing the border.
2656 /// </summary> 2663 /// </summary>
2664 /// <remarks>
2665 /// Also removes the avatar from the physical scene if transit has started.
2666 /// </remarks>
2657 protected void CheckForBorderCrossing() 2667 protected void CheckForBorderCrossing()
2658 { 2668 {
2659 if (IsChildAgent) 2669 if (IsChildAgent)
@@ -2721,7 +2731,6 @@ namespace OpenSim.Region.Framework.Scenes
2721 neighbor = HaveNeighbor(Cardinals.N, ref fix); 2731 neighbor = HaveNeighbor(Cardinals.N, ref fix);
2722 } 2732 }
2723 2733
2724
2725 // Makes sure avatar does not end up outside region 2734 // Makes sure avatar does not end up outside region
2726 if (neighbor <= 0) 2735 if (neighbor <= 0)
2727 { 2736 {
@@ -2776,6 +2785,13 @@ namespace OpenSim.Region.Framework.Scenes
2776 } 2785 }
2777 else 2786 else
2778 { 2787 {
2788 // We must remove the agent from the physical scene if it has been placed in transit. If we don't,
2789 // then this method continues to be called from ScenePresence.Update() until the handover of the client between
2790 // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms
2791 // event queue polling response from the server), this results in the avatar pausing on the border
2792 // for the handover period.
2793 RemoveFromPhysicalScene();
2794
2779 // This constant has been inferred from experimentation 2795 // This constant has been inferred from experimentation
2780 // I'm not sure what this value should be, so I tried a few values. 2796 // I'm not sure what this value should be, so I tried a few values.
2781 timeStep = 0.04f; 2797 timeStep = 0.04f;
@@ -2787,6 +2803,15 @@ namespace OpenSim.Region.Framework.Scenes
2787 } 2803 }
2788 } 2804 }
2789 2805
2806 /// <summary>
2807 /// Checks whether this region has a neighbour in the given direction.
2808 /// </summary>
2809 /// <param name="car"></param>
2810 /// <param name="fix"></param>
2811 /// <returns>
2812 /// An integer which represents a compass point. N == 1, going clockwise until we reach NW == 8.
2813 /// Returns a positive integer if there is a region in that direction, a negative integer if not.
2814 /// </returns>
2790 protected int HaveNeighbor(Cardinals car, ref int[] fix) 2815 protected int HaveNeighbor(Cardinals car, ref int[] fix)
2791 { 2816 {
2792 uint neighbourx = m_regionInfo.RegionLocX; 2817 uint neighbourx = m_regionInfo.RegionLocX;
@@ -2893,7 +2918,7 @@ namespace OpenSim.Region.Framework.Scenes
2893 2918
2894 //m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); 2919 //m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX)));
2895 //m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); 2920 //m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY)));
2896 if (Util.IsOutsideView(x, newRegionX, y, newRegionY)) 2921 if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY))
2897 { 2922 {
2898 byebyeRegions.Add(handle); 2923 byebyeRegions.Add(handle);
2899 } 2924 }
@@ -2969,7 +2994,12 @@ namespace OpenSim.Region.Framework.Scenes
2969 2994
2970 Vector3 offset = new Vector3(shiftx, shifty, 0f); 2995 Vector3 offset = new Vector3(shiftx, shifty, 0f);
2971 2996
2972 m_DrawDistance = cAgentData.Far; 2997 // When we get to the point of re-computing neighbors everytime this
2998 // changes, then start using the agent's drawdistance rather than the
2999 // region's draw distance.
3000 // m_DrawDistance = cAgentData.Far;
3001 m_DrawDistance = Scene.DefaultDrawDistance;
3002
2973 if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! 3003 if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!!
2974 m_pos = cAgentData.Position + offset; 3004 m_pos = cAgentData.Position + offset;
2975 3005
@@ -3119,7 +3149,11 @@ namespace OpenSim.Region.Framework.Scenes
3119 m_CameraLeftAxis = cAgent.LeftAxis; 3149 m_CameraLeftAxis = cAgent.LeftAxis;
3120 m_CameraUpAxis = cAgent.UpAxis; 3150 m_CameraUpAxis = cAgent.UpAxis;
3121 3151
3122 m_DrawDistance = cAgent.Far; 3152 // When we get to the point of re-computing neighbors everytime this
3153 // changes, then start using the agent's drawdistance rather than the
3154 // region's draw distance.
3155 // m_DrawDistance = cAgent.Far;
3156 m_DrawDistance = Scene.DefaultDrawDistance;
3123 3157
3124 if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) 3158 if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0)
3125 ControllingClient.SetChildAgentThrottle(cAgent.Throttles); 3159 ControllingClient.SetChildAgentThrottle(cAgent.Throttles);