diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 53 |
1 files changed, 43 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index b87275c..3a5b05d 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -123,7 +123,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
123 | private SceneObjectGroup proxyObjectGroup; | 123 | private SceneObjectGroup proxyObjectGroup; |
124 | //private SceneObjectPart proxyObjectPart = null; | 124 | //private SceneObjectPart proxyObjectPart = null; |
125 | public Vector3 lastKnownAllowedPosition; | 125 | public Vector3 lastKnownAllowedPosition; |
126 | public bool sentMessageAboutRestrictedParcelFlyingDown; | ||
127 | public Vector4 CollisionPlane = Vector4.UnitW; | 126 | public Vector4 CollisionPlane = Vector4.UnitW; |
128 | 127 | ||
129 | private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation | 128 | private Vector3 m_avInitialPos; // used to calculate unscripted sit rotation |
@@ -691,7 +690,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
691 | Utils.LongToUInts(handle, out x, out y); | 690 | Utils.LongToUInts(handle, out x, out y); |
692 | x = x / Constants.RegionSize; | 691 | x = x / Constants.RegionSize; |
693 | y = y / Constants.RegionSize; | 692 | y = y / Constants.RegionSize; |
694 | if (Util.IsOutsideView(x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY)) | 693 | if (Util.IsOutsideView(DrawDistance, x, Scene.RegionInfo.RegionLocX, y, Scene.RegionInfo.RegionLocY)) |
695 | { | 694 | { |
696 | old.Add(handle); | 695 | old.Add(handle); |
697 | } | 696 | } |
@@ -765,6 +764,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
765 | 764 | ||
766 | private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() | 765 | private ScenePresence(IClientAPI client, Scene world, RegionInfo reginfo) : this() |
767 | { | 766 | { |
767 | m_DrawDistance = world.DefaultDrawDistance; | ||
768 | m_rootRegionHandle = reginfo.RegionHandle; | 768 | m_rootRegionHandle = reginfo.RegionHandle; |
769 | m_controllingClient = client; | 769 | m_controllingClient = client; |
770 | m_firstname = m_controllingClient.FirstName; | 770 | m_firstname = m_controllingClient.FirstName; |
@@ -1311,7 +1311,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
1311 | if (m_agentTransfer != null) | 1311 | if (m_agentTransfer != null) |
1312 | m_agentTransfer.EnableChildAgents(this); | 1312 | m_agentTransfer.EnableChildAgents(this); |
1313 | else | 1313 | else |
1314 | m_log.DebugFormat("[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active"); | 1314 | m_log.DebugFormat( |
1315 | "[SCENE PRESENCE]: Unable to create child agents in neighbours, because AgentTransferModule is not active for region {0}", | ||
1316 | m_scene.RegionInfo.RegionName); | ||
1315 | 1317 | ||
1316 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); | 1318 | IFriendsModule friendsModule = m_scene.RequestModuleInterface<IFriendsModule>(); |
1317 | if (friendsModule != null) | 1319 | if (friendsModule != null) |
@@ -1428,7 +1430,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
1428 | m_CameraUpAxis = agentData.CameraUpAxis; | 1430 | m_CameraUpAxis = agentData.CameraUpAxis; |
1429 | 1431 | ||
1430 | // The Agent's Draw distance setting | 1432 | // The Agent's Draw distance setting |
1431 | m_DrawDistance = agentData.Far; | 1433 | // When we get to the point of re-computing neighbors everytime this |
1434 | // changes, then start using the agent's drawdistance rather than the | ||
1435 | // region's draw distance. | ||
1436 | // m_DrawDistance = agentData.Far; | ||
1437 | m_DrawDistance = Scene.DefaultDrawDistance; | ||
1432 | 1438 | ||
1433 | // Check if Client has camera in 'follow cam' or 'build' mode. | 1439 | // Check if Client has camera in 'follow cam' or 'build' mode. |
1434 | Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation); | 1440 | Vector3 camdif = (Vector3.One * m_bodyRot - Vector3.One * CameraRotation); |
@@ -2853,7 +2859,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2853 | // If we are using the the cached appearance then send it out to everyone | 2859 | // If we are using the the cached appearance then send it out to everyone |
2854 | if (cachedappearance) | 2860 | if (cachedappearance) |
2855 | { | 2861 | { |
2856 | m_log.InfoFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); | 2862 | m_log.DebugFormat("[SCENEPRESENCE]: baked textures are in the cache for {0}", Name); |
2857 | 2863 | ||
2858 | // If the avatars baked textures are all in the cache, then we have a | 2864 | // If the avatars baked textures are all in the cache, then we have a |
2859 | // complete appearance... send it out, if not, then we'll send it when | 2865 | // complete appearance... send it out, if not, then we'll send it when |
@@ -3070,8 +3076,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3070 | #region Border Crossing Methods | 3076 | #region Border Crossing Methods |
3071 | 3077 | ||
3072 | /// <summary> | 3078 | /// <summary> |
3073 | /// Checks to see if the avatar is in range of a border and calls CrossToNewRegion | 3079 | /// Starts the process of moving an avatar into another region if they are crossing the border. |
3074 | /// </summary> | 3080 | /// </summary> |
3081 | /// <remarks> | ||
3082 | /// Also removes the avatar from the physical scene if transit has started. | ||
3083 | /// </remarks> | ||
3075 | protected void CheckForBorderCrossing() | 3084 | protected void CheckForBorderCrossing() |
3076 | { | 3085 | { |
3077 | if (IsChildAgent) | 3086 | if (IsChildAgent) |
@@ -3139,7 +3148,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
3139 | neighbor = HaveNeighbor(Cardinals.N, ref fix); | 3148 | neighbor = HaveNeighbor(Cardinals.N, ref fix); |
3140 | } | 3149 | } |
3141 | 3150 | ||
3142 | |||
3143 | // Makes sure avatar does not end up outside region | 3151 | // Makes sure avatar does not end up outside region |
3144 | if (neighbor <= 0) | 3152 | if (neighbor <= 0) |
3145 | { | 3153 | { |
@@ -3194,6 +3202,13 @@ namespace OpenSim.Region.Framework.Scenes | |||
3194 | } | 3202 | } |
3195 | else | 3203 | else |
3196 | { | 3204 | { |
3205 | // We must remove the agent from the physical scene if it has been placed in transit. If we don't, | ||
3206 | // then this method continues to be called from ScenePresence.Update() until the handover of the client between | ||
3207 | // regions is completed. Since this handover can take more than 1000ms (due to the 1000ms | ||
3208 | // event queue polling response from the server), this results in the avatar pausing on the border | ||
3209 | // for the handover period. | ||
3210 | RemoveFromPhysicalScene(); | ||
3211 | |||
3197 | // This constant has been inferred from experimentation | 3212 | // This constant has been inferred from experimentation |
3198 | // I'm not sure what this value should be, so I tried a few values. | 3213 | // I'm not sure what this value should be, so I tried a few values. |
3199 | timeStep = 0.04f; | 3214 | timeStep = 0.04f; |
@@ -3205,6 +3220,15 @@ namespace OpenSim.Region.Framework.Scenes | |||
3205 | } | 3220 | } |
3206 | } | 3221 | } |
3207 | 3222 | ||
3223 | /// <summary> | ||
3224 | /// Checks whether this region has a neighbour in the given direction. | ||
3225 | /// </summary> | ||
3226 | /// <param name="car"></param> | ||
3227 | /// <param name="fix"></param> | ||
3228 | /// <returns> | ||
3229 | /// An integer which represents a compass point. N == 1, going clockwise until we reach NW == 8. | ||
3230 | /// Returns a positive integer if there is a region in that direction, a negative integer if not. | ||
3231 | /// </returns> | ||
3208 | protected int HaveNeighbor(Cardinals car, ref int[] fix) | 3232 | protected int HaveNeighbor(Cardinals car, ref int[] fix) |
3209 | { | 3233 | { |
3210 | uint neighbourx = m_regionInfo.RegionLocX; | 3234 | uint neighbourx = m_regionInfo.RegionLocX; |
@@ -3311,7 +3335,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
3311 | 3335 | ||
3312 | //m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); | 3336 | //m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); |
3313 | //m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); | 3337 | //m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); |
3314 | if (Util.IsOutsideView(x, newRegionX, y, newRegionY)) | 3338 | if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY)) |
3315 | { | 3339 | { |
3316 | byebyeRegions.Add(handle); | 3340 | byebyeRegions.Add(handle); |
3317 | } | 3341 | } |
@@ -3387,7 +3411,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
3387 | 3411 | ||
3388 | Vector3 offset = new Vector3(shiftx, shifty, 0f); | 3412 | Vector3 offset = new Vector3(shiftx, shifty, 0f); |
3389 | 3413 | ||
3390 | m_DrawDistance = cAgentData.Far; | 3414 | // When we get to the point of re-computing neighbors everytime this |
3415 | // changes, then start using the agent's drawdistance rather than the | ||
3416 | // region's draw distance. | ||
3417 | // m_DrawDistance = cAgentData.Far; | ||
3418 | m_DrawDistance = Scene.DefaultDrawDistance; | ||
3419 | |||
3391 | if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! | 3420 | if (cAgentData.Position != new Vector3(-1f, -1f, -1f)) // UGH!! |
3392 | m_pos = cAgentData.Position + offset; | 3421 | m_pos = cAgentData.Position + offset; |
3393 | 3422 | ||
@@ -3538,7 +3567,11 @@ namespace OpenSim.Region.Framework.Scenes | |||
3538 | m_CameraLeftAxis = cAgent.LeftAxis; | 3567 | m_CameraLeftAxis = cAgent.LeftAxis; |
3539 | m_CameraUpAxis = cAgent.UpAxis; | 3568 | m_CameraUpAxis = cAgent.UpAxis; |
3540 | 3569 | ||
3541 | m_DrawDistance = cAgent.Far; | 3570 | // When we get to the point of re-computing neighbors everytime this |
3571 | // changes, then start using the agent's drawdistance rather than the | ||
3572 | // region's draw distance. | ||
3573 | // m_DrawDistance = cAgent.Far; | ||
3574 | m_DrawDistance = Scene.DefaultDrawDistance; | ||
3542 | 3575 | ||
3543 | if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) | 3576 | if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) |
3544 | ControllingClient.SetChildAgentThrottle(cAgent.Throttles); | 3577 | ControllingClient.SetChildAgentThrottle(cAgent.Throttles); |