int index = 0;
for (int x = 0; x < 32; x++) {
for (int y = 0; y < 16; y++) {
for (int z = 0; z < 32; z++) {
Block block = this.chunk.get(x, y, z);
if (block instanceof BlockEmpty)
continue;
int px = x / 2;
if (x % 2 == 0) {
HexGeometry.hexToCartesian(px, y, a);
HexGeometry.hexToCartesian(px, y + 1, b);
HexGeometry.hexToCartesian(px + 1, y, c);
HexGeometry.hexToCartesian(px + 0.5, y + 0.5, d);
} else {
HexGeometry.hexToCartesian(px + 1, y + 1, a);
HexGeometry.hexToCartesian(px, y + 1, b);
HexGeometry.hexToCartesian(px + 1, y, c);
HexGeometry.hexToCartesian(px + 0.5, y + 0.5, d);
}
Block blockZP = this.chunks.getBlock(this.chunk.cx, this.chunk.cy,
this.chunk.cz, x, y, z + 1, tmp, chunk);
boolean displayZP = display(block, blockZP, Face.TOP);
Block blockZM = this.chunks.getBlock(this.chunk.cx, this.chunk.cy,
this.chunk.cz, x, y, z - 1, tmp, chunk);
boolean displayZM = display(block, blockZM, Face.BOTTOM);
// NOTE faces wrong but it doesn't matter here, see below
// for correct
Block blockXP = this.chunks.getBlock(this.chunk.cx, this.chunk.cy,
this.chunk.cz, x + 1, y, z, tmp, chunk);
boolean displayXP = display(block, blockXP, Face.SIDEA);
Block blockXM = this.chunks.getBlock(this.chunk.cx, this.chunk.cy,
this.chunk.cz, x - 1, y, z, tmp, chunk);
boolean displayXM = display(block, blockXM, Face.SIDEB);
Block blockYP = this.chunks.getBlock(this.chunk.cx, this.chunk.cy,
this.chunk.cz, x - 1, y + 1, z, tmp, chunk);
boolean displayYP = display(block, blockYP, Face.SIDEC);
Block blockYM = this.chunks.getBlock(this.chunk.cx, this.chunk.cy,
this.chunk.cz, x + 1, y - 1, z, tmp, chunk);
boolean displayYM = display(block, blockYM, Face.SIDEB);
double fracBottom = block.getFracBottom();
double fracTop = block.getFracTop();