Package crazypants.vecmath

Examples of crazypants.vecmath.Vector4f


  private final Vector4f selectedColor;
  private final Vector4f highlightColor;

  public TravelEntitySpecialRenderer() {
    this(new Vector4f(1, 0.25f, 0, 0.5f), new Vector4f(1, 1, 1, 0.25f));
  }
View Full Code Here


        GL11.glPopMatrix();
      }

      String toRender = ta.getLabel();
      if(toRender != null && toRender.trim().length() > 0) {
        Vector4f bgCol = RenderUtil.DEFAULT_TEXT_BG_COL;
        if(TravelController.instance.isBlockSelected(new BlockCoord(tileentity))) {
          bgCol = new Vector4f(selectedColor.x, selectedColor.y, selectedColor.z, selectedColor.w);
        }
       
        {
          GL11.glPushMatrix();
          GL11.glTranslatef((float) x + 0.5f, (float) y + 0.5f, (float) z + 0.5f);
View Full Code Here

public final class ColorUtil {

  public static Vector4f toFloat(Color color) {
    float[] rgba = color.getComponents(null);
    return new Vector4f(rgba[0], rgba[1], rgba[2], rgba[3]);
  }
View Full Code Here

    Vertex closest = getClosestVertex(litVertices, samplePoint);
    if(closest == null) {
      return;
    }
    vert.setBrightness(closest.brightness);
    Vector4f col = closest.getColor();
    if(col != null) {
      vert.setColor(col);
    }
  }
View Full Code Here

    mx -= vpx;
    my -= vpy;
    if(mx >= x && mx <= x + IconEIO.IO_WHATSIT.width &&
        my >= y && my <= y + IconEIO.IO_WHATSIT.height) {
      RenderUtil.renderQuad2D(x, y, 0, IconEIO.IO_WHATSIT.width, IconEIO.IO_WHATSIT.height, new Vector4f(0.4f,0.4f,0.4f,0.6f));
      inNeigButBounds = true;
    } else {
      inNeigButBounds = false;
    }
View Full Code Here

      for (GaugeBounds gb : gaugeBounds) {
        if(gb.face == face) {
          Tessellator tes = Tessellator.instance;
          tes.addTranslation((float) x, (float) y, (float) z);
          int b = 0;
          Vector4f col = new Vector4f();
          int colCount = 0;
          for (Vertex v : refVertices) {
            b += v.brightness;
            if(v.color != null) {
              colCount++;
              col.add(v.color);
            }
          }
          if(b > 0) {
            b /= 4;
            tes.setBrightness(b);
          } else {
            tes.setBrightness(15 << 20 | 0 << 4);
          }
          if(colCount > 0) {
            col.scale(0.25);
            tes.setColorRGBA_F(col.x, col.y, col.z, col.w);
          }
          renderGaugeOnFace(gb, EnderIO.blockCapacitorBank.overlayIcon, refVertices, x, y, z);
          renderFillBarOnFace(gb, EnderIO.blockCapacitorBank.fillBarIcon,capBank.getEnergyStoredRatio(), refVertices, x, y, z);
          capBank.lastRenderStoredRatio = capBank.getEnergyStoredRatio();
View Full Code Here

          v.xyz.sub(xyz);
          xform.apply(v);
          if(!enableLighting) {
            v.brightness = 15 << 20 | 15 << 4;
            float col = RenderUtil.getColorMultiplierForFace(face);
            v.color = new Vector4f(col,col,col,1);           
            v.normal = null;
          }
        }
      }
      Tessellator.instance.addTranslation((float)x, (float)y, (float)z);
View Full Code Here

    return EnergyUpgrade.loadFromItem(item) == null && item.getItemDamageForDisplay() == 0;
  }

  private void renderBar2(int y, double maxDam, double dispDamage, Color full, Color empty) {
    double ratio = dispDamage / maxDam;
    Vector4f fg = ColorUtil.toFloat(full);
    Vector4f ec = ColorUtil.toFloat(empty);
    fg.interpolate(ec, (float) ratio);
    Vector4f bg = ColorUtil.toFloat(Color.black);
    bg.interpolate(fg, 0.15f);
   
    int barLength = (int) Math.round(12.0 * (1 - ratio));   
   
    RenderUtil.renderQuad2D(2, y, 0, 12, 1, bg);
    RenderUtil.renderQuad2D(2, y, 0, barLength, 1, fg);
View Full Code Here

  }

 
  private void renderBar(int y, double maxDam, double dispDamage, Color full, Color empty) {
    double ratio = dispDamage / maxDam;
    Vector4f fg = ColorUtil.toFloat(full);
    Vector4f ec = ColorUtil.toFloat(empty);

    fg.interpolate(ec, (float) ratio);

    Vector4f bg = new Vector4f(0.17, 0.3, 0.1, 0);

    int barLength = (int) Math.round(12.0 * (1 - ratio));
    RenderUtil.renderQuad2D(2, y, 0, 12, 1, bg);
    RenderUtil.renderQuad2D(2, y, 0, barLength, 1, fg);
  }
View Full Code Here

    @Override
    public void draw(int mouseX, int mouseY, float partialTick) {     
      RenderHelper.enableGUIStandardItemLighting();
      GL11.glEnable(GL11.GL_BLEND);
      RenderUtil.renderQuad2D(4, 4, 0, gui.getXSize() - 9, gui.getYSize() - 8, new Vector4f(0,0,0,1));
      RenderUtil.renderQuad2D(6, 6, 0, gui.getXSize() - 13, gui.getYSize() - 12, new Vector4f(0.6,0.6,0.6,1));
     
      Minecraft mc = Minecraft.getMinecraft();
      RenderItem itemRenderer = new RenderItem();
           
      GL11.glEnable(GL11.GL_DEPTH_TEST);
View Full Code Here

TOP

Related Classes of crazypants.vecmath.Vector4f

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.