From caddabb5c4f62767305a589e9d818ae3457a8030 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 6 Nov 2014 22:25:16 +0000 Subject: scale ChildAgentThrottles with distance (internal to child server and not root as was done before ) --- OpenSim/Region/Framework/Scenes/ScenePresence.cs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 6a9e0ca..3b64088 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs @@ -4104,7 +4104,24 @@ namespace OpenSim.Region.Framework.Scenes CameraPosition = cAgentData.Center + offset; if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) - ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); + { + // some scaling factor + float x = m_pos.X; + if (x > m_scene.RegionInfo.RegionSizeX) + x -= m_scene.RegionInfo.RegionSizeX; + float y = m_pos.Y; + if (y > m_scene.RegionInfo.RegionSizeY) + y -= m_scene.RegionInfo.RegionSizeY; + + x = x * x + y * y; + + const float distScale = 0.4f / Constants.RegionSize / Constants.RegionSize; + float factor = 1.0f - distScale * x; + if (factor < 0.2f) + factor = 0.2f; + + ControllingClient.SetChildAgentThrottle(cAgentData.Throttles,factor); + } if(cAgentData.ChildrenCapSeeds != null && cAgentData.ChildrenCapSeeds.Count >0) { -- cgit v1.1