From 2ac6fb9ae955d012edeeadf1259eb323871cf29c Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 3 Jan 2019 23:11:39 +0000 Subject: [PATCH] allow landing under lower hight skyboxes --- OpenSim/Region/Framework/Scenes/Scene.cs | 10 ---------- .../Region/Framework/Scenes/ScenePresence.cs | 20 +++++++++++-------- 2 files changed, 12 insertions(+), 18 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index ed9804686a..252ae21d44 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -4667,16 +4667,6 @@ Label_GroupsDone: return false; } -// public bool IncomingCloseAgent(UUID agentID) -// { -// return IncomingCloseAgent(agentID, false); -// } - -// public bool IncomingCloseChildAgent(UUID agentID) -// { -// return IncomingCloseAgent(agentID, true); -// } - /// /// Tell a single client to prepare to close. /// diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 3b78f2ddb4..fd8c6fc9dd 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1251,8 +1251,9 @@ namespace OpenSim.Region.Framework.Scenes /// // constants for physics position search - const float PhysSearchHeight = 600f; - const float PhysMinSkipGap = 50f; + const float PhysSearchHeight = 300f; + const float PhysMinSkipGap = 20f; + const float PhysSkipGapDelta = 30f; const int PhysNumberCollisions = 30; // only in use as part of completemovement @@ -1398,11 +1399,13 @@ namespace OpenSim.Region.Framework.Scenes List physresults = (List)m_scene.RayCastFiltered(RayStart, direction, dist, physcount, rayfilter); - if (physresults != null && physresults.Count > 0) + while (physresults != null && physresults.Count > 0) { float dest = physresults[0].Pos.Z; + if (dest - groundHeight > PhysMinSkipGap + PhysSkipGapDelta) + break; - if(physresults.Count > 1) + if (physresults.Count > 1) { physresults.Sort(delegate(ContactResult a, ContactResult b) { @@ -1420,7 +1423,7 @@ namespace OpenSim.Region.Framework.Scenes if(curd >= nextd) { sel = i; - if(curd >= maxDepth) + if(curd >= maxDepth || curd >= nextd + PhysSkipGapDelta) break; } nextd = curd + PhysMinSkipGap; @@ -1428,9 +1431,10 @@ namespace OpenSim.Region.Framework.Scenes dest = physresults[sel].Pos.Z; } - dest += localAVHalfHeight; - if(dest > pos.Z) - pos.Z = dest; + dest += localAVHalfHeight; + if(dest > pos.Z) + pos.Z = dest; + break; } }