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