only then smaler then region

master
Christopher Latza 2020-06-10 18:24:03 +02:00
parent a1ca6409dd
commit 380d71511c
1 changed files with 17 additions and 7 deletions

View File

@ -125,10 +125,20 @@ namespace OpenSim.Modules.PathFinding
private bool checkIsPositionBlockedByObjekts(int posX, int posY)
{
List<SceneObjectGroup> _objects = m_scene.GetSceneObjectGroups().FindAll(X => X.IsPhantom != true && (int)X.AbsolutePosition.X == posX && (int)X.AbsolutePosition.Y == posY);
List<SceneObjectGroup> _objects = m_scene.GetSceneObjectGroups().FindAll(X => X.IsPhantom != true);
if (_objects.Count != 0)
return true;
foreach(SceneObjectGroup _object in _objects)
{
SceneObjectPart[] _parts = _object.Parts;
foreach (SceneObjectPart _part in _parts)
{
if ((int)_part.AbsolutePosition.X == posX && (int)_part.AbsolutePosition.Y == posY)
{
return true;
}
}
}
return false;
}
@ -137,10 +147,10 @@ namespace OpenSim.Modules.PathFinding
{
Bitmap _map = new Bitmap((int)m_scene.RegionInfo.RegionSizeX, (int)m_scene.RegionInfo.RegionSizeY);
for (int X = 0; X <= m_scene.RegionInfo.RegionSizeX; X++)
for (int X = 0; X < m_scene.RegionInfo.RegionSizeX; X++)
{
m_log.Info("X: " + X);
for (int Y = 0; Y <= m_scene.RegionInfo.RegionSizeY; Y++)
for (int Y = 0; Y < m_scene.RegionInfo.RegionSizeY; Y++)
{
m_log.Info("Y: " + Y);
@ -151,8 +161,8 @@ namespace OpenSim.Modules.PathFinding
if (baseheight <= m_scene.RegionInfo.RegionSettings.WaterHeight)
_map.SetPixel(X, Y, Color.Red);
//if (checkIsPositionBlockedByObjekts(new LSL_Vector(X, Y, 0)) == true)
//_map.SetPixel(X, Y, Color.Yellow);
if (checkIsPositionBlockedByObjekts(X, Y) == true)
_map.SetPixel(X, Y, Color.Yellow);
}
}