private void renderBase(Tessellator v5, CrystalRenderedBlock b) {
IIcon ico = b.getBaseBlock(ForgeDirection.UP).getIcon(0, 0);
int w = ico.getIconWidth();
v5.setColorOpaque(255, 255, 255);
double u = ico.getMinU();
double v = ico.getMinV();
double xu = ico.getMaxU();
double xv = ico.getMaxV();
double top = 0.125;
v5.addVertexWithUV(0, top, 1, u, xv);
v5.addVertexWithUV(1, top, 1, xu, xv);
v5.addVertexWithUV(1, top, 0, xu, v);
v5.addVertexWithUV(0, top, 0, u, v);
v5.setColorOpaque(110, 110, 110);
v5.addVertexWithUV(0, 0, 0, u, v);
v5.addVertexWithUV(1, 0, 0, xu, v);
v5.addVertexWithUV(1, 0, 1, xu, xv);
v5.addVertexWithUV(0, 0, 1, u, xv);
ico = b.getBaseBlock(ForgeDirection.EAST).getIcon(0, 0);
u = ico.getMinU();
v = ico.getMinV();
xu = ico.getMaxU();
xv = ico.getMaxV();
double vv = v+(xv-v)/(w)*2;
v5.setColorOpaque(200, 200, 200);
v5.addVertexWithUV(0, top, 0, u, vv);
v5.addVertexWithUV(1, top, 0, xu, vv);
v5.addVertexWithUV(1, 0, 0, xu, v);
v5.addVertexWithUV(0, 0, 0, u, v);
v5.setColorOpaque(170, 170, 170);
v5.addVertexWithUV(0, 0, 1, u, v);
v5.addVertexWithUV(1, 0, 1, xu, v);
v5.addVertexWithUV(1, top, 1, xu, vv);
v5.addVertexWithUV(0, top, 1, u, vv);
v5.setColorOpaque(200, 200, 200);
v5.addVertexWithUV(0, 0, 0, u, v);
v5.addVertexWithUV(0, 0, 1, xu, v);
v5.addVertexWithUV(0, top, 1, xu, vv);
v5.addVertexWithUV(0, top, 0, u, vv);
v5.setColorOpaque(170, 170, 170);
v5.addVertexWithUV(1, top, 0, u, vv);
v5.addVertexWithUV(1, top, 1, xu, vv);
v5.addVertexWithUV(1, 0, 1, xu, v);
v5.addVertexWithUV(1, 0, 0, u, v);
}
private void renderOutline(Tessellator v5) {
double core = 0.15;
double vl = 0.8;
double dd = 0.01;
double tip = 1;
double zf = 0.4;
v5.addVertexWithUV(0.5+core-dd, 0, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5+core+dd, 0, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5+core+dd, vl, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5+core-dd, vl, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5+core, 0, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5+core, 0, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5+core, vl, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5+core, vl, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5-core-dd, 0, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5-core+dd, 0, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5-core+dd, vl, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5-core-dd, vl, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5-core, 0, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5-core, 0, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5-core, vl, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5-core, vl, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5+core-dd, 0, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5+core+dd, 0, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5+core+dd, vl, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5+core-dd, vl, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5+core, 0, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5+core, 0, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5+core, vl, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5+core, vl, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5-core-dd, 0, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5-core+dd, 0, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5-core+dd, vl, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5-core-dd, vl, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5+core, 0, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5+core, 0, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5+core, vl, 0.5-core+dd, 0, 0);
v5.addVertexWithUV(0.5+core, vl, 0.5-core-dd, 0, 0);
v5.addVertexWithUV(0.5+core, vl, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5+core, vl+dd, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5, tip+dd, 0.5, 0, 0);
v5.addVertexWithUV(0.5, tip, 0.5, 0, 0);
v5.addVertexWithUV(0.5+core-dd*zf, vl, 0.5+core+dd*zf, 0, 0);
v5.addVertexWithUV(0.5+core+dd*zf, vl, 0.5+core-dd*zf, 0, 0);
v5.addVertexWithUV(0.5+dd*zf, tip, 0.5-dd*zf, 0, 0);
v5.addVertexWithUV(0.5-dd*zf, tip, 0.5+dd*zf, 0, 0);
v5.addVertexWithUV(0.5-core, vl, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5-core, vl+dd, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5, tip+dd, 0.5, 0, 0);
v5.addVertexWithUV(0.5, tip, 0.5, 0, 0);
v5.addVertexWithUV(0.5-core-dd*zf, vl, 0.5-core+dd*zf, 0, 0);
v5.addVertexWithUV(0.5-core+dd*zf, vl, 0.5-core-dd*zf, 0, 0);
v5.addVertexWithUV(0.5+dd*zf, tip, 0.5-dd*zf, 0, 0);
v5.addVertexWithUV(0.5-dd*zf, tip, 0.5+dd*zf, 0, 0);
v5.addVertexWithUV(0.5-core, vl, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5-core, vl+dd, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5, tip+dd, 0.5, 0, 0);
v5.addVertexWithUV(0.5, tip, 0.5, 0, 0);
v5.addVertexWithUV(0.5+core+dd, vl+dd, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5+core-dd, vl+dd, 0.5-core, 0, 0);
v5.addVertexWithUV(0.5-dd, tip+dd, 0.5, 0, 0);
v5.addVertexWithUV(0.5+dd, tip+dd, 0.5, 0, 0);
v5.addVertexWithUV(0.5-core, vl, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5-core, vl+dd, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5, tip+dd, 0.5, 0, 0);
v5.addVertexWithUV(0.5, tip, 0.5, 0, 0);
v5.addVertexWithUV(0.5-core+dd, vl+dd, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5-core-dd, vl+dd, 0.5+core, 0, 0);
v5.addVertexWithUV(0.5-dd, tip+dd, 0.5, 0, 0);
v5.addVertexWithUV(0.5+dd, tip+dd, 0.5, 0, 0);
}
private void renderSpike(Tessellator v5, double u, double v, double xu, double xv, int w) {
double core = 0.15;
double vl = 0.8;
// Top point
v5.addVertexWithUV(0.5-core, vl, 0.5-core, u, v);
v5.addVertexWithUV(0.5-core, vl, 0.5+core, xu, v);
v5.addVertexWithUV(0.5, 1, 0.5, xu, xv);
v5.addVertexWithUV(0.5, 1, 0.5, xu, xv);
v5.addVertexWithUV(0.5-core, vl, 0.5+core, u, v);
v5.addVertexWithUV(0.5+core, vl, 0.5+core, xu, v);
v5.addVertexWithUV(0.5, 1, 0.5, xu, xv);
v5.addVertexWithUV(0.5, 1, 0.5, xu, xv);
v5.addVertexWithUV(0.5, 1, 0.5, u, xv);
v5.addVertexWithUV(0.5, 1, 0.5, xu, xv);
v5.addVertexWithUV(0.5+core, vl, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core, vl, 0.5-core, u, v);
v5.addVertexWithUV(0.5, 1, 0.5, u, xv);
v5.addVertexWithUV(0.5, 1, 0.5, xu, xv);
v5.addVertexWithUV(0.5+core, vl, 0.5-core, xu, v);
v5.addVertexWithUV(0.5-core, vl, 0.5-core, u, v);
xv -= (xv-v)/w;
v += (xv-v)/(w*1.2);
u += (xu-u)/(w*2);
xu -= (xu-u)/(w*2);
//columns
v5.addVertexWithUV(0.5-core, vl, 0.5-core, u, xv);
v5.addVertexWithUV(0.5+core, vl, 0.5-core, xu, xv);
v5.addVertexWithUV(0.5+core, 0, 0.5-core, xu, v);
v5.addVertexWithUV(0.5-core, 0, 0.5-core, u, v);
v5.addVertexWithUV(0.5-core, 0, 0.5+core, u, v);
v5.addVertexWithUV(0.5+core, 0, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core, vl, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5-core, vl, 0.5+core, u, xv);
v5.addVertexWithUV(0.5+core, vl, 0.5-core, u, xv);
v5.addVertexWithUV(0.5+core, vl, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5+core, 0, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core, 0, 0.5-core, u, v);
v5.addVertexWithUV(0.5-core, 0, 0.5-core, u, v);
v5.addVertexWithUV(0.5-core, 0, 0.5+core, xu, v);
v5.addVertexWithUV(0.5-core, vl, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5-core, vl, 0.5-core, u, xv);
//bottom
v5.addVertexWithUV(0.5+core, 0, 0.5-core, u, xv);
v5.addVertexWithUV(0.5+core, 0, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5-core, 0, 0.5+core, xu, v);
v5.addVertexWithUV(0.5-core, 0, 0.5-core, u, v);
}
private void renderXAngledSpike(double u, double v, double xu, double xv, double out, int w) {
double core = 0.12;
double vl = 0.55;
double dvl = vl/6D;
double dy = -0.05;
double tout = out;
double htip = 0.1;
int dir = out > 0 ? 1 : -1;
TessellatorVertexList v5 = new TessellatorVertexList();
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5+core, u, v);
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5-core, xu, v);
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, xu, xv); //tip
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, xu, xv);
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, u, xv);
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, xu, xv); //tip
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5-core, xu, v);
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5+core, u, v);
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, u, xv);
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, xu, xv); //tip
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5+core, u, v);
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5-core, u, v);
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5-core, xu, v);
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, xu, xv); //tip
v5.addVertexWithUV(0.5+core*dir+out+tout, dy+vl+dvl+htip, 0.5, xu, xv);
xv -= (xv-v)/w;
v += (xv-v)/(w*1.2);
u += (xu-u)/(w*2);
xu -= (xu-u)/(w*2);
//panels
v5.addVertexWithUV(0.5+core*dir, dy+dvl, 0.5-core, u, v);
v5.addVertexWithUV(0.5+core*dir*3, dy+0, 0.5-core, xu, v);
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5-core, xu, xv);
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5-core, u, xv);
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5+core, u, xv);
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5+core*dir*3, dy+0, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core*dir, dy+dvl, 0.5+core, u, v);
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5-core, u, xv);
v5.addVertexWithUV(0.5+core*dir+out, dy+vl+dvl, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5+core*dir, dy+dvl, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core*dir, dy+dvl, 0.5-core, u, v);
v5.addVertexWithUV(0.5+core*dir*3, dy, 0.5-core, u, v);
v5.addVertexWithUV(0.5+core*dir*3, dy, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5+core*dir*3+out, dy+vl, 0.5-core, u, xv);
//base
v5.addVertexWithUV(0.5-core*dir*3+out*2.56, dy+dvl, 0.5-core, u, xv);
v5.addVertexWithUV(0.5-core*dir*3+out*2.56, dy+dvl, 0.5+core, xu, xv);
v5.addVertexWithUV(0.5+core*dir*3, dy, 0.5+core, xu, v);
v5.addVertexWithUV(0.5+core*dir*3, dy, 0.5-core, u, v);
if (out > 0)
v5.reverse();
v5.render();
}
private void renderZAngledSpike(double u, double v, double xu, double xv, double out, int w) {
double core = 0.12;
double vl = 0.55;
double dvl = vl/6D;
double dy = -0.1;
double tout = out;//0.1875;
double htip = 0.1;
int dir = out > 0 ? 1 : -1;
TessellatorVertexList v5 = new TessellatorVertexList();
v5.addVertexWithUV(0.5+core, dy+vl+dvl, 0.5+core*dir+out, u, v);
v5.addVertexWithUV(0.5-core, dy+vl+dvl, 0.5+core*dir+out, xu, v);
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, xu, xv); //tip
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, u, xv);
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, xu, xv);
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, xu, xv); //tip
v5.addVertexWithUV(0.5-core, dy+vl, 0.5+core*dir*3+out, xu, v);
v5.addVertexWithUV(0.5+core, dy+vl, 0.5+core*dir*3+out, u, v);
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, xu, xv);
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, xu, xv); //tip
v5.addVertexWithUV(0.5+core, dy+vl, 0.5+core*dir*3+out, xu, v);
v5.addVertexWithUV(0.5+core, dy+vl+dvl, 0.5+core*dir+out, u, v);
v5.addVertexWithUV(0.5-core, dy+vl+dvl, 0.5+core*dir+out, u, v);
v5.addVertexWithUV(0.5-core, dy+vl, 0.5+core*dir*3+out, xu, v);
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, xu, xv); //tip
v5.addVertexWithUV(0.5, dy+vl+dvl+htip, 0.5+core*dir+out+tout, u, xv);
xv -= (xv-v)/w;
v += (xv-v)/(w*1.2);
u += (xu-u)/(w*2);
xu -= (xu-u)/(w*2);
//panels
v5.addVertexWithUV(0.5-core, dy+dvl, 0.5+core*dir, u, v);
v5.addVertexWithUV(0.5-core, dy+0, 0.5+core*dir*3, xu, v);
v5.addVertexWithUV(0.5-core, dy+vl, 0.5+core*dir*3+out, xu, xv);
v5.addVertexWithUV(0.5-core, dy+vl+dvl, 0.5+core*dir+out, u, xv);
v5.addVertexWithUV(0.5+core, dy+vl+dvl, 0.5+core*dir+out, u, xv);
v5.addVertexWithUV(0.5+core, dy+vl, 0.5+core*dir*3+out, xu, xv);
v5.addVertexWithUV(0.5+core, dy+0, 0.5+core*dir*3, xu, v);
v5.addVertexWithUV(0.5+core, dy+dvl, 0.5+core*dir, u, v);
v5.addVertexWithUV(0.5-core, dy+vl+dvl, 0.5+core*dir+out, u, xv);
v5.addVertexWithUV(0.5+core, dy+vl+dvl, 0.5+core*dir+out, xu, xv);
v5.addVertexWithUV(0.5+core, dy+dvl, 0.5+core*dir, xu, v);
v5.addVertexWithUV(0.5-core, dy+dvl, 0.5+core*dir, u, v);
v5.addVertexWithUV(0.5-core, dy, 0.5+core*dir*3, u, v);
v5.addVertexWithUV(0.5+core, dy, 0.5+core*dir*3, xu, v);
v5.addVertexWithUV(0.5+core, dy+vl, 0.5+core*dir*3+out, xu, xv);
v5.addVertexWithUV(0.5-core, dy+vl, 0.5+core*dir*3+out, u, xv);
//base
v5.addVertexWithUV(0.5-core, dy+dvl+0.0025, 0.5-core*dir*3+out*2.56, u, xv);
v5.addVertexWithUV(0.5+core, dy+dvl+0.0025, 0.5-core*dir*3+out*2.56, xu, xv);
v5.addVertexWithUV(0.5+core, dy, 0.5+core*dir*3, xu, v);
v5.addVertexWithUV(0.5-core, dy, 0.5+core*dir*3, u, v);
if (out < 0)
v5.reverse();
v5.render();
}