diff options
author | UbitUmarov | 2014-11-06 22:25:16 +0000 |
---|---|---|
committer | UbitUmarov | 2014-11-06 22:25:16 +0000 |
commit | caddabb5c4f62767305a589e9d818ae3457a8030 (patch) | |
tree | 89d3c6715ec83d1ce8358674b48227c9d77ee2e3 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | allow drawdistance to change between 32 and MaxDrawDistance, configurable (diff) | |
download | opensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.zip opensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.tar.gz opensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.tar.bz2 opensim-SC_OLD-caddabb5c4f62767305a589e9d818ae3457a8030.tar.xz |
scale ChildAgentThrottles with distance (internal to child server and not
root as was done before )
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 19 |
1 files changed, 18 insertions, 1 deletions
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 | |||
4104 | CameraPosition = cAgentData.Center + offset; | 4104 | CameraPosition = cAgentData.Center + offset; |
4105 | 4105 | ||
4106 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) | 4106 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
4107 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | 4107 | { |
4108 | // some scaling factor | ||
4109 | float x = m_pos.X; | ||
4110 | if (x > m_scene.RegionInfo.RegionSizeX) | ||
4111 | x -= m_scene.RegionInfo.RegionSizeX; | ||
4112 | float y = m_pos.Y; | ||
4113 | if (y > m_scene.RegionInfo.RegionSizeY) | ||
4114 | y -= m_scene.RegionInfo.RegionSizeY; | ||
4115 | |||
4116 | x = x * x + y * y; | ||
4117 | |||
4118 | const float distScale = 0.4f / Constants.RegionSize / Constants.RegionSize; | ||
4119 | float factor = 1.0f - distScale * x; | ||
4120 | if (factor < 0.2f) | ||
4121 | factor = 0.2f; | ||
4122 | |||
4123 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles,factor); | ||
4124 | } | ||
4108 | 4125 | ||
4109 | if(cAgentData.ChildrenCapSeeds != null && cAgentData.ChildrenCapSeeds.Count >0) | 4126 | if(cAgentData.ChildrenCapSeeds != null && cAgentData.ChildrenCapSeeds.Count >0) |
4110 | { | 4127 | { |