return dir == NORTH || dir == SOUTH || dir == EAST || dir == WEST || dir == UP || dir == DOWN;
}
protected void drawSection(BoundingBox bound, float minU, float maxU, float minV, float maxV, ForgeDirection dir, boolean isTransmission) {
Tessellator tessellator = Tessellator.instance;
if(isTransmission) {
setVerticesForTransmission(bound, dir);
} else {
setupVertices(bound);
}
if(dir == NORTH || dir == UP || dir == EAST) { // maintain consistent
// texture
// dir relative to the cneter
// of the conduit
float tmp = minU;
minU = maxU;
maxU = tmp;
}
boolean rotateSides = dir == UP || dir == DOWN;
boolean rotateTopBottom = dir == NORTH || dir == SOUTH;
float cm;
if(dir != NORTH && dir != SOUTH) {
tessellator.setNormal(0, 0, -1);
if(!isTransmission) {
cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.NORTH);
tessellator.setColorOpaque_F(cm, cm, cm);
}
if(rotateSides) {
addVecWithUV(verts[1], maxU, maxV);
addVecWithUV(verts[0], maxU, minV);
addVecWithUV(verts[3], minU, minV);
addVecWithUV(verts[2], minU, maxV);
} else {
addVecWithUV(verts[1], minU, minV);
addVecWithUV(verts[0], maxU, minV);
addVecWithUV(verts[3], maxU, maxV);
addVecWithUV(verts[2], minU, maxV);
}
if(dir == WEST || dir == EAST) {
float tmp = minU;
minU = maxU;
maxU = tmp;
}
tessellator.setNormal(0, 0, 1);
if(!isTransmission) {
cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.SOUTH);
tessellator.setColorOpaque_F(cm, cm, cm);
}
if(rotateSides) {
addVecWithUV(verts[4], maxU, maxV);
addVecWithUV(verts[5], maxU, minV);
addVecWithUV(verts[6], minU, minV);
addVecWithUV(verts[7], minU, maxV);
} else {
addVecWithUV(verts[4], minU, minV);
addVecWithUV(verts[5], maxU, minV);
addVecWithUV(verts[6], maxU, maxV);
addVecWithUV(verts[7], minU, maxV);
}
if(dir == WEST || dir == EAST) {
float tmp = minU;
minU = maxU;
maxU = tmp;
}
}
if(dir != UP && dir != DOWN) {
tessellator.setNormal(0, 1, 0);
if(!isTransmission) {
cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.UP);
tessellator.setColorOpaque_F(cm, cm, cm);
}
if(rotateTopBottom) {
addVecWithUV(verts[6], maxU, maxV);
addVecWithUV(verts[2], minU, maxV);
addVecWithUV(verts[3], minU, minV);
addVecWithUV(verts[7], maxU, minV);
} else {
addVecWithUV(verts[6], minU, minV);
addVecWithUV(verts[2], minU, maxV);
addVecWithUV(verts[3], maxU, maxV);
addVecWithUV(verts[7], maxU, minV);
}
tessellator.setNormal(0, -1, 0);
if(!isTransmission) {
cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.DOWN);
tessellator.setColorOpaque_F(cm, cm, cm);
}
if(rotateTopBottom) {
addVecWithUV(verts[0], minU, minV);
addVecWithUV(verts[1], minU, maxV);
addVecWithUV(verts[5], maxU, maxV);
addVecWithUV(verts[4], maxU, minV);
} else {
addVecWithUV(verts[0], maxU, maxV);
addVecWithUV(verts[1], minU, maxV);
addVecWithUV(verts[5], minU, minV);
addVecWithUV(verts[4], maxU, minV);
}
}
if(dir != EAST && dir != WEST) {
tessellator.setNormal(1, 0, 0);
if(!isTransmission) {
cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.EAST);
tessellator.setColorOpaque_F(cm, cm, cm);
}
if(rotateSides) {
addVecWithUV(verts[2], minU, maxV);
addVecWithUV(verts[6], minU, minV);
addVecWithUV(verts[5], maxU, minV);
addVecWithUV(verts[1], maxU, maxV);
} else {
addVecWithUV(verts[2], minU, maxV);
addVecWithUV(verts[6], maxU, maxV);
addVecWithUV(verts[5], maxU, minV);
addVecWithUV(verts[1], minU, minV);
}
tessellator.setNormal(-1, 0, 0);
if(!isTransmission) {
cm = RenderUtil.getColorMultiplierForFace(ForgeDirection.WEST);
tessellator.setColorOpaque_F(cm, cm, cm);
}
if(rotateSides) {
addVecWithUV(verts[0], maxU, maxV);
addVecWithUV(verts[4], maxU, minV);
addVecWithUV(verts[7], minU, minV);
addVecWithUV(verts[3], minU, maxV);
} else {
addVecWithUV(verts[0], minU, minV);
addVecWithUV(verts[4], maxU, minV);
addVecWithUV(verts[7], maxU, maxV);
addVecWithUV(verts[3], minU, maxV);
}
}
tessellator.setColorOpaque_F(1, 1, 1);
}