Examples of Vector4f


Examples of com.jme3.math.Vector4f

        for (int i = 0; i < pntsV; ++i) {
            List<Vector4f> uControlPoints = new ArrayList<Vector4f>(pntsU);
            for (int j = 0; j < pntsU; ++j) {
                DynamicArray<Float> vec = (DynamicArray<Float>) bPoints.get(j + i * pntsU).getFieldValue("vec");
                if (fixUpAxis) {
                    uControlPoints.add(new Vector4f(vec.get(0).floatValue(), vec.get(2).floatValue(), -vec.get(1).floatValue(), vec.get(3).floatValue()));
                } else {
                    uControlPoints.add(new Vector4f(vec.get(0).floatValue(), vec.get(1).floatValue(), vec.get(2).floatValue(), vec.get(3).floatValue()));
                }
            }
            if ((flagU & 0x01) != 0) {
                for (int k = 0; k < orderU - 1; ++k) {
                    uControlPoints.add(uControlPoints.get(k));
View Full Code Here

Examples of com.thecrouchmode.vector.Vector4f

//              1+3*(float)Math.sin(-2*value),
//              1+1*(float)Math.cos(-2*value),
//              1f,//,
//              1.0f);
         
          light.pos = new Vector4f(trans, 1.0f);

         
          shader.use();
         
          shader.setUniform("lightPos", light.pos.xyz());
View Full Code Here

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

Examples of crazypants.vecmath.Vector4f

        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

Examples of crazypants.vecmath.Vector4f

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

Examples of crazypants.vecmath.Vector4f

    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

Examples of crazypants.vecmath.Vector4f

    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

Examples of crazypants.vecmath.Vector4f

      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

Examples of crazypants.vecmath.Vector4f

          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

Examples of crazypants.vecmath.Vector4f

    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
TOP
Copyright © 2018 www.massapi.com. 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.