add debug
parent
ff97551e68
commit
fc2c870e05
|
@ -68,15 +68,27 @@ namespace OpenSim.Modules.PathFinding
|
|||
NodeInfo _infoNode = m_nodes.Find(X => X.Position.X.Equals(position.X) && X.Position.Y.Equals(position.Y));
|
||||
|
||||
if(_infoNode != null)
|
||||
{
|
||||
_infoNode.Blocked = state;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("setNoteBlocked: Cant find Node at " + position.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private bool getNoteBlocked(Vector2 position)
|
||||
{
|
||||
NodeInfo _infoNode = m_nodes.Find(X => X.Position.X.Equals(position.X) && X.Position.Y.Equals(position.Y));
|
||||
|
||||
if (_infoNode != null)
|
||||
{
|
||||
return _infoNode.Blocked;
|
||||
}
|
||||
else
|
||||
{
|
||||
Console.WriteLine("getNoteBlocked: Cant find Node at " + position.ToString());
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
@ -100,10 +112,13 @@ namespace OpenSim.Modules.PathFinding
|
|||
{
|
||||
Color _pixelColor = bitmap.GetPixel(X, Y);
|
||||
|
||||
if (_pixelColor.Equals(Color.Black))
|
||||
setNoteBlocked(new Vector2(X, Y), true);
|
||||
Console.WriteLine("convertBitmapToNodeList: X:"+X+" Y:"+Y+" COLOR:" + _pixelColor.R +";" + _pixelColor.G + ";" + _pixelColor.B);
|
||||
|
||||
bool blocking = true;
|
||||
|
||||
if (_pixelColor.R == 255)
|
||||
blocking = false;
|
||||
|
||||
if (_pixelColor.Equals(Color.White))
|
||||
setNoteBlocked(new Vector2(X, Y), false);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue