private static bool GetNextHullPoint(PolygonCreationAssistance pca, ref Vector2 last, ref Vector2 current,
out Vector2 next)
{
int x;
int y;
int indexOfFirstPixelToCheck = GetIndexOfFirstPixelToCheck(last, current);
int indexOfPixelToCheck;
const int pixelsToCheck = 8; // _closePixels.Length;
for (int i = 0; i < pixelsToCheck; i++)
{
indexOfPixelToCheck = (indexOfFirstPixelToCheck + i) % pixelsToCheck;
x = (int)current.X + ClosePixels[indexOfPixelToCheck, 0];
y = (int)current.Y + ClosePixels[indexOfPixelToCheck, 1];
if (x >= 0 && x < pca.Width && y >= 0 && y <= pca.Height)
{
if (pca.IsSolid(x, y)) //todo
{
next = new Vector2(x, y);
return(true);
}
}
}
next = Vector2.Zero;
return(false);
}