Exemplo n.º 1
0
void Face::tryGoUp(queue<Vertex> &queue, Vertex &v)
{
	Vertex next = v;
	switch(orientation)
	{
		case zFace:
			y(next)++;
			if(squares.count(next))
				return;
			if(crossesBorder(v, next, upDir))
				return;
			break;
		case xFace:
		case yFace:
			z(next)++;
			if(squares.count(next))
				return;
			if(crossesBorder(v, next, frontDir))
				return;
			break;
	}

	squares.insert(next);
	queue.push(next);
}
Exemplo n.º 2
0
void Face::tryGoLeft(queue<Vertex> &queue, Vertex &v)
{
	Vertex next = v;
	switch(orientation)
	{
		case zFace:
		case yFace:
			x(next)--;
			if(squares.count(next))
				return;
			if(crossesBorder(v, next, leftDir))
				return;
			break;
		case xFace:
			y(next)--;
			if(squares.count(next))
				return;
			if(crossesBorder(v, next, downDir))
			    return;
			break;
	}

	squares.insert(next);
	queue.push(next);
}
Exemplo n.º 3
0
void tryGoUp(queue<Vertex> &queue, Vertex v)
{
	y(v)++;

	if(borderSquares[yFace]->count(v))
		return;

	if(blocks.count(v))
		return;

	blocks.insert(v);
	queue.push(v);
}
Exemplo n.º 4
0
void tryGoDown(queue<Vertex> &queue, Vertex v)
{
	if(borderSquares[yFace]->count(v))
		return;

	y(v)--;

	if(blocks.count(v))
		return;

	blocks.insert(v);
	queue.push(v);
}