Package mekanism.client.render.MekanismRenderer

Examples of mekanism.client.render.MekanismRenderer.DisplayInteger


  {
    if(!isHidden)
    {
      if(showModel)
      {
        DisplayInteger currentDisplayList = displayLists.get(new BooleanArray(dontRender));

        if(currentDisplayList == null)
        {
          currentDisplayList = compileDisplayList(dontRender, scaleFactor);
        }

        GL11.glTranslatef(offsetX, offsetY, offsetZ);

        int i;

        if(rotateAngleX == 0.0F && rotateAngleY == 0.0F && rotateAngleZ == 0.0F)
        {
          if(rotationPointX == 0.0F && rotationPointY == 0.0F && rotationPointZ == 0.0F)
          {
            currentDisplayList.render();
          }
          else {
            GL11.glTranslatef(rotationPointX * scaleFactor, rotationPointY * scaleFactor, rotationPointZ * scaleFactor);
            currentDisplayList.render();
            GL11.glTranslatef(-rotationPointX * scaleFactor, -rotationPointY * scaleFactor, -rotationPointZ * scaleFactor);
          }
        }
        else {
          GL11.glPushMatrix();
          GL11.glTranslatef(rotationPointX * scaleFactor, rotationPointY * scaleFactor, rotationPointZ * scaleFactor);

          if(rotateAngleZ != 0.0F)
          {
            GL11.glRotatef(rotateAngleZ * (180F / (float)Math.PI), 0.0F, 0.0F, 1.0F);
          }

          if(rotateAngleY != 0.0F)
          {
            GL11.glRotatef(rotateAngleY * (180F / (float)Math.PI), 0.0F, 1.0F, 0.0F);
          }

          if(rotateAngleX != 0.0F)
          {
            GL11.glRotatef(rotateAngleX * (180F / (float)Math.PI), 1.0F, 0.0F, 0.0F);
          }

          currentDisplayList.render();
          GL11.glPopMatrix();
        }

        GL11.glTranslatef(-offsetX, -offsetY, -offsetZ);
      }
View Full Code Here


  }

  @SideOnly(Side.CLIENT)
  private DisplayInteger compileDisplayList(boolean[] dontRender, float scaleFactor)
  {
    DisplayInteger displayList = DisplayInteger.createAndStart();
    Tessellator tessellator = Tessellator.instance;

    for(int i = 0; i < cubeList.size(); ++i)
    {
      cubeList.get(i).render(tessellator, dontRender, scaleFactor);
    }

    displayList.endList();
    displayLists.put(new BooleanArray(dontRender), displayList);

    return displayList;
  }
View Full Code Here

    Model3D toReturn = new Model3D();
    toReturn.baseBlock = Blocks.stone;
    toReturn.setTexture(MekanismRenderer.getColorIcon(color));

    DisplayInteger display = DisplayInteger.createAndStart();

    if(cachedOverlays.containsKey(side))
    {
      cachedOverlays.get(side).put(color, display);
    }
    else {
      HashMap<EnumColor, DisplayInteger> map = new HashMap<EnumColor, DisplayInteger>();
      map.put(color, display);
      cachedOverlays.put(side, map);
    }

    switch(side)
    {
      case DOWN:
      {
        toReturn.minY = -.01;
        toReturn.maxY = 0;

        toReturn.minX = 0;
        toReturn.minZ = 0;
        toReturn.maxX = 1;
        toReturn.maxZ = 1;
        break;
      }
      case UP:
      {
        toReturn.minY = 1;
        toReturn.maxY = 1.01;

        toReturn.minX = 0;
        toReturn.minZ = 0;
        toReturn.maxX = 1;
        toReturn.maxZ = 1;
        break;
      }
      case NORTH:
      {
        toReturn.minZ = -.01;
        toReturn.maxZ = 0;

        toReturn.minX = 0;
        toReturn.minY = 0;
        toReturn.maxX = 1;
        toReturn.maxY = 1;
        break;
      }
      case SOUTH:
      {
        toReturn.minZ = 1;
        toReturn.maxZ = 1.01;

        toReturn.minX = 0;
        toReturn.minY = 0;
        toReturn.maxX = 1;
        toReturn.maxY = 1;
        break;
      }
      case WEST:
      {
        toReturn.minX = -.01;
        toReturn.maxX = 0;

        toReturn.minY = 0;
        toReturn.minZ = 0;
        toReturn.maxY = 1;
        toReturn.maxZ = 1;
        break;
      }
      case EAST:
      {
        toReturn.minX = 1;
        toReturn.maxX = 1.01;

        toReturn.minY = 0;
        toReturn.minZ = 0;
        toReturn.maxY = 1;
        toReturn.maxZ = 1;
        break;
      }
      default:
      {
        break;
      }
    }

    MekanismRenderer.renderObject(toReturn);
    display.endList();

    return display;
  }
View Full Code Here

    Model3D toReturn = new Model3D();
    toReturn.baseBlock = Blocks.water;
    toReturn.setTexture(gas.getIcon());

    DisplayInteger display = DisplayInteger.createAndStart();

    if(cachedGasses.containsKey(side))
    {
      cachedGasses.get(side).put(gas, display);
    }
    else {
      HashMap<Gas, DisplayInteger> map = new HashMap<Gas, DisplayInteger>();
      map.put(gas, display);
      cachedGasses.put(side, map);
    }

    switch(side)
    {
      case NORTH:
      {
        toReturn.minX = 0.125 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.3125 + offset;

        toReturn.maxX = 0.5 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.6875 - offset;
        break;
      }
      case SOUTH:
      {
        toReturn.minX = 0.5 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.3125 + offset;

        toReturn.maxX = 0.875 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.6875 - offset;
        break;
      }
      case WEST:
      {
        toReturn.minX = 0.3125 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.5 + offset;

        toReturn.maxX = 0.6875 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.875 - offset;
        break;
      }
      case EAST:
      {
        toReturn.minX = 0.3125 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.125 + offset;

        toReturn.maxX = 0.6875 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.5 - offset;
        break;
      }
    }

    MekanismRenderer.renderObject(toReturn);
    display.endList();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    return display;
  }
View Full Code Here

    Model3D toReturn = new Model3D();
    toReturn.baseBlock = Blocks.stone;
    toReturn.setTexture(GasRegistry.getGas("oxygen").getIcon());

    DisplayInteger display = DisplayInteger.createAndStart();

    if(cachedOverlays.containsKey(type))
    {
      cachedOverlays.get(type);
    }
    else {
      cachedOverlays.put(type, display);
    }

    switch(type)
    {
      case 0:
      {
        toReturn.minY = 1;
        toReturn.maxY = 3;

        toReturn.minX = 0.46;
        toReturn.minZ = 0;
        toReturn.maxX = 0.54;
        toReturn.maxZ = 1;
        break;
      }
      case 1:
      {
        toReturn.minY = 1;
        toReturn.maxY = 3;

        toReturn.minX = 0;
        toReturn.minZ = 0.46;
        toReturn.maxX = 1;
        toReturn.maxZ = 0.54;
        break;
      }
    }

    MekanismRenderer.renderObject(toReturn);
    display.endList();

    return display;
  }
View Full Code Here

    Model3D toReturn = new Model3D();
    toReturn.baseBlock = Blocks.water;
    toReturn.setTexture(fluid.getFlowingIcon());

    DisplayInteger display = DisplayInteger.createAndStart();

    if(cachedValveFluids.containsKey(data))
    {
      cachedValveFluids.get(data).put(fluid, display);
    }
    else {
      HashMap<Fluid, DisplayInteger> map = new HashMap<Fluid, DisplayInteger>();
      map.put(fluid, display);
      cachedValveFluids.put(data, map);
    }

    MekanismRenderer.colorFluid(fluid);

    switch(data.side)
    {
      case DOWN:
      {
        toReturn.minX = .3;
        toReturn.minY = 1 + .01;
        toReturn.minZ = .3;

        toReturn.maxX = .7;
        toReturn.maxY = 1.4 + .1;
        toReturn.maxZ = .7;
        break;
      }
      case UP:
      {
        toReturn.minX = .3;
        toReturn.minY = -(data.height-2) - .01;
        toReturn.minZ = .3;

        toReturn.maxX = .7;
        toReturn.maxY = -.01;
        toReturn.maxZ = .7;
        break;
      }
      case NORTH:
      {
        toReturn.minX = .3;
        toReturn.minY = -(getValveFluidHeight(data)) + .01;
        toReturn.minZ = 1 + .02;

        toReturn.maxX = .7;
        toReturn.maxY = .7;
        toReturn.maxZ = 1.4;
        break;
      }
      case SOUTH:
      {
        toReturn.minX = .3;
        toReturn.minY = -(getValveFluidHeight(data)) + .01;
        toReturn.minZ = -.4;

        toReturn.maxX = .7;
        toReturn.maxY = .7;
        toReturn.maxZ = -.02;
        break;
      }
      case WEST:
      {
        toReturn.minX = 1 + .02;
        toReturn.minY = -(getValveFluidHeight(data)) + .01;
        toReturn.minZ = .3;

        toReturn.maxX = 1.4;
        toReturn.maxY = .7;
        toReturn.maxZ = .7;
        break;
      }
      case EAST:
      {
        toReturn.minX = -.4;
        toReturn.minY = -(getValveFluidHeight(data)) + .01;
        toReturn.minZ = .3;

        toReturn.maxX = -.02;
        toReturn.maxY = .7;
        toReturn.maxZ = .7;
        break;
      }
      default:
      {
        break;
      }
    }

    if(fluid.getFlowingIcon() != null)
    {
      MekanismRenderer.renderObject(toReturn);
    }
   
    display.endList();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    return display;
  }
View Full Code Here

    Model3D toReturn = new Model3D();
    toReturn.baseBlock = Blocks.stone;
    toReturn.setTexture(icon);

    DisplayInteger display = DisplayInteger.createAndStart();

    if(cachedOverlays.containsKey(side))
    {
      cachedOverlays.get(side).put(mode, display);
    }
    else {
      HashMap<Integer, DisplayInteger> map = new HashMap<Integer, DisplayInteger>();
      map.put(mode, display);
      cachedOverlays.put(side, map);
    }

    switch(side)
    {
      case DOWN:
      {
        toReturn.minY = -0.01;
        toReturn.maxY = 0;

        toReturn.minX = 0;
        toReturn.minZ = 0;
        toReturn.maxX = 1;
        toReturn.maxZ = 1;
        break;
      }
      case UP:
      {
        toReturn.minY = 1;
        toReturn.maxY = 1.01;

        toReturn.minX = 0;
        toReturn.minZ = 0;
        toReturn.maxX = 1;
        toReturn.maxZ = 1;
        break;
      }
      case NORTH:
      {
        toReturn.minZ = -0.01;
        toReturn.maxZ = 0;

        toReturn.minX = 0;
        toReturn.minY = 0;
        toReturn.maxX = 1;
        toReturn.maxY = 1;
        break;
      }
      case SOUTH:
      {
        toReturn.minZ = 1;
        toReturn.maxZ = 1.01;

        toReturn.minX = 0;
        toReturn.minY = 0;
        toReturn.maxX = 1;
        toReturn.maxY = 1;
        break;
      }
      case WEST:
      {
        toReturn.minX = -0.01;
        toReturn.maxX = 0;

        toReturn.minY = 0;
        toReturn.minZ = 0;
        toReturn.maxY = 1;
        toReturn.maxZ = 1;
        break;
      }
      case EAST:
      {
        toReturn.minX = 1;
        toReturn.maxX = 1.01;

        toReturn.minY = 0;
        toReturn.minZ = 0;
        toReturn.maxY = 1;
        toReturn.maxZ = 1;
        break;
      }
      default:
      {
        break;
      }
    }

    MekanismRenderer.renderObject(toReturn);
    display.endList();

    return display;
  }
View Full Code Here

    Model3D toReturn = new Model3D();
    toReturn.baseBlock = Blocks.water;
    toReturn.setTexture(gas.getIcon());

    DisplayInteger display = DisplayInteger.createAndStart();

    if(cachedGasses.containsKey(side))
    {
      cachedGasses.get(side).put(gas, display);
    }
    else {
      HashMap<Gas, DisplayInteger> map = new HashMap<Gas, DisplayInteger>();
      map.put(gas, display);
      cachedGasses.put(side, map);
    }

    switch(side)
    {
      case NORTH:
      {
        toReturn.minX = 0.625 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.625 + offset;

        toReturn.maxX = 0.8125 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.8125 - offset;
        break;
      }
      case SOUTH:
      {
        toReturn.minX = 0.1875 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.1875 + offset;

        toReturn.maxX = 0.375 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.375 - offset;
        break;
      }
      case WEST:
      {
        toReturn.minX = 0.625 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.1875 + offset;

        toReturn.maxX = 0.8125 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.375 - offset;
        break;
      }
      case EAST:
      {
        toReturn.minX = 0.1875 + offset;
        toReturn.minY = 0.0625 + offset;
        toReturn.minZ = 0.625 + offset;

        toReturn.maxX = 0.375 - offset;
        toReturn.maxY = 0.9375 - offset;
        toReturn.maxZ = 0.8125 - offset;
        break;
      }
    }

    MekanismRenderer.renderObject(toReturn);
    display.endList();

    GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);

    return display;
  }
View Full Code Here

TOP

Related Classes of mekanism.client.render.MekanismRenderer.DisplayInteger

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.