From c7e3e59953d68dd9428188f8a19f055a73bd333b Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 12 Aug 2014 20:37:34 +0100 Subject: try no send current LookAt, remove redundant incomplete position height check --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 762dbd4..c49559a 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -1768,17 +1768,11 @@ namespace OpenSim.Region.Framework.Scenes return; } - Vector3 look = Velocity; - - // if ((look.X == 0) && (look.Y == 0) && (look.Z == 0)) - if ((Math.Abs(look.X) < 0.1) && (Math.Abs(look.Y) < 0.1) && (Math.Abs(look.Z) < 0.1)) - { - look = new Vector3(0.99f, 0.042f, 0); - } - // Prevent teleporting to an underground location // (may crash client otherwise) // + +/* this is done in MakeRootAgent Vector3 pos = AbsolutePosition; float ground = m_scene.GetGroundHeight(pos.X, pos.Y); if (pos.Z < ground + 1.5f) @@ -1786,7 +1780,7 @@ namespace OpenSim.Region.Framework.Scenes pos.Z = ground + 1.5f; AbsolutePosition = pos; } - +*/ bool flying = ((m_AgentControlFlags & AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); if (!MakeRootAgent(AbsolutePosition, flying)) { @@ -1797,6 +1791,16 @@ namespace OpenSim.Region.Framework.Scenes return; } + Vector3 look = Lookat; + if ((Math.Abs(look.X) < 0.01) && (Math.Abs(look.Y) < 0.01)) + { + look = Velocity; + look.Z = 0; + look = Util.GetNormalizedVector(look); + if ((Math.Abs(look.X) < 0.01) && (Math.Abs(look.Y) < 0.01) ) + look = new Vector3(0.99f, 0.042f, 0); + } + // Tell the client that we're totally ready ControllingClient.MoveAgentIntoRegion(m_scene.RegionInfo, AbsolutePosition, look); -- cgit v1.1