Package crazypants.vecmath

Examples of crazypants.vecmath.Vertex


    double d13 = par4 + this.renderMaxY;
    double d14 = par6 + this.renderMinZ;
    double d15 = par6 + this.renderMaxZ;

    List<Vertex> result = new ArrayList<Vertex>(4);
    Vertex v;
    if(enableAO) {
      result.add(new Vertex(d11, d13, d15, d7, d9, brightnessTopLeft, colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft, 1));
      result.add(new Vertex(d11, d13, d14, d3, d5, brightnessBottomLeft, colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft, 1));
      result.add(new Vertex(d11, d12, d14, d8, d10, brightnessBottomRight, colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight, 1));
      result.add(new Vertex(d11, d12, d15, d4, d6, brightnessTopRight, colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight, 1));
    } else {
      result.add(new Vertex(d11, d13, d15, d7, d9));
      result.add(new Vertex(d11, d13, d14, d3, d5));
      result.add(new Vertex(d11, d12, d14, d8, d10));
      result.add(new Vertex(d11, d12, d15, d4, d6));
    }
    return result;
  }
View Full Code Here


    double d13 = par4 + this.renderMaxY;
    double d14 = par6 + this.renderMinZ;
    double d15 = par6 + this.renderMaxZ;

    List<Vertex> result = new ArrayList<Vertex>(4);
    Vertex v;
    if(enableAO) {
      v = new Vertex(d12, d13, d15, d4, d6, brightnessTopLeft, colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft, 1);
      result.add(v);
      v = new Vertex(d12, d13, d14, d7, d9, brightnessBottomLeft, colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft, 1);
      result.add(v);
      v = new Vertex(d11, d13, d14, d3, d5, brightnessBottomRight, colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight, 1);
      result.add(v);
      v = new Vertex(d11, d13, d15, d8, d10, brightnessTopRight, colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight, 1);
      result.add(v);
    } else {
      v = new Vertex(d12, d13, d15, d4, d6);
      result.add(v);
      v = new Vertex(d12, d13, d14, d7, d9);
      result.add(v);
      v = new Vertex(d11, d13, d14, d3, d5);
      result.add(v);
      v = new Vertex(d11, d13, d15, d8, d10);
      result.add(v);
    }
    return result;
  }
View Full Code Here

    double d13 = par4 + this.renderMinY;
    double d14 = par4 + this.renderMaxY;
    double d15 = par6 + this.renderMaxZ;

    List<Vertex> result = new ArrayList<Vertex>();
    Vertex v;
    if(enableAO) {
      result.add(new Vertex(d11, d14, d15, d3, d5, brightnessTopLeft, colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft, 1));
      result.add(new Vertex(d11, d13, d15, d8, d10, brightnessBottomLeft, this.colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft, 1));
      result.add(new Vertex(d12, d13, d15, d4, d6, brightnessBottomRight, colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight, 1));
      result.add(new Vertex(d12, d14, d15, d7, d9, brightnessTopRight, colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight, 1));
    } else {
      result.add(new Vertex(d11, d14, d15, d3, d5));
      result.add(new Vertex(d11, d13, d15, d8, d10));
      result.add(new Vertex(d12, d13, d15, d4, d6));
      result.add(new Vertex(d12, d14, d15, d7, d9));
    }
    return result;
  }
View Full Code Here

    double d13 = par4 + this.renderMinY;
    double d14 = par4 + this.renderMaxY;
    double d15 = par6 + this.renderMinZ;

    List<Vertex> result = new ArrayList<Vertex>();
    Vertex v;
    if(enableAO) {
      result.add(new Vertex(d11, d14, d15, d7, d9, brightnessTopLeft, colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft, 1));
      result.add(new Vertex(d12, d14, d15, d3, d5, brightnessBottomLeft, colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft, 1));
      result.add(new Vertex(d12, d13, d15, d8, d10, brightnessBottomRight, colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight, 1));
      result.add(new Vertex(d11, d13, d15, d4, d6, brightnessTopRight, colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight, 1));
    } else {
      result.add(new Vertex(d11, d14, d15, d7, d9));
      result.add(new Vertex(d12, d14, d15, d3, d5));
      result.add(new Vertex(d12, d13, d15, d8, d10));
      result.add(new Vertex(d11, d13, d15, d4, d6));
    }
    return result;
  }
View Full Code Here

    double d13 = par4 + this.renderMaxY;
    double d14 = par6 + this.renderMinZ;
    double d15 = par6 + this.renderMaxZ;

    List<Vertex> result = new ArrayList<Vertex>(4);
    Vertex v;
    if(enableAO) {
      result.add(new Vertex(d11, d12, d15, d8, d10, brightnessTopLeft, colorRedTopLeft, this.colorGreenTopLeft, this.colorBlueTopLeft, 1));
      result.add(new Vertex(d11, d12, d14, d4, d6, brightnessBottomLeft, colorRedBottomLeft, this.colorGreenBottomLeft, this.colorBlueBottomLeft, 1));
      result.add(new Vertex(d11, d13, d14, d7, d9, brightnessBottomRight, colorRedBottomRight, this.colorGreenBottomRight, this.colorBlueBottomRight, 1));
      result.add(new Vertex(d11, d13, d15, d3, d5, brightnessTopRight, colorRedTopRight, this.colorGreenTopRight, this.colorBlueTopRight, 1));
    } else {
      result.add(new Vertex(d11, d12, d15, d8, d10));
      result.add(new Vertex(d11, d12, d14, d4, d6));
      result.add(new Vertex(d11, d13, d14, d7, d9));
      result.add(new Vertex(d11, d13, d15, d3, d5));
    }
    return result;
  }
View Full Code Here

    double minY = y + this.renderMinY;
    double minZ = z + this.renderMinZ;
    double maxZ = z + this.renderMaxZ;

    List<Vertex> result = new ArrayList<Vertex>(4);
    Vertex v;
    if(this.enableAO) {
      v = new Vertex(minX, minY, maxZ, d8, d10, brightnessTopLeft, colorRedTopLeft, colorGreenTopLeft, colorBlueTopLeft, 1f);
      result.add(v);
      v = new Vertex(minX, minY, minZ, minU, minV, brightnessBottomLeft, colorRedBottomLeft, colorGreenBottomLeft, colorBlueBottomLeft, 1f);
      result.add(v);
      v = new Vertex(maxX, minY, minZ, d7, d9, brightnessBottomRight, colorRedBottomRight, colorGreenBottomRight, colorBlueBottomRight, 1f);
      result.add(v);
      v = new Vertex(maxX, minY, maxZ, maxU, maxV, brightnessTopRight, colorRedTopRight, colorGreenTopRight, colorBlueTopRight, 1f);
      result.add(v);
    } else {
      v = new Vertex(minX, minY, maxZ, d8, d10);
      result.add(v);
      v = new Vertex(minX, minY, minZ, minU, minV);
      result.add(v);
      v = new Vertex(maxX, minY, minZ, d7, d9);
      result.add(v);
      v = new Vertex(maxX, minY, maxZ, maxU, maxV);
      result.add(v);
    }
    return result;
  }
View Full Code Here

  public List<Vertex> getCornersWithUvForFace(ForgeDirection face, float minU, float maxU, float minV, float maxV) {
    List<Vertex> result = new ArrayList<Vertex>(4);
    switch (face) {
    case NORTH:
      result.add(new Vertex(new Vector3d(maxX, minY, minZ), new Vector3f(0, 0, -1), new Vector2f(minU, minV)));
      result.add(new Vertex(new Vector3d(minX, minY, minZ), new Vector3f(0, 0, -1), new Vector2f(maxU, minV)));
      result.add(new Vertex(new Vector3d(minX, maxY, minZ), new Vector3f(0, 0, -1), new Vector2f(maxU, maxV)));
      result.add(new Vertex(new Vector3d(maxX, maxY, minZ), new Vector3f(0, 0, -1), new Vector2f(minU, maxV)));
      break;
    case SOUTH:
      result.add(new Vertex(new Vector3d(minX, minY, maxZ), new Vector3f(0, 0, 1), new Vector2f(maxU, minV)));
      result.add(new Vertex(new Vector3d(maxX, minY, maxZ), new Vector3f(0, 0, 1), new Vector2f(minU, minV)));
      result.add(new Vertex(new Vector3d(maxX, maxY, maxZ), new Vector3f(0, 0, 1), new Vector2f(minU, maxV)));
      result.add(new Vertex(new Vector3d(minX, maxY, maxZ), new Vector3f(0, 0, 1), new Vector2f(maxU, maxV)));
      break;
    case EAST:
      result.add(new Vertex(new Vector3d(maxX, maxY, minZ), new Vector3f(1, 0, 0), new Vector2f(maxU, maxV)));
      result.add(new Vertex(new Vector3d(maxX, maxY, maxZ), new Vector3f(1, 0, 0), new Vector2f(minU, maxV)));
      result.add(new Vertex(new Vector3d(maxX, minY, maxZ), new Vector3f(1, 0, 0), new Vector2f(minU, minV)));
      result.add(new Vertex(new Vector3d(maxX, minY, minZ), new Vector3f(1, 0, 0), new Vector2f(maxU, minV)));
      break;
    case WEST:
      result.add(new Vertex(new Vector3d(minX, minY, minZ), new Vector3f(-1, 0, 0), new Vector2f(maxU, minV)));
      result.add(new Vertex(new Vector3d(minX, minY, maxZ), new Vector3f(-1, 0, 0), new Vector2f(minU, minV)));
      result.add(new Vertex(new Vector3d(minX, maxY, maxZ), new Vector3f(-1, 0, 0), new Vector2f(minU, maxV)));
      result.add(new Vertex(new Vector3d(minX, maxY, minZ), new Vector3f(-1, 0, 0), new Vector2f(maxU, maxV)));
      break;
    case UP:
      result.add(new Vertex(new Vector3d(maxX, maxY, maxZ), new Vector3f(0, 1, 0), new Vector2f(minU, minV)));
      result.add(new Vertex(new Vector3d(maxX, maxY, minZ), new Vector3f(0, 1, 0), new Vector2f(minU, maxV)));
      result.add(new Vertex(new Vector3d(minX, maxY, minZ), new Vector3f(0, 1, 0), new Vector2f(maxU, maxV)));
      result.add(new Vertex(new Vector3d(minX, maxY, maxZ), new Vector3f(0, 1, 0), new Vector2f(maxU, minV)));
      break;
    case DOWN: //
    case UNKNOWN:
    default:
      result.add(new Vertex(new Vector3d(minX, minY, minZ), new Vector3f(0, -1, 0), new Vector2f(maxU, maxV)));
      result.add(new Vertex(new Vector3d(maxX, minY, minZ), new Vector3f(0, -1, 0), new Vector2f(minU, maxV)));
      result.add(new Vertex(new Vector3d(maxX, minY, maxZ), new Vector3f(0, -1, 0), new Vector2f(minU, minV)));
      result.add(new Vertex(new Vector3d(minX, minY, maxZ), new Vector3f(0, -1, 0), new Vector2f(maxU, minV)));
      break;
    }
    return result;
  }
View Full Code Here

          if(translateToXYZ) {
            RenderUtil.getUvForCorner(uv, corner, (int) x, (int) y, (int) z, face, texture);
          } else {
            RenderUtil.getUvForCorner(uv, corner, 0, 0, 0, face, texture);
          }
          Vertex vertex = new Vertex();
          vertex.xyz.set(corner);
          //vertex.xyz.add(ForgeDirectionOffsets.offsetScaled(face, 0.00005));
          vertex.uv = new Vector2f(uv);
          applyLighting(vertex, corner, refVertices);
          finalVerts.add(vertex);
        }
      }

      for (int i = 0; i < allEdges.size(); i++) {
        ForgeDirection dir = allEdges.get(i);
        ForgeDirection dir2 = i + 1 < allEdges.size() ? allEdges.get(i + 1) : allEdges.get(0);
        if(needsCorner(dir, dir2, edges, face, par1Block, x, y, z, rb.blockAccess)) {

          Vertex v = new Vertex();
          v.uv = new Vector2f();
          v.xyz.set(ForgeDirectionOffsets.forDir(dir));
          v.xyz.add(ForgeDirectionOffsets.forDir(dir2));
          //TODO: dodgy hack to just move the corner forward a bit         
          v.xyz.add(ForgeDirectionOffsets.offsetScaled(face, 0.001f));
View Full Code Here

    RenderUtil.addVerticesToTessellator(finalVerts, Tessellator.instance);
  }

  private Vertex getClosestVertex(List<Vertex> vertices, Vector3d corner) {
    Vertex result = null;
    double d2 = Double.MAX_VALUE;
    for (Vertex v : vertices) {
      double tmp = corner.distanceSquared(v.xyz);
      if(tmp <= d2) {
        result = v;
View Full Code Here

  }

  private void addVertexForCorner(ForgeDirection face, double x, double y, double z, IIcon texture, boolean translateToXYZ, List<Vertex> vertices,
      ForgeDirection dir, ForgeDirection dir2, Vector3d corner) {
    float scale = 1 / 16f;
    Vertex vert = new Vertex();
    vert.uv = new Vector2f();
    vert.xyz.set(corner);
    vert.xyz.sub(ForgeDirectionOffsets.offsetScaled(dir, scale));
    if(dir2 != null) {
      vert.xyz.sub(ForgeDirectionOffsets.offsetScaled(dir2, scale));
View Full Code Here

TOP

Related Classes of crazypants.vecmath.Vertex

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.