Java 类net.minecraftforge.client.model.pipeline.IVertexConsumer 实例源码

项目:Qbar    文件:VertexTransformerWrapper.java   
public VertexTransformerWrapper(final IVertexConsumer parent, final BakedQuad parentQuad,
                                final IVertexTransformer transformer)
{
    this.parent = parent;
    this.parentQuad = parentQuad;
    this.vertexFormat = parent.getVertexFormat();
    this.transformer = transformer;
}
项目:BaseClient    文件:BakedQuad.java   
public void pipe(IVertexConsumer p_pipe_1_)
{
    Reflector.callVoid(Reflector.LightUtil_putBakedQuad, new Object[] {p_pipe_1_, this});
}
项目:Backmemed    文件:BakedQuad.java   
public void pipe(IVertexConsumer p_pipe_1_)
{
    Reflector.callVoid(Reflector.LightUtil_putBakedQuad, new Object[] {p_pipe_1_, this});
}
项目:CrystalMod    文件:CustomBakedQuad.java   
@Override
public void pipe(IVertexConsumer consumer) {
    quadulate();
    computeNormals();
    consumer.setApplyDiffuseLighting(applyDifuseLighting);
    consumer.setTexture(sprite);
    consumer.setQuadOrientation(getQuadFace());
    consumer.setQuadTint(tintIndex);
    for (int v = 0; v < 4; v++) {
        for (int e = 0; e < consumer.getVertexFormat().getElementCount(); e++) {
            VertexFormatElement element = consumer.getVertexFormat().getElement(e);
            switch (element.getUsage()) {
                case POSITION:
                    Vector3d pos = vertices[v].vec;
                    consumer.put(e, (float) pos.x, (float) pos.y, (float) pos.z, 1);
                    break;
                case NORMAL:
                    Vector3d normal = normals[v];
                    consumer.put(e, (float) normal.x, (float) normal.y, (float) normal.z, 0);
                    break;
                case COLOR:
                    ColorData colour = colours[v];
                    consumer.put(e, (colour.r & 0xFF) / 255, (colour.g & 0xFF) / 255, (colour.b & 0xFF) / 255, (colour.a & 0xFF) / 255);
                    break;
                case UV:
                    if (element.getIndex() == 0) {
                        UVData uv = vertices[v].uv;
                        consumer.put(e, (float) uv.u, (float) uv.v, 0, 1);
                    } else {
                        int brightness = lightMaps[v];
                        consumer.put(e, (float) ((brightness >> 4) & 15 * 32) / 65535, (float) ((brightness >> 20) & 15 * 32) / 65535, 0, 1);
                    }
                    break;
                case PADDING:
                case GENERIC:
                default:
                    consumer.put(e);
            }
        }
    }
}
项目:CodeChickenLib    文件:CCQuad.java   
@Override
public void pipe(IVertexConsumer consumer) {
    quadulate();
    computeNormals();
    consumer.setApplyDiffuseLighting(applyDifuseLighting);
    consumer.setTexture(sprite);
    consumer.setQuadOrientation(getQuadFace());
    consumer.setQuadTint(tintIndex);
    for (int v = 0; v < 4; v++) {
        for (int e = 0; e < consumer.getVertexFormat().getElementCount(); e++) {
            VertexFormatElement element = consumer.getVertexFormat().getElement(e);
            switch (element.getUsage()) {
                case POSITION:
                    Vector3 pos = vertices[v].vec;
                    consumer.put(e, (float) pos.x, (float) pos.y, (float) pos.z, 1);
                    break;
                case NORMAL:
                    Vector3 normal = normals[v];
                    consumer.put(e, (float) normal.x, (float) normal.y, (float) normal.z, 0);
                    break;
                case COLOR:
                    Colour colour = colours[v];
                    consumer.put(e, (colour.r & 0xFF) / 255F, (colour.g & 0xFF) / 255F, (colour.b & 0xFF) / 255F, (colour.a & 0xFF) / 255F);
                    break;
                case UV:
                    if (element.getIndex() == 0) {
                        UV uv = vertices[v].uv;
                        consumer.put(e, (float) uv.u, (float) uv.v, 0, 1);
                    } else {
                        int brightness = lightMaps[v];
                        consumer.put(e, (float) ((brightness & 0xFFFF) / 0xFFFF) * 2, (float) ((brightness >> 16 & 0xFFFF) / 0xFFFF) * 2, 0, 1);
                    }
                    break;
                case PADDING:
                case GENERIC:
                default:
                    consumer.put(e);
            }
        }
    }
}