Package crazypants.render

Examples of crazypants.render.BoundingBox


  private void renderSelection() {
    if(selection == null) {
      return;
    }

    BoundingBox bb = new BoundingBox(selection.config.getLocation());

    IIcon icon = EnderIO.blockAlloySmelter.selectedFaceIcon;
    List<Vertex> corners = bb.getCornersWithUvForFace(selection.face,icon.getMinU(),icon.getMaxU(),icon.getMinV(),icon.getMaxV());

    GL11.glDisable(GL11.GL_DEPTH_TEST);
    GL11.glDisable(GL11.GL_LIGHTING);
    RenderUtil.bindBlockTexture();
    GL11.glColor3f(1,1,1);
View Full Code Here


  }

  @Override
  public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {

    BoundingBox bb = BoundingBox.UNIT_CUBE;
    TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);

    float scale = 0.7f;
    float width = 0.4f;
    float trans = (1 - scale) / 2;
    bb = BoundingBox.UNIT_CUBE.scale(1, scale, width);
    bb = bb.translate(0, -trans, 0);
    TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);

    bb = BoundingBox.UNIT_CUBE.scale(width, scale, 1);
    bb = bb.translate(0, -trans, 0);
    TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);

    float topWidth = 0.15f;
    bb = BoundingBox.UNIT_CUBE.scale(1, topWidth, 1);
    bb = bb.translate(0, 0.3f + topWidth / 2f, 0);
    TranslatedCubeRenderer.instance.renderBoundingBox(x, y, z, block, bb, xform, null, world != null);

    if(world != null) {
      TileEntity te = world.getTileEntity(x, y, z);
      if(te instanceof TileFarmStation && ((TileFarmStation) te).isActive()) {
        bb = BoundingBox.UNIT_CUBE.scale(1, 0.08, .4);
        bb = bb.translate(0, 0.1f, 0);
        bb = bb.translate(x, y, z);
        Tessellator.instance.setColorOpaque_F(1, 1, 1);
        CubeRenderer.render(bb, Blocks.portal.getBlockTextureFromSide(1));

        bb = BoundingBox.UNIT_CUBE.scale(.4, 0.08, 1);
        bb = bb.translate(0, 0.1f, 0);
        bb = bb.translate(x, y, z);
        Tessellator.instance.setColorOpaque_F(1, 1, 1);
        CubeRenderer.render(bb, Blocks.portal.getBlockTextureFromSide(1));
      }
    }
View Full Code Here

    Vector3f offset = res.getOffsetFromController();

    GL11.glTranslatef((float) x + offset.x, (float) y + offset.y, (float) z + offset.z);

    BoundingBox bb = res.getLiquidRenderBounds();

    if(res.isAutoEject()) {

      // switch
      RenderUtil.bindBlockTexture();

      Tessellator.instance.startDrawingQuads();
      Tessellator.instance.setColorRGBA_F(val, val, val, 1);
      for (ForgeDirection dir : ForgeDirection.VALID_DIRECTIONS) {
        drawSwitch(dir, bb);
      }
      Tessellator.instance.draw();
    }

    if(fullness > 0) {
      RenderUtil.bindTexture(getLiquidSheet());

      float margin = 0.01f;

      IIcon tex = getLiquidTexture();
      float maxV = tex.getMinV() + ((tex.getMaxV() - tex.getMinV()) * fullness);

      Tessellator.instance.startDrawingQuads();
      Tessellator.instance.setColorRGBA_F(val, val, val, 1);
      CubeRenderer.render(
          new BoundingBox(bb.minX + margin, bb.minY + margin, bb.minZ + margin, bb.maxX - margin,
              bb.minY + (fullness * (Math.abs(bb.maxY - bb.minY))) - margin, bb.maxZ - margin), tex.getMinU(), tex.getMaxU(), tex.getMinV(), maxV);
      Tessellator.instance.draw();
    }

    GL11.glPopAttrib();
View Full Code Here

public class ElectricLightRenderer implements ISimpleBlockRenderingHandler {

  @Override
  public void renderInventoryBlock(Block block, int metadata, int modelID, RenderBlocks renderer) {

    BoundingBox bb = new BoundingBox(0, 0, 0, 1, 0.2, 1);
    boolean doDraw = false;

    Tessellator.instance.startDrawingQuads();

    IIcon[] textures = RenderUtil.getBlockTextures(block, metadata);
View Full Code Here

  }

  @Override
  public boolean renderWorldBlock(IBlockAccess world, int x, int y, int z, Block block, int modelId, RenderBlocks renderer) {
    block.setBlockBoundsBasedOnState(world, x, y, z);
    BoundingBox bb = new BoundingBox(block.getBlockBoundsMinX(), block.getBlockBoundsMinY(), block.getBlockBoundsMinZ(), block.getBlockBoundsMaxX(),
        block.getBlockBoundsMaxY(), block.getBlockBoundsMaxZ());

    bb = bb.translate(x, y, z);
    RenderUtil.setTesselatorBrightness(world, x, y, z);
   
    IIcon[] textures = RenderUtil.getBlockTextures(world, x, y, z);
    CubeRenderer.render(bb, textures, null, null);
View Full Code Here

  BoundingBox getLiquidRenderBounds() {
    if(liquidRenderBounds == null) {
      if(!isMultiblock()) {
        return BoundingBox.UNIT_CUBE;
      }
      BoundingBox bounds = new BoundingBox(multiblock[0]);
      for (int i = 1; i < multiblock.length; i++) {
        bounds = bounds.expandBy(new BoundingBox(multiblock[i]));
      }
      liquidRenderBounds = bounds.translate(-multiblock[0].x, -multiblock[0].y, -multiblock[0].z);
    }
    return liquidRenderBounds;
  }
View Full Code Here

      break;
    }
    rangeSqu = range * range;   
    capacitor = new BasicCapacitor(powerPerTick * 8, capacitorType.capacitor.getMaxEnergyStored(), powerPerTick);
   
    BoundingBox bb = new BoundingBox(getLocation());
    bb = bb.scale(range + 0.5f, range + 0.5f, range + 0.5f).translate(0.5f, 0.5f, 0.5f);   
    bounds = AxisAlignedBB.getBoundingBox(bb.minX, bb.minY, bb.minZ, bb.maxX, bb.maxY, bb.maxZ);
  }
View Full Code Here

    if(renderer != null && world != null) {
      renderer.setOverrideBlockTexture(IconUtil.blankTexture);
      renderer.renderStandardBlock(Blocks.stone, x, y, z);
      renderer.setOverrideBlockTexture(null);
    }
    BoundingBox bb;

    bb = BoundingBox.UNIT_CUBE.scale(0.85, 0.85, 0.85);
    setIcons(soulariumIcon, ForgeDirection.NORTH);
    CubeRenderer.render(bb, icons, true);

    float slabWidth = 0.15f;
    bb = BoundingBox.UNIT_CUBE.scale(1, slabWidth, 1);
    bb = bb.translate(0, 0.5f - (slabWidth / 2), 0);
    setIcons(EnderIO.blockSoulFuser.getIcon(ForgeDirection.UP.ordinal(), 0), ForgeDirection.UP);
    CubeRenderer.render(bb, icons, true);

    bb = BoundingBox.UNIT_CUBE.scale(1, slabWidth, 1);
    bb = bb.translate(0, -0.5f + (slabWidth / 2), 0);
    setIcons(soulariumIcon, ForgeDirection.NORTH);

    CubeRenderer.render(bb, icons, true);

    IIcon endermanIcon;
View Full Code Here

  private ForgeDirection forFacing(ForgeDirection side, int facing) {
    return ForgeDirection.values()[ClientProxy.sideAndFacingToSpriteOffset[side.ordinal()][facing]];
  }

  private void renderSkull(ForgeDirection face, IIcon faceIcon) {
    BoundingBox bb;
    bb = scaledBB.translate(ForgeDirectionOffsets.offsetScaled(face, 0.5 - skullScale / 2));
    setIcons(faceIcon, face);
    CubeRenderer.render(bb, icons, true);
  }
View Full Code Here

    RenderUtil.bindBlockTexture();
    Tessellator tes = Tessellator.instance;
    tes.setTranslation(x, y, z);
    tes.startDrawingQuads();

    BoundingBox bb = BoundingBox.UNIT_CUBE.scale(0.96, 0.96, 0.96);
    renderTank(gen, bb, gen.getCoolantTank(), true);
    renderTank(gen, bb, gen.getFuelTank(), false);
    tes.draw();
    tes.setTranslation(0, 0, 0);
View Full Code Here

TOP

Related Classes of crazypants.render.BoundingBox

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.