Package net.minecraft.src

Examples of net.minecraft.src.Tessellator


    Tessellator getTessellator(int texture) {
        if (texture == CTMUtils.terrainTexture) {
            return this;
        }
        Tessellator newTessellator = children.get(texture);
        if (newTessellator == null) {
            logger.finer("new tessellator for texture %d", texture);
            if (isForge) {
                newTessellator = new Tessellator();
            } else {
                newTessellator = new Tessellator(Math.max(bufferSize / 16, 131072));
            }
            newTessellator.texture = texture;
            copyFields(newTessellator, true);
            children.put(texture, newTessellator);
        } else {
View Full Code Here


        double j1 = j0 + 1.0;
        double k0 = k;
        double kM = k0 + 0.5;
        double k1 = k0 + 1.0;

        Tessellator tessellator = CTMUtils.newTessellator;
        active = true;

        boolean connectAny = connectWest || connectEast || connectNorth || connectSouth;

        if ((connectEast && connectWest) || !connectAny) {
            // full west-east pane
            setupTileCoords(TileOverride.SOUTH_FACE);
            tessellator.addVertexWithUV(i0, j1, kM, u0, v0);
            tessellator.addVertexWithUV(i0, j0, kM, u0, v1);
            tessellator.addVertexWithUV(i1, j0, kM, u1, v1);
            tessellator.addVertexWithUV(i1, j1, kM, u1, v0);

            setupTileCoords(TileOverride.NORTH_FACE);
            tessellator.addVertexWithUV(i1, j1, kM, u0, v0);
            tessellator.addVertexWithUV(i1, j0, kM, u0, v1);
            tessellator.addVertexWithUV(i0, j0, kM, u1, v1);
            tessellator.addVertexWithUV(i0, j1, kM, u1, v0);
        } else if (connectWest && !connectEast) {
            // west half-pane
            setupTileCoords(TileOverride.SOUTH_FACE);
            tessellator.addVertexWithUV(i0, j1, kM, u0, v0);
            tessellator.addVertexWithUV(i0, j0, kM, u0, v1);
            tessellator.addVertexWithUV(iM, j0, kM, uM, v1);
            tessellator.addVertexWithUV(iM, j1, kM, uM, v0);

            setupTileCoords(TileOverride.NORTH_FACE);
            tessellator.addVertexWithUV(iM, j1, kM, uM, v0);
            tessellator.addVertexWithUV(iM, j0, kM, uM, v1);
            tessellator.addVertexWithUV(i0, j0, kM, u1, v1);
            tessellator.addVertexWithUV(i0, j1, kM, u1, v0);
        } else if (!connectWest && connectEast) {
            // east half-pane
            setupTileCoords(TileOverride.SOUTH_FACE);
            tessellator.addVertexWithUV(iM, j1, kM, uM, v0);
            tessellator.addVertexWithUV(iM, j0, kM, uM, v1);
            tessellator.addVertexWithUV(i1, j0, kM, u1, v1);
            tessellator.addVertexWithUV(i1, j1, kM, u1, v0);

            setupTileCoords(TileOverride.NORTH_FACE);
            tessellator.addVertexWithUV(i1, j1, kM, u0, v0);
            tessellator.addVertexWithUV(i1, j0, kM, u0, v1);
            tessellator.addVertexWithUV(iM, j0, kM, uM, v1);
            tessellator.addVertexWithUV(iM, j1, kM, uM, v0);
        }

        if ((connectNorth && connectSouth) || !connectAny) {
            // full north-south pane
            setupTileCoords(TileOverride.WEST_FACE);
            tessellator.addVertexWithUV(iM, j1, k0, u0, v0);
            tessellator.addVertexWithUV(iM, j0, k0, u0, v1);
            tessellator.addVertexWithUV(iM, j0, k1, u1, v1);
            tessellator.addVertexWithUV(iM, j1, k1, u1, v0);

            setupTileCoords(TileOverride.EAST_FACE);
            tessellator.addVertexWithUV(iM, j1, k1, u0, v0);
            tessellator.addVertexWithUV(iM, j0, k1, u0, v1);
            tessellator.addVertexWithUV(iM, j0, k0, u1, v1);
            tessellator.addVertexWithUV(iM, j1, k0, u1, v0);
        } else if (connectNorth && !connectSouth) {
            // north half-pane
            setupTileCoords(TileOverride.WEST_FACE);
            tessellator.addVertexWithUV(iM, j1, k0, u0, v0);
            tessellator.addVertexWithUV(iM, j0, k0, u0, v1);
            tessellator.addVertexWithUV(iM, j0, kM, uM, v1);
            tessellator.addVertexWithUV(iM, j1, kM, uM, v0);

            setupTileCoords(TileOverride.EAST_FACE);
            tessellator.addVertexWithUV(iM, j1, kM, uM, v0);
            tessellator.addVertexWithUV(iM, j0, kM, uM, v1);
            tessellator.addVertexWithUV(iM, j0, k0, u1, v1);
            tessellator.addVertexWithUV(iM, j1, k0, u1, v0);
        } else if (!connectNorth && connectSouth) {
            // south half-pane
            setupTileCoords(TileOverride.WEST_FACE);
            tessellator.addVertexWithUV(iM, j1, kM, uM, v0);
            tessellator.addVertexWithUV(iM, j0, kM, uM, v1);
            tessellator.addVertexWithUV(iM, j0, k1, u1, v1);
            tessellator.addVertexWithUV(iM, j1, k1, u1, v0);

            setupTileCoords(TileOverride.EAST_FACE);
            tessellator.addVertexWithUV(iM, j1, k1, uM, v0);
            tessellator.addVertexWithUV(iM, j0, k1, uM, v1);
            tessellator.addVertexWithUV(iM, j0, kM, u1, v1);
            tessellator.addVertexWithUV(iM, j1, kM, u1, v0);
        }
    }
View Full Code Here

    public static boolean renderMooshroomOverlay() {
        if (overlayActive && overlayCounter < 3) {
            float tileX0 = overlayCounter / 3.0f;
            float tileX1 = ++overlayCounter / 3.0f;

            Tessellator tessellator = Tessellator.instance;
            tessellator.startDrawingQuads();
            tessellator.addVertexWithUV(MOO_X0, MOO_Y1, MOO_Z0, tileX0, 0.0);
            tessellator.addVertexWithUV(MOO_X0, MOO_Y0, MOO_Z0, tileX0, 1.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y0, MOO_Z1, tileX1, 1.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y1, MOO_Z1, tileX1, 0.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y1, MOO_Z1, tileX0, 0.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y0, MOO_Z1, tileX0, 1.0);
            tessellator.addVertexWithUV(MOO_X0, MOO_Y0, MOO_Z0, tileX1, 1.0);
            tessellator.addVertexWithUV(MOO_X0, MOO_Y1, MOO_Z0, tileX1, 0.0);
            tessellator.addVertexWithUV(MOO_X0, MOO_Y1, MOO_Z1, tileX0, 0.0);
            tessellator.addVertexWithUV(MOO_X0, MOO_Y0, MOO_Z1, tileX0, 1.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y0, MOO_Z0, tileX1, 1.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y1, MOO_Z0, tileX1, 0.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y1, MOO_Z0, tileX0, 0.0);
            tessellator.addVertexWithUV(MOO_X1, MOO_Y0, MOO_Z0, tileX0, 1.0);
            tessellator.addVertexWithUV(MOO_X0, MOO_Y0, MOO_Z1, tileX1, 1.0);
            tessellator.addVertexWithUV(MOO_X0, MOO_Y1, MOO_Z1, tileX1, 0.0);
            tessellator.draw();
        }
        return overlayActive;
    }
View Full Code Here

            return false;
        }
    }

    public static void renderSnowmanOverlay() {
        Tessellator tessellator = Tessellator.instance;
        tessellator.startDrawingQuads();

        double[] c = new double[4];

        // bottom = y-
        getTileCoordinates(0, c);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y0, SNOW_Z0, c[0], c[2]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y0, SNOW_Z1, c[1], c[2]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y0, SNOW_Z1, c[1], c[3]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y0, SNOW_Z0, c[0], c[3]);

        // top = y+
        getTileCoordinates(1, c);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y1, SNOW_Z0, c[0], c[2]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y1, SNOW_Z1, c[1], c[2]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y1, SNOW_Z1, c[1], c[3]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y1, SNOW_Z0, c[0], c[3]);

        // back = x-
        getTileCoordinates(2, c);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y1, SNOW_Z1, c[0], c[2]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y1, SNOW_Z0, c[1], c[2]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y0, SNOW_Z0, c[1], c[3]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y0, SNOW_Z1, c[0], c[3]);

        // right = z-
        getTileCoordinates(3, c);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y1, SNOW_Z0, c[0], c[2]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y1, SNOW_Z0, c[1], c[2]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y0, SNOW_Z0, c[1], c[3]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y0, SNOW_Z0, c[0], c[3]);

        // front = x+
        getTileCoordinates(4, c);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y1, SNOW_Z0, c[0], c[2]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y1, SNOW_Z1, c[1], c[2]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y0, SNOW_Z1, c[1], c[3]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y0, SNOW_Z0, c[0], c[3]);

        // left = z+
        getTileCoordinates(5, c);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y1, SNOW_Z1, c[0], c[2]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y1, SNOW_Z1, c[1], c[2]);
        tessellator.addVertexWithUV(SNOW_X0, SNOW_Y0, SNOW_Z1, c[1], c[3]);
        tessellator.addVertexWithUV(SNOW_X1, SNOW_Y0, SNOW_Z1, c[0], c[3]);

        tessellator.draw();
    }
View Full Code Here

  public static boolean renderMooshroomOverlay() {
    if (overlayActive && overlayCounter < 3) {
      float tileX0 = (float)overlayCounter / 3.0F;
      float tileX1 = (float)(++overlayCounter) / 3.0F;
      Tessellator tessellator = Tessellator.instance;
      tessellator.startDrawingQuads();
      tessellator.addVertexWithUV(-0.45D, 0.5D, -0.45D, (double)tileX0, 0.0D);
      tessellator.addVertexWithUV(-0.45D, -0.5D, -0.45D, (double)tileX0, 1.0D);
      tessellator.addVertexWithUV(0.45D, -0.5D, 0.45D, (double)tileX1, 1.0D);
      tessellator.addVertexWithUV(0.45D, 0.5D, 0.45D, (double)tileX1, 0.0D);
      tessellator.addVertexWithUV(0.45D, 0.5D, 0.45D, (double)tileX0, 0.0D);
      tessellator.addVertexWithUV(0.45D, -0.5D, 0.45D, (double)tileX0, 1.0D);
      tessellator.addVertexWithUV(-0.45D, -0.5D, -0.45D, (double)tileX1, 1.0D);
      tessellator.addVertexWithUV(-0.45D, 0.5D, -0.45D, (double)tileX1, 0.0D);
      tessellator.addVertexWithUV(-0.45D, 0.5D, 0.45D, (double)tileX0, 0.0D);
      tessellator.addVertexWithUV(-0.45D, -0.5D, 0.45D, (double)tileX0, 1.0D);
      tessellator.addVertexWithUV(0.45D, -0.5D, -0.45D, (double)tileX1, 1.0D);
      tessellator.addVertexWithUV(0.45D, 0.5D, -0.45D, (double)tileX1, 0.0D);
      tessellator.addVertexWithUV(0.45D, 0.5D, -0.45D, (double)tileX0, 0.0D);
      tessellator.addVertexWithUV(0.45D, -0.5D, -0.45D, (double)tileX0, 1.0D);
      tessellator.addVertexWithUV(-0.45D, -0.5D, 0.45D, (double)tileX1, 1.0D);
      tessellator.addVertexWithUV(-0.45D, 0.5D, 0.45D, (double)tileX1, 0.0D);
      tessellator.draw();
    }

    return overlayActive;
  }
View Full Code Here

      return false;
    }
  }

  public static void renderSnowmanOverlay() {
    Tessellator tessellator = Tessellator.instance;
    tessellator.startDrawingQuads();
    double[] c = new double[4];
    getTileCoordinates(0, c);
    tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[0], c[2]);
    tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[1], c[2]);
    tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[1], c[3]);
    tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[0], c[3]);
    getTileCoordinates(1, c);
    tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[0], c[2]);
    tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[1], c[2]);
    tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[1], c[3]);
    tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[0], c[3]);
    getTileCoordinates(2, c);
    tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[0], c[2]);
    tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[1], c[2]);
    tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[1], c[3]);
    tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[0], c[3]);
    getTileCoordinates(3, c);
    tessellator.addVertexWithUV(-0.5D, 0.5D, -0.5D, c[0], c[2]);
    tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[1], c[2]);
    tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[1], c[3]);
    tessellator.addVertexWithUV(-0.5D, -0.5D, -0.5D, c[0], c[3]);
    getTileCoordinates(4, c);
    tessellator.addVertexWithUV(0.5D, 0.5D, -0.5D, c[0], c[2]);
    tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[1], c[2]);
    tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[1], c[3]);
    tessellator.addVertexWithUV(0.5D, -0.5D, -0.5D, c[0], c[3]);
    getTileCoordinates(5, c);
    tessellator.addVertexWithUV(0.5D, 0.5D, 0.5D, c[0], c[2]);
    tessellator.addVertexWithUV(-0.5D, 0.5D, 0.5D, c[1], c[2]);
    tessellator.addVertexWithUV(-0.5D, -0.5D, 0.5D, c[1], c[3]);
    tessellator.addVertexWithUV(0.5D, -0.5D, 0.5D, c[0], c[3]);
    tessellator.draw();
  }
View Full Code Here

          this.plusSZ -= 0.00390625D;
        }
      }

      TexturePackAPI.bindTexture(this.texture);
      Tessellator tessellator = Tessellator.instance;
      tessellator.startDrawingQuads();
      GL11.glDisable(GL11.GL_CULL_FACE);
      GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F);
      dx += this.sx + this.plusSX;
      dy += this.sy + this.plusSY;
      dz += this.sz + this.plusSZ;
      double x0 = x;
      double y0 = y + this.a + this.b;
      double z0 = z;
      double u0 = 0.0D;
      double len = Math.sqrt(dx * dx + dy * dy + dz * dz);
      double t = this.tileFactor + this.plusTile;
      double w = this.width + this.plusWidth;

      if (changed) {
        logger.info("%s: dx=%f, dy=%f, dz=%f, len=%f(*%d=%f), slen=%f", new Object[] {this, Double.valueOf(dx), Double.valueOf(dy), Double.valueOf(dz), Double.valueOf(len), Integer.valueOf((int)t), Double.valueOf(len * t), Double.valueOf(len * t / (double)this.segments)});
        System.out.printf("width=%f\n", new Object[] {Double.valueOf(w)});
        System.out.printf("tileFactor=%f\n", new Object[] {Double.valueOf(t)});
        System.out.printf("sx=%f\n", new Object[] {Double.valueOf(this.sx + this.plusSX)});
        System.out.printf("sy=%f\n", new Object[] {Double.valueOf(this.sy + this.plusSY)});
        System.out.printf("sz=%f\n", new Object[] {Double.valueOf(this.sz + this.plusSZ)});
      }

      len *= t / (double)this.segments;

      for (int i = 1; i <= this.segments; ++i) {
        double s = (double)i / (double)this.segments;
        double x1 = x + s * dx;
        double y1 = y + (s * s + s) * 0.5D * dy + this.a * (1.0D - s) + this.b;
        double z1 = z + s * dz;
        double u1 = (double)(this.segments - i) * len;
        tessellator.addVertexWithUV(x0, y0, z0, u0, 1.0D);
        tessellator.addVertexWithUV(x1, y1, z1, u1, 1.0D);
        tessellator.addVertexWithUV(x1 + w, y1 + w, z1, u1, 0.0D);
        tessellator.addVertexWithUV(x0 + w, y0 + w, z0, u0, 0.0D);
        tessellator.addVertexWithUV(x0, y0 + w, z0, u0, 1.0D);
        tessellator.addVertexWithUV(x1, y1 + w, z1, u1, 1.0D);
        tessellator.addVertexWithUV(x1 + w, y1, z1 + w, u1, 0.0D);
        tessellator.addVertexWithUV(x0 + w, y0, z0 + w, u0, 0.0D);
        x0 = x1;
        y0 = y1;
        z0 = z1;
        u0 = u1;
      }

      tessellator.draw();
      GL11.glEnable(GL11.GL_CULL_FACE);
      return true;
    }
  }
View Full Code Here

    TextureMap textureMap = (TextureMap)iconMap.get(icon);

    if (textureMap == null) {
      return tessellator;
    } else {
      Tessellator newTessellator = (Tessellator)tessellator.children.get(textureMap);

      if (newTessellator == null) {
        String mapName = (String)textureMapNames.get(textureMap);

        if (mapName == null) {
          mapName = textureMap.toString();
        }

        logger.fine("new Tessellator for texture map %s gl texture %d", new Object[] {mapName, Integer.valueOf(textureMap.glTextureId)});
        newTessellator = new Tessellator(2097152);
        copyFields(tessellator, newTessellator, true);
        newTessellator.textureMap = textureMap;
        tessellator.children.put(textureMap, newTessellator);
      } else {
        copyFields(tessellator, newTessellator, false);
View Full Code Here

  static void clear(Tessellator tessellator) {
    Iterator i$ = tessellator.children.values().iterator();

    while (i$.hasNext()) {
      Tessellator child = (Tessellator)i$.next();
      clear(child);
    }

    tessellator.children.clear();
    textureMapNames.clear();
View Full Code Here

  public static void resetChildren(Tessellator tessellator) {
    Iterator i$ = tessellator.children.values().iterator();

    while (i$.hasNext()) {
      Tessellator child = (Tessellator)i$.next();
      child.reset();
    }
  }
View Full Code Here

TOP

Related Classes of net.minecraft.src.Tessellator

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.