diff options
author | UbitUmarov | 2014-10-18 21:34:35 +0100 |
---|---|---|
committer | UbitUmarov | 2014-10-18 21:34:35 +0100 |
commit | fadc5661c9207c8d78816337842bf0e6aa24e6fc (patch) | |
tree | 4a9b099fa5a76b06dd10bb002ccec6b9a7d0cda3 /OpenSim/Region/CoreModules | |
parent | fix SW direction diagonal crossing (diff) | |
download | opensim-SC_OLD-fadc5661c9207c8d78816337842bf0e6aa24e6fc.zip opensim-SC_OLD-fadc5661c9207c8d78816337842bf0e6aa24e6fc.tar.gz opensim-SC_OLD-fadc5661c9207c8d78816337842bf0e6aa24e6fc.tar.bz2 opensim-SC_OLD-fadc5661c9207c8d78816337842bf0e6aa24e6fc.tar.xz |
change position in new region estimation. Reduce border jitter margin
Diffstat (limited to 'OpenSim/Region/CoreModules')
-rw-r--r-- | OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | 48 |
1 files changed, 14 insertions, 34 deletions
diff --git a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs index 9c8aada..ae571c0 100644 --- a/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs +++ b/OpenSim/Region/CoreModules/Framework/EntityTransfer/EntityTransferModule.cs | |||
@@ -1400,9 +1400,9 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1400 | // m_log.DebugFormat( | 1400 | // m_log.DebugFormat( |
1401 | // "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); | 1401 | // "[ENTITY TRANSFER MODULE]: Crossing agent {0} at pos {1} in {2}", agent.Name, pos, scene.Name); |
1402 | 1402 | ||
1403 | uint neighbourx = scene.RegionInfo.RegionLocX; | 1403 | uint neighbourx = scene.RegionInfo.RegionLocX; |
1404 | uint neighboury = scene.RegionInfo.RegionLocY; | 1404 | uint neighboury = scene.RegionInfo.RegionLocY; |
1405 | const float boundaryDistance = 1.7f; | 1405 | const float boundaryDistance = 0.7f; |
1406 | Vector3 northCross = new Vector3(0, boundaryDistance, 0); | 1406 | Vector3 northCross = new Vector3(0, boundaryDistance, 0); |
1407 | Vector3 southCross = new Vector3(0, -1 * boundaryDistance, 0); | 1407 | Vector3 southCross = new Vector3(0, -1 * boundaryDistance, 0); |
1408 | Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); | 1408 | Vector3 eastCross = new Vector3(boundaryDistance, 0, 0); |
@@ -1410,6 +1410,8 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1410 | 1410 | ||
1411 | // distance into new region to place avatar | 1411 | // distance into new region to place avatar |
1412 | const float enterDistance = 0.5f; | 1412 | const float enterDistance = 0.5f; |
1413 | const float maxX = Constants.RegionSize - enterDistance; | ||
1414 | const float maxY = Constants.RegionSize - enterDistance; | ||
1413 | 1415 | ||
1414 | if (scene.TestBorderCross(pos + westCross, Cardinals.W)) | 1416 | if (scene.TestBorderCross(pos + westCross, Cardinals.W)) |
1415 | { | 1417 | { |
@@ -1417,72 +1419,50 @@ namespace OpenSim.Region.CoreModules.Framework.EntityTransfer | |||
1417 | { | 1419 | { |
1418 | Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N); | 1420 | Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N); |
1419 | neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); | 1421 | neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); |
1420 | newpos.Y = enterDistance; | 1422 | newpos.Y -= Constants.RegionSize; |
1421 | } | 1423 | } |
1422 | else if (scene.TestBorderCross(pos + southCross, Cardinals.S)) | 1424 | else if (scene.TestBorderCross(pos + southCross, Cardinals.S)) |
1423 | { | 1425 | { |
1424 | neighboury--; | 1426 | neighboury--; |
1425 | newpos.Y = Constants.RegionSize - enterDistance; | 1427 | newpos.Y += Constants.RegionSize; |
1426 | } | 1428 | } |
1427 | 1429 | ||
1428 | neighbourx--; | 1430 | neighbourx--; |
1429 | newpos.X = Constants.RegionSize - enterDistance; | 1431 | newpos.X += Constants.RegionSize; |
1430 | } | 1432 | } |
1431 | else if (scene.TestBorderCross(pos + eastCross, Cardinals.E)) | 1433 | else if (scene.TestBorderCross(pos + eastCross, Cardinals.E)) |
1432 | { | 1434 | { |
1433 | Border b = scene.GetCrossedBorder(pos + eastCross, Cardinals.E); | 1435 | Border b = scene.GetCrossedBorder(pos + eastCross, Cardinals.E); |
1434 | neighbourx += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); | 1436 | neighbourx += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); |
1435 | newpos.X = enterDistance; | 1437 | newpos.X -= Constants.RegionSize; |
1436 | 1438 | ||
1437 | if (scene.TestBorderCross(pos + southCross, Cardinals.S)) | 1439 | if (scene.TestBorderCross(pos + southCross, Cardinals.S)) |
1438 | { | 1440 | { |
1439 | neighboury--; | 1441 | neighboury--; |
1440 | newpos.Y = Constants.RegionSize - enterDistance; | 1442 | newpos.Y += Constants.RegionSize; |
1441 | } | 1443 | } |
1442 | else if (scene.TestBorderCross(pos + northCross, Cardinals.N)) | 1444 | else if (scene.TestBorderCross(pos + northCross, Cardinals.N)) |
1443 | { | 1445 | { |
1444 | Border c = scene.GetCrossedBorder(pos + northCross, Cardinals.N); | 1446 | Border c = scene.GetCrossedBorder(pos + northCross, Cardinals.N); |
1445 | neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize); | 1447 | neighboury += (uint)(int)(c.BorderLine.Z / (int)Constants.RegionSize); |
1446 | newpos.Y = enterDistance; | 1448 | newpos.Y -= Constants.RegionSize; |
1447 | } | 1449 | } |
1448 | } | 1450 | } |
1449 | else if (scene.TestBorderCross(pos + southCross, Cardinals.S)) | 1451 | else if (scene.TestBorderCross(pos + southCross, Cardinals.S)) |
1450 | { | 1452 | { |
1451 | Border b = scene.GetCrossedBorder(pos + southCross, Cardinals.S); | 1453 | Border b = scene.GetCrossedBorder(pos + southCross, Cardinals.S); |
1452 | neighboury--; | 1454 | neighboury--; |
1453 | newpos.Y = Constants.RegionSize - enterDistance; | 1455 | newpos.Y += Constants.RegionSize; |
1454 | } | 1456 | } |
1455 | else if (scene.TestBorderCross(pos + northCross, Cardinals.N)) | 1457 | else if (scene.TestBorderCross(pos + northCross, Cardinals.N)) |
1456 | { | 1458 | { |
1457 | Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N); | 1459 | Border b = scene.GetCrossedBorder(pos + northCross, Cardinals.N); |
1458 | neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); | 1460 | neighboury += (uint)(int)(b.BorderLine.Z / (int)Constants.RegionSize); |
1459 | newpos.Y = enterDistance; | 1461 | newpos.Y -= Constants.RegionSize; |
1460 | } | 1462 | } |
1461 | 1463 | ||
1462 | /* | 1464 | newpos.X = Util.Clamp(newpos.X, enterDistance, maxX); |
1463 | 1465 | newpos.Y = Util.Clamp(newpos.Y, enterDistance, maxY); | |
1464 | if (pos.X < boundaryDistance) //West | ||
1465 | { | ||
1466 | neighbourx--; | ||
1467 | newpos.X = Constants.RegionSize - enterDistance; | ||
1468 | } | ||
1469 | else if (pos.X > Constants.RegionSize - boundaryDistance) // East | ||
1470 | { | ||
1471 | neighbourx++; | ||
1472 | newpos.X = enterDistance; | ||
1473 | } | ||
1474 | |||
1475 | if (pos.Y < boundaryDistance) // South | ||
1476 | { | ||
1477 | neighboury--; | ||
1478 | newpos.Y = Constants.RegionSize - enterDistance; | ||
1479 | } | ||
1480 | else if (pos.Y > Constants.RegionSize - boundaryDistance) // North | ||
1481 | { | ||
1482 | neighboury++; | ||
1483 | newpos.Y = enterDistance; | ||
1484 | } | ||
1485 | */ | ||
1486 | 1466 | ||
1487 | xDest = neighbourx; | 1467 | xDest = neighbourx; |
1488 | yDest = neighboury; | 1468 | yDest = neighboury; |