From a6e23a32750e1333c45ccc69ede98f522e804216 Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Wed, 3 Mar 2010 10:59:05 -0800 Subject: * Fixed bad start position clamping in MakeRootAgent() --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 40 +++++------------------- 1 file changed, 7 insertions(+), 33 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index f83a4d2..6a9f016 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -830,41 +830,15 @@ namespace OpenSim.Region.Framework.Scenes pos.Y = crossedBorder.BorderLine.Z - 1; } - - if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) + if (pos.X < 0f || pos.Y < 0f || pos.Z < 0f) { - Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); - - if (pos.X < 0) - { - emergencyPos.X = (int)Constants.RegionSize + pos.X; - if (!(pos.Y < 0)) - emergencyPos.Y = pos.Y; - if (!(pos.Z < 0)) - emergencyPos.X = pos.X; - } - if (pos.Y < 0) - { - emergencyPos.Y = (int)Constants.RegionSize + pos.Y; - if (!(pos.X < 0)) - emergencyPos.X = pos.X; - if (!(pos.Z < 0)) - emergencyPos.Z = pos.Z; - } - if (pos.Z < 0) - { - if (!(pos.X < 0)) - emergencyPos.X = pos.X; - if (!(pos.Y < 0)) - emergencyPos.Y = pos.Y; - //Leave as 128 - } - m_log.WarnFormat( - "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", - pos, Name, UUID, emergencyPos); + "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Clamping", + pos, Name, UUID); - pos = emergencyPos; + if (pos.X < 0f) pos.X = 0f; + if (pos.Y < 0f) pos.Y = 0f; + if (pos.Z < 0f) pos.Z = 0f; } float localAVHeight = 1.56f; @@ -875,7 +849,7 @@ namespace OpenSim.Region.Framework.Scenes float posZLimit = 0; - if (pos.X protected void CheckForSignificantMovement() { - if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.5) + // Movement updates for agents in neighboring regions are sent directly to clients. + // This value only affects how often agent positions are sent to neighbor regions + // for things such as distance-based update prioritization + const float SIGNIFICANT_MOVEMENT = 2.0f; + + if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > SIGNIFICANT_MOVEMENT) { posLastSignificantMove = AbsolutePosition; m_scene.EventManager.TriggerSignificantClientMovement(m_controllingClient); -- cgit v1.1