diff options
author | UbitUmarov | 2016-01-26 20:39:37 +0000 |
---|---|---|
committer | UbitUmarov | 2016-01-26 20:39:37 +0000 |
commit | 109723dc2df4c6f7fc0309911eb2d99988713431 (patch) | |
tree | 7d0ca9d4a5df67085f49387fe45fe24cc0cf528f /OpenSim | |
parent | BulletSim: increase default value of AvatarStopZeroThreshold as this reduces (diff) | |
download | opensim-SC_OLD-109723dc2df4c6f7fc0309911eb2d99988713431.zip opensim-SC_OLD-109723dc2df4c6f7fc0309911eb2d99988713431.tar.gz opensim-SC_OLD-109723dc2df4c6f7fc0309911eb2d99988713431.tar.bz2 opensim-SC_OLD-109723dc2df4c6f7fc0309911eb2d99988713431.tar.xz |
add option MaxRegionsViewDistance to control the maximum range to tell viewer to connect to Neighbour regions, since that is diferent from view range
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 8 | ||||
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 7 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 40 |
3 files changed, 48 insertions, 7 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 18bd5e5..e5d725c 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -801,7 +801,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
801 | int newSizeX = finalDestination.RegionSizeX; | 801 | int newSizeX = finalDestination.RegionSizeX; |
802 | int newSizeY = finalDestination.RegionSizeY; | 802 | int newSizeY = finalDestination.RegionSizeY; |
803 | 803 | ||
804 | bool OutSideViewRange = NeedsNewAgent(sp.DrawDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, | 804 | bool OutSideViewRange = NeedsNewAgent(sp.RegionViewDistance, oldRegionX, newRegionX, oldRegionY, newRegionY, |
805 | oldSizeX, oldSizeY, newSizeX, newSizeY); | 805 | oldSizeX, oldSizeY, newSizeX, newSizeY); |
806 | 806 | ||
807 | if (OutSideViewRange) | 807 | if (OutSideViewRange) |
@@ -1338,7 +1338,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1338 | // This returns 'true' if the new region already has a child agent for our | 1338 | // This returns 'true' if the new region already has a child agent for our |
1339 | // incoming agent. The implication is that, if 'false', we have to create the | 1339 | // incoming agent. The implication is that, if 'false', we have to create the |
1340 | // child and then teleport into the region. | 1340 | // child and then teleport into the region. |
1341 | protected virtual bool NeedsNewAgent(float drawdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, | 1341 | protected virtual bool NeedsNewAgent(float viewdist, uint oldRegionX, uint newRegionX, uint oldRegionY, uint newRegionY, |
1342 | int oldsizeX, int oldsizeY, int newsizeX, int newsizeY) | 1342 | int oldsizeX, int oldsizeY, int newsizeX, int newsizeY) |
1343 | { | 1343 | { |
1344 | if (m_regionCombinerModule != null && m_regionCombinerModule.IsRootForMegaregion(Scene.RegionInfo.RegionID)) | 1344 | if (m_regionCombinerModule != null && m_regionCombinerModule.IsRootForMegaregion(Scene.RegionInfo.RegionID)) |
@@ -1353,7 +1353,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1353 | return !(newRegionX >= swCorner.X && newRegionX <= neCorner.X && newRegionY >= swCorner.Y && newRegionY <= neCorner.Y); | 1353 | return !(newRegionX >= swCorner.X && newRegionX <= neCorner.X && newRegionY >= swCorner.Y && newRegionY <= neCorner.Y); |
1354 | } | 1354 | } |
1355 | 1355 | ||
1356 | return Util.IsOutsideView(drawdist, oldRegionX, newRegionX, oldRegionY, newRegionY, | 1356 | return Util.IsOutsideView(viewdist, oldRegionX, newRegionX, oldRegionY, newRegionY, |
1357 | oldsizeX, oldsizeY, newsizeX, newsizeY); | 1357 | oldsizeX, oldsizeY, newsizeX, newsizeY); |
1358 | } | 1358 | } |
1359 | 1359 | ||
@@ -2449,7 +2449,7 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
2449 | // view to include everything in the megaregion | 2449 | // view to include everything in the megaregion |
2450 | if (m_regionCombinerModule == null || !m_regionCombinerModule.IsRootForMegaregion(Scene.RegionInfo.RegionID)) | 2450 | if (m_regionCombinerModule == null || !m_regionCombinerModule.IsRootForMegaregion(Scene.RegionInfo.RegionID)) |
2451 | { | 2451 | { |
2452 | uint dd = (uint)avatar.DrawDistance; | 2452 | uint dd = (uint)avatar.RegionViewDistance; |
2453 | 2453 | ||
2454 | // until avatar movement updates client connections, we need to seend at least this current region imediate Neighbors | 2454 | // until avatar movement updates client connections, we need to seend at least this current region imediate Neighbors |
2455 | uint ddX = Math.Max(dd, Constants.RegionSize); | 2455 | uint ddX = Math.Max(dd, Constants.RegionSize); |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 5799cd4..acffd4a 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -296,6 +296,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
296 | get { return m_maxDrawDistance; } | 296 | get { return m_maxDrawDistance; } |
297 | } | 297 | } |
298 | 298 | ||
299 | protected float m_maxRegionViewDistance = 255f; | ||
300 | public float MaxRegionViewDistance | ||
301 | { | ||
302 | get { return m_maxRegionViewDistance; } | ||
303 | } | ||
304 | |||
299 | private List<string> m_AllowedViewers = new List<string>(); | 305 | private List<string> m_AllowedViewers = new List<string>(); |
300 | private List<string> m_BannedViewers = new List<string>(); | 306 | private List<string> m_BannedViewers = new List<string>(); |
301 | 307 | ||
@@ -972,6 +978,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
972 | 978 | ||
973 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); | 979 | m_defaultDrawDistance = startupConfig.GetFloat("DefaultDrawDistance", m_defaultDrawDistance); |
974 | m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance); | 980 | m_maxDrawDistance = startupConfig.GetFloat("MaxDrawDistance", m_maxDrawDistance); |
981 | m_maxRegionViewDistance = startupConfig.GetFloat("MaxRegionsViewDistance", m_maxRegionViewDistance); | ||
975 | 982 | ||
976 | LegacySitOffsets = startupConfig.GetBoolean("LegacyOpenSimSitOffsets", LegacySitOffsets); | 983 | LegacySitOffsets = startupConfig.GetBoolean("LegacyOpenSimSitOffsets", LegacySitOffsets); |
977 | 984 | ||
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index fa35691..7f0ab3f 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -583,6 +583,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
583 | } | 583 | } |
584 | } | 584 | } |
585 | 585 | ||
586 | public float RegionViewDistance | ||
587 | { | ||
588 | get | ||
589 | { | ||
590 | return Util.Clamp(m_drawDistance, 32f, m_scene.MaxRegionViewDistance); | ||
591 | } | ||
592 | } | ||
593 | |||
586 | public bool AllowMovement { get; set; } | 594 | public bool AllowMovement { get; set; } |
587 | 595 | ||
588 | private bool m_setAlwaysRun; | 596 | private bool m_setAlwaysRun; |
@@ -3566,7 +3574,33 @@ namespace OpenSim.Region.Framework.Scenes | |||
3566 | || (!m_pos.ApproxEquals(m_lastPosition, POSITION_SMALLTOLERANCE) && Velocity.LengthSquared() < LOWVELOCITYSQ ) | 3574 | || (!m_pos.ApproxEquals(m_lastPosition, POSITION_SMALLTOLERANCE) && Velocity.LengthSquared() < LOWVELOCITYSQ ) |
3567 | ) ) | 3575 | ) ) |
3568 | { | 3576 | { |
3569 | SendTerseUpdateToAllClients(); | 3577 | /* |
3578 | if (!IsSatOnObject) | ||
3579 | { | ||
3580 | // this does need to be more complex later | ||
3581 | Vector3 vel = Velocity; | ||
3582 | Vector3 dpos = m_pos - m_lastPosition; | ||
3583 | if( Math.Abs(vel.X - m_lastVelocity.X) > VELOCITY_TOLERANCE || | ||
3584 | Math.Abs(vel.Y - m_lastVelocity.Y) > VELOCITY_TOLERANCE || | ||
3585 | Math.Abs(vel.Z - m_lastVelocity.Z) > VELOCITY_TOLERANCE || | ||
3586 | |||
3587 | Math.Abs(m_bodyRot.X - m_lastRotation.X) > ROTATION_TOLERANCE || | ||
3588 | Math.Abs(m_bodyRot.Y - m_lastRotation.Y) > ROTATION_TOLERANCE || | ||
3589 | Math.Abs(m_bodyRot.Z - m_lastRotation.Z) > ROTATION_TOLERANCE || | ||
3590 | |||
3591 | Math.Abs(dpos.X) > POSITION_LARGETOLERANCE || | ||
3592 | Math.Abs(dpos.Y) > POSITION_LARGETOLERANCE || | ||
3593 | Math.Abs(dpos.Z) > POSITION_LARGETOLERANCE || | ||
3594 | |||
3595 | ( (Math.Abs(dpos.X) > POSITION_SMALLTOLERANCE || | ||
3596 | Math.Abs(dpos.Y) > POSITION_SMALLTOLERANCE || | ||
3597 | Math.Abs(dpos.Z) > POSITION_SMALLTOLERANCE) | ||
3598 | && vel.LengthSquared() < LOWVELOCITYSQ | ||
3599 | )) | ||
3600 | { | ||
3601 | */ | ||
3602 | SendTerseUpdateToAllClients(); | ||
3603 | // } | ||
3570 | } | 3604 | } |
3571 | CheckForSignificantMovement(); | 3605 | CheckForSignificantMovement(); |
3572 | } | 3606 | } |
@@ -4184,7 +4218,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4184 | 4218 | ||
4185 | // m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); | 4219 | // m_log.Debug("---> x: " + x + "; newx:" + newRegionX + "; Abs:" + (int)Math.Abs((int)(x - newRegionX))); |
4186 | // m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); | 4220 | // m_log.Debug("---> y: " + y + "; newy:" + newRegionY + "; Abs:" + (int)Math.Abs((int)(y - newRegionY))); |
4187 | if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY, | 4221 | if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, |
4188 | regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY)) | 4222 | regInfo.sizeX, regInfo.sizeY, newRegionSizeX, newRegionSizeY)) |
4189 | { | 4223 | { |
4190 | byebyeRegions.Add(handle); | 4224 | byebyeRegions.Add(handle); |
@@ -4195,7 +4229,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4195 | } | 4229 | } |
4196 | else | 4230 | else |
4197 | { | 4231 | { |
4198 | if (Util.IsOutsideView(DrawDistance, x, newRegionX, y, newRegionY, | 4232 | if (Util.IsOutsideView(RegionViewDistance, x, newRegionX, y, newRegionY, |
4199 | (int)Constants.RegionSize, (int)Constants.RegionSize, newRegionSizeX, newRegionSizeY)) | 4233 | (int)Constants.RegionSize, (int)Constants.RegionSize, newRegionSizeX, newRegionSizeY)) |
4200 | { | 4234 | { |
4201 | byebyeRegions.Add(handle); | 4235 | byebyeRegions.Add(handle); |