All pastes #41642 Raw Edit

Something

public text v1 · immutable
#41642 ·published 2006-02-14 19:14 UTC
rendered paste body
	for (;;) {
		unsigned int idx = ((z+1) * (_ny+2) + (y+1)) * (_nx+2) + (x+1);

		if (_bitmap[idx/32] & (1 << (idx % 32)))
			break;

		if (tMaxX < tMaxY) {
			if (tMaxX < tMaxZ) {
				x += XSTEP;
				tMaxX += tDeltaX;
				lastCoord = 0;
			} else {
				z += ZSTEP;
				tMaxZ += tDeltaZ;
				lastCoord = 2;
			}
		} else {
			if (tMaxY < tMaxZ) { 
				y += YSTEP;
				tMaxY += tDeltaY;
				lastCoord = 1;
			} else {
				z += ZSTEP;
				tMaxZ += tDeltaZ;
				lastCoord = 2;
			}
		}
	}