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; } } }