Java Code Examples for net.minecraft.client.renderer.ActiveRenderInfo#rotationZ()

The following examples show how to use net.minecraft.client.renderer.ActiveRenderInfo#rotationZ() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RenderParticle.java    From Translocators with MIT License 6 votes vote down vote up
public static void render(double x, double y, double z, Colour colour, double s, double u1, double v1, double u2, double v2)
{
    x-=EntityFX.interpPosX;
    y-=EntityFX.interpPosY;
    z-=EntityFX.interpPosZ;
    //TODO: check
    
    float par3 = ActiveRenderInfo.rotationX;
    float par4 = ActiveRenderInfo.rotationXZ;
    float par5 = ActiveRenderInfo.rotationZ;
    float par6 = ActiveRenderInfo.rotationYZ;
    float par7 = ActiveRenderInfo.rotationXY;
    
    Tessellator t = Tessellator.instance;
    t.setColorRGBA(colour.r&0xFF, colour.g&0xFF, colour.b&0xFF, colour.a&0xFF);
    t.addVertexWithUV((x - par3 * s - par6 * s), (y - par4 * s), (z - par5 * s - par7 * s), u2, v2);
    t.addVertexWithUV((x - par3 * s + par6 * s), (y + par4 * s), (z - par5 * s + par7 * s), u2, v1);
    t.addVertexWithUV((x + par3 * s + par6 * s), (y + par4 * s), (z + par5 * s + par7 * s), u1, v1);
    t.addVertexWithUV((x + par3 * s - par6 * s), (y - par4 * s), (z + par5 * s - par7 * s), u1, v2);
}
 
Example 2
Source File: ItemRenderFamiliar.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void cleanActiveRenderInfo(ItemRenderType renderType) {
    renderInfo[0] = ActiveRenderInfo.rotationX;
    renderInfo[1] = ActiveRenderInfo.rotationXZ;
    renderInfo[2] = ActiveRenderInfo.rotationZ;
    renderInfo[3] = ActiveRenderInfo.rotationYZ;
    renderInfo[4] = ActiveRenderInfo.rotationXY;
    switch (renderType) {
        case ENTITY:
            break;
        case EQUIPPED:
            ActiveRenderInfo.rotationX = 0.85535365F;
            ActiveRenderInfo.rotationXZ = 0.9868404F;
            ActiveRenderInfo.rotationZ = -0.51804453F;
            ActiveRenderInfo.rotationYZ = 0.083717324F;
            ActiveRenderInfo.rotationXY = 0.13822734F;
            break;
        case EQUIPPED_FIRST_PERSON:
            ActiveRenderInfo.rotationX = -0.4186075F;
            ActiveRenderInfo.rotationXZ = 0.99932945F;
            ActiveRenderInfo.rotationZ = -0.90816724F;
            ActiveRenderInfo.rotationYZ = 0.033253096F;
            ActiveRenderInfo.rotationXY = -0.015327567F;
            break;
        case INVENTORY:
            ActiveRenderInfo.rotationX = -0.71445745F;
            ActiveRenderInfo.rotationXZ = 0.9573291F;
            ActiveRenderInfo.rotationZ = 0.69967884F;
            ActiveRenderInfo.rotationYZ = -0.20220716F;
            ActiveRenderInfo.rotationXY = -0.20647818F;
            break;
        case FIRST_PERSON_MAP:
            break;
    }
}
 
Example 3
Source File: ItemRenderFamiliar.java    From Gadomancy with GNU Lesser General Public License v3.0 5 votes vote down vote up
private void restoreActiveRenderInfo() {
    if(renderInfo[0] != -1) ActiveRenderInfo.rotationX = renderInfo[0];
    if(renderInfo[1] != -1) ActiveRenderInfo.rotationXZ = renderInfo[1];
    if(renderInfo[2] != -1) ActiveRenderInfo.rotationZ = renderInfo[2];
    if(renderInfo[3] != -1) ActiveRenderInfo.rotationYZ = renderInfo[3];
    if(renderInfo[4] != -1) ActiveRenderInfo.rotationXY = renderInfo[4];
    for (int i = 0; i < renderInfo.length; i++) {
        renderInfo[i] = -1;
    }
}
 
Example 4
Source File: FXVortex.java    From Gadomancy with GNU Lesser General Public License v3.0 4 votes vote down vote up
private void render(Tessellator tessellator, float pTicks) {
    float arX = ActiveRenderInfo.rotationX;
    float arXZ = ActiveRenderInfo.rotationXZ;
    float arZ = ActiveRenderInfo.rotationZ;
    float arYZ = ActiveRenderInfo.rotationYZ;
    float arXY = ActiveRenderInfo.rotationXY;

    GL11.glPushMatrix();
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.003921569F);
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);

    float agescale = (float) (ClientHandler.ticks % 800) / 400F;
    if(agescale >= 1.0F) agescale = 2 - agescale;
    float size = 0.2F + 0.1F * agescale;
    if(parent != null) {
        size += size * (((float) parent.getSizeStage()) * 0.04F);
    }

    float anglePerc = (float) (ClientHandler.ticks % 300) / 300F;
    float angle = RAD - RAD * anglePerc;

    Vector3 iV = MiscUtils.interpolateEntityPosition(Minecraft.getMinecraft().renderViewEntity, pTicks);
    if(parent != null && parent.getSizeStage() > 4) {
        float mult = 0.001F * (parent.getSizeStage() - 4F);
        Vector3 shake = new Vector3(
                RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
                RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1),
                RAND.nextFloat() * mult * (RAND.nextBoolean() ? 1 : -1));
        iV.add(shake);
    }

    GL11.glTranslated(-iV.getX(), -iV.getY(), -iV.getZ());

    UtilsFX.bindTexture(TC_VORTEX_TEXTURE);

    tessellator.startDrawingQuads();
    tessellator.setBrightness(220);
    tessellator.setColorRGBA_F(1F, 1F, 1F, 1F);

    Vec3 v1 = Vec3.createVectorHelper(-arX * size - arYZ * size, -arXZ * size, -arZ * size - arXY * size);
    Vec3 v2 = Vec3.createVectorHelper(-arX * size + arYZ * size, arXZ * size, -arZ * size + arXY * size);
    Vec3 v3 = Vec3.createVectorHelper(arX * size + arYZ * size, arXZ * size, arZ * size + arXY * size);
    Vec3 v4 = Vec3.createVectorHelper(arX * size - arYZ * size, -arXZ * size, arZ * size - arXY * size);
    if (angle != 0.0F) {
        Vec3 pvec = Vec3.createVectorHelper(iV.getX(), iV.getY(), iV.getZ());
        Vec3 tvec = Vec3.createVectorHelper(x, y, z);
        Vec3 qvec = pvec.subtract(tvec).normalize();
        QuadHelper.setAxis(qvec, angle).rotate(v1);
        QuadHelper.setAxis(qvec, angle).rotate(v2);
        QuadHelper.setAxis(qvec, angle).rotate(v3);
        QuadHelper.setAxis(qvec, angle).rotate(v4);
    }
    tessellator.setNormal(0.0F, 0.0F, -1.0F);
    tessellator.addVertexWithUV(x + v1.xCoord, y + v1.yCoord, z + v1.zCoord, 0, 1);
    tessellator.addVertexWithUV(x + v2.xCoord, y + v2.yCoord, z + v2.zCoord, 1, 1);
    tessellator.addVertexWithUV(x + v3.xCoord, y + v3.yCoord, z + v3.zCoord, 1, 0);
    tessellator.addVertexWithUV(x + v4.xCoord, y + v4.yCoord, z + v4.zCoord, 0, 0);
    tessellator.draw();

    GL11.glDisable(GL11.GL_BLEND);
    GL11.glAlphaFunc(GL11.GL_GREATER, 0.1F);
    GL11.glPopMatrix();
}