Java 类net.minecraft.client.model.PositionTextureVertex 实例源码

项目:ObsidianSuite    文件:TexturedTri.java   
/**
 * Draw this primitve. This is typically called only once as the generated drawing instructions are saved by the
 * renderer and reused later.
 */
@SideOnly(Side.CLIENT)
public void draw(BufferBuilder renderer, float scale)
{   
    Vec3d vec3d = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[0].vector3D);
    Vec3d vec3d1 = this.vertexPositions[1].vector3D.subtractReverse(this.vertexPositions[2].vector3D);
    Vec3d vec3d2 = vec3d1.crossProduct(vec3d).normalize();
    float f = (float)vec3d2.x;
    float f1 = (float)vec3d2.y;
    float f2 = (float)vec3d2.z;

    renderer.begin(7, DefaultVertexFormats.POSITION_TEX);
    for (int i = 0; i < 3; ++i)
    {
        PositionTextureVertex positiontexturevertex = this.vertexPositions[i];
        renderer.pos(positiontexturevertex.vector3D.x * (double)scale, positiontexturevertex.vector3D.y * (double)scale, positiontexturevertex.vector3D.z * (double)scale).tex((double)positiontexturevertex.texturePositionX, (double)positiontexturevertex.texturePositionY).endVertex();
    }
    renderer.pos(this.vertexPositions[0].vector3D.x * (double)scale, this.vertexPositions[0].vector3D.y * (double)scale, this.vertexPositions[0].vector3D.z * (double)scale).endVertex();

    Tessellator.getInstance().draw();
}
项目:CraftStudioAPI    文件:CSModelBox.java   
/**
 * Calculate the PositionTextureVertex from a rectangular box.
 *
 * @param x
 *            The X coordinate of the starting point of the box.
 * @param y
 *            The Y coordinate of the starting point of the box.
 * @param z
 *            The Z coordinate of the starting point of the box.
 * @param dx
 *            The length of the box on the X axis.
 * @param dy
 *            The length of the box on the Y axis.
 * @param dz
 *            The length of the box on the Z axis.
 * @param mirror
 *            True if the texture should be mirrored, False if it shouldn't.
 * @return A 8 long array of PositionTextureVertex that can be used to
 *         create a rectangular box.
 */
public static PositionTextureVertex[] getVerticesForRect(float x, float y, float z, float dx, float dy, float dz, boolean mirror) {
    PositionTextureVertex[] positionTextureVertex = new PositionTextureVertex[8];
    float endX = x + dx;
    float endY = y + dy;
    float endZ = z + dz;

    if (mirror) {
        float buffer = endX;
        endX = x;
        x = buffer;
    }

    positionTextureVertex[0] = new PositionTextureVertex(x, y, z, 0.0F, 0.0F);
    positionTextureVertex[1] = new PositionTextureVertex(endX, y, z, 0.0F, 0.0F);
    positionTextureVertex[2] = new PositionTextureVertex(endX, endY, z, 0.0F, 0.0F);
    positionTextureVertex[3] = new PositionTextureVertex(x, endY, z, 0.0F, 0.0F);
    positionTextureVertex[4] = new PositionTextureVertex(x, y, endZ, 0.0F, 0.0F);
    positionTextureVertex[5] = new PositionTextureVertex(endX, y, endZ, 0.0F, 0.0F);
    positionTextureVertex[6] = new PositionTextureVertex(endX, endY, endZ, 0.0F, 0.0F);
    positionTextureVertex[7] = new PositionTextureVertex(x, endY, endZ, 0.0F, 0.0F);

    return positionTextureVertex;
}
项目:CraftStudioAPI    文件:ModelCraftStudio.java   
/** Generate CSModelRenderer from readed model block */
private CSModelRenderer generateCSModelRend(CSReadedModelBlock rBlock) {
    CSModelRenderer modelRend = new CSModelRenderer(this, rBlock.getName(), rBlock.getTexOffset()[0], rBlock.getTexOffset()[1]);
    if (rBlock.getVertex() != null) {
        PositionTextureVertex vertices[] = new PositionTextureVertex[8];
        for (int i = 0; i < 8; i++)
            vertices[i] = new PositionTextureVertex(rBlock.getVertex()[i][0], rBlock.getVertex()[i][1], rBlock.getVertex()[i][2], 0.0F, 0.0F);
        modelRend.addBox(vertices, CSModelBox.getTextureUVsForRect(rBlock.getTexOffset()[0], rBlock.getTexOffset()[1], rBlock.getSize().x,
                rBlock.getSize().y, rBlock.getSize().z));
    }
    else
        modelRend.addBox(-rBlock.getSize().x / 2, -rBlock.getSize().y / 2, -rBlock.getSize().z / 2, rBlock.getSize().x, rBlock.getSize().y,
                rBlock.getSize().z);
    modelRend.setDefaultRotationPoint(rBlock.getRotationPoint().x, rBlock.getRotationPoint().y, rBlock.getRotationPoint().z);
    modelRend.setInitialRotationMatrix(rBlock.getRotation().x, rBlock.getRotation().y, rBlock.getRotation().z);
    modelRend.setDefaultOffset(rBlock.getOffset().x, rBlock.getOffset().y, rBlock.getOffset().z);
    modelRend.setDefaultStretch(rBlock.getStretch().x, rBlock.getStretch().y, rBlock.getStretch().z);
    modelRend.setTextureSize(this.textureWidth, this.textureHeight);
    return modelRend;
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
public ModelRendererTurbo(ModelBase modelbase, String s) {
    super(modelbase, s);
    this.flip = false;
    this.compiled = false;
    this.displayList = 0;
    this.mirror = false;
    this.showModel = true;
    this.field_1402_i = false;
    this.vertices = new PositionTextureVertex[0];
    this.faces = new TexturedPolygon[0];
    this.forcedRecompile = false;
    this.transformGroup = new HashMap<>();
    this.transformGroup.put("0", new TransformGroupBone(new Bone(0, 0, 0, 0), 1D));
    this.textureGroup = new HashMap<>();
    this.textureGroup.put("0", new TextureGroup());
    this.currentTextureGroup = this.textureGroup.get("0");
    this.boxName = s;
    this.defaultTexture = "";
    this.useLegacyCompiler = false;
}
项目:RuneCraftery    文件:TexturedQuad.java   
public void func_78236_a(Tessellator p_78236_1_, float p_78236_2_) {
   Vec3 var3 = this.field_78239_a[1].field_78243_a.func_72444_a(this.field_78239_a[0].field_78243_a);
   Vec3 var4 = this.field_78239_a[1].field_78243_a.func_72444_a(this.field_78239_a[2].field_78243_a);
   Vec3 var5 = var4.func_72431_c(var3).func_72432_b();
   p_78236_1_.func_78382_b();
   if(this.field_78238_c) {
      p_78236_1_.func_78375_b(-((float)var5.field_72450_a), -((float)var5.field_72448_b), -((float)var5.field_72449_c));
   } else {
      p_78236_1_.func_78375_b((float)var5.field_72450_a, (float)var5.field_72448_b, (float)var5.field_72449_c);
   }

   for(int var6 = 0; var6 < 4; ++var6) {
      PositionTextureVertex var7 = this.field_78239_a[var6];
      p_78236_1_.func_78374_a((double)((float)var7.field_78243_a.field_72450_a * p_78236_2_), (double)((float)var7.field_78243_a.field_72448_b * p_78236_2_), (double)((float)var7.field_78243_a.field_72449_c * p_78236_2_), (double)var7.field_78241_b, (double)var7.field_78242_c);
   }

   p_78236_1_.func_78381_a();
}
项目:Agriculture2    文件:TexturedQuadIcon.java   
public void draw(final Tessellator par1Tessellator, final float par2, final IIcon icon)
{
    final Vec3 vec3 = vertexPositions[1].vector3D.subtract(vertexPositions[0].vector3D);
    final Vec3 vec31 = vertexPositions[1].vector3D.subtract(vertexPositions[2].vector3D);
    final Vec3 vec32 = vec31.crossProduct(vec3).normalize();
    par1Tessellator.startDrawingQuads();

    if (invertNormal)
    {
        par1Tessellator.setNormal(-((float) vec32.xCoord), -((float) vec32.yCoord), -((float) vec32.zCoord));
    }
    else
    {
        par1Tessellator.setNormal((float) vec32.xCoord, (float) vec32.yCoord, (float) vec32.zCoord);
    }

    for (int i = 0; i < 4; ++i)
    {
        final PositionTextureVertex positiontexturevertex = vertexPositions[i];
        par1Tessellator.addVertexWithUV((float) positiontexturevertex.vector3D.xCoord * par2, (float) positiontexturevertex.vector3D.yCoord * par2, (float) positiontexturevertex.vector3D.zCoord * par2, icon.getMinU(), icon.getMaxV());
    }

    par1Tessellator.draw();
}
项目:Agriculture    文件:TexturedQuadIcon.java   
public void draw(final Tessellator par1Tessellator, final float par2, final Icon icon)
{
    final Vec3 vec3 = vertexPositions[1].vector3D.subtract(vertexPositions[0].vector3D);
    final Vec3 vec31 = vertexPositions[1].vector3D.subtract(vertexPositions[2].vector3D);
    final Vec3 vec32 = vec31.crossProduct(vec3).normalize();
    par1Tessellator.startDrawingQuads();

    if (invertNormal)
    {
        par1Tessellator.setNormal(-((float) vec32.xCoord), -((float) vec32.yCoord), -((float) vec32.zCoord));
    }
    else
    {
        par1Tessellator.setNormal((float) vec32.xCoord, (float) vec32.yCoord, (float) vec32.zCoord);
    }

    for (int i = 0; i < 4; ++i)
    {
        final PositionTextureVertex positiontexturevertex = vertexPositions[i];
        par1Tessellator.addVertexWithUV((float) positiontexturevertex.vector3D.xCoord * par2, (float) positiontexturevertex.vector3D.yCoord * par2, (float) positiontexturevertex.vector3D.zCoord * par2, icon.getMinU(), icon.getMaxV());
    }

    par1Tessellator.draw();
}
项目:MMDLib-old    文件:PositionTransformVertex.java   
public PositionTransformVertex(PositionTextureVertex vertex, float u, float v) {
    super(vertex, u, v);
    if (vertex instanceof PositionTransformVertex)
        this.neutralVector = ((PositionTransformVertex) vertex).neutralVector;
    else
        this.neutralVector = new Vec3d(vertex.vector3D.xCoord, vertex.vector3D.yCoord, vertex.vector3D.zCoord);
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
/**
 * Creates a new polygon, and adds UV mapping to it.
 *
 * @param verts an array of vertices
 * @param uv an array of UV coordinates
 */
public void addPolygon (PositionTextureVertex[] verts, int[][] uv) {
    try {
        for (int i = 0; i < verts.length; i++)
            verts[i] = verts[i].setTexturePosition(uv[i][0] / this.textureWidth, uv[i][1] / this.textureHeight);
    }
    finally {
        this.addPolygon(verts);
    }
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
/**
 * Adds a rectangular shape. Basically, you can make any eight-pointed shape you want, as
 * the method requires eight vector coordinates.
 *
 * @param v a float array with three values, the x, y and z coordinates of the vertex
 * @param v1 a float array with three values, the x, y and z coordinates of the vertex
 * @param v2 a float array with three values, the x, y and z coordinates of the vertex
 * @param v3 a float array with three values, the x, y and z coordinates of the vertex
 * @param v4 a float array with three values, the x, y and z coordinates of the vertex
 * @param v5 a float array with three values, the x, y and z coordinates of the vertex
 * @param v6 a float array with three values, the x, y and z coordinates of the vertex
 * @param v7 a float array with three values, the x, y and z coordinates of the vertex
 * @param w the width of the shape, used in determining the texture
 * @param h the height of the shape, used in determining the texture
 * @param d the depth of the shape, used in determining the texture
 */
public void addRectShape (float[] v, float[] v1, float[] v2, float[] v3, float[] v4, float[] v5, float[] v6, float[] v7, int w, int h, int d) {
    final PositionTextureVertex[] verts = new PositionTextureVertex[8];
    final TexturedPolygon[] poly = new TexturedPolygon[6];
    final PositionTextureVertex positionTexturevertex = new PositionTextureVertex(v[0], v[1], v[2], 0.0F, 0.0F);
    final PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(v1[0], v1[1], v1[2], 0.0F, 8F);
    final PositionTextureVertex positionTexturevertex2 = new PositionTextureVertex(v2[0], v2[1], v2[2], 8F, 8F);
    final PositionTextureVertex positionTexturevertex3 = new PositionTextureVertex(v3[0], v3[1], v3[2], 8F, 0.0F);
    final PositionTextureVertex positionTexturevertex4 = new PositionTextureVertex(v4[0], v4[1], v4[2], 0.0F, 0.0F);
    final PositionTextureVertex positionTexturevertex5 = new PositionTextureVertex(v5[0], v5[1], v5[2], 0.0F, 8F);
    final PositionTextureVertex positionTexturevertex6 = new PositionTextureVertex(v6[0], v6[1], v6[2], 8F, 8F);
    final PositionTextureVertex positionTexturevertex7 = new PositionTextureVertex(v7[0], v7[1], v7[2], 8F, 0.0F);
    verts[0] = positionTexturevertex;
    verts[1] = positionTexturevertex1;
    verts[2] = positionTexturevertex2;
    verts[3] = positionTexturevertex3;
    verts[4] = positionTexturevertex4;
    verts[5] = positionTexturevertex5;
    verts[6] = positionTexturevertex6;
    verts[7] = positionTexturevertex7;
    poly[0] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 }, this.textureOffsetX + d + w, this.textureOffsetY + d, this.textureOffsetX + d + w + d, this.textureOffsetY + d + h);
    poly[1] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 }, this.textureOffsetX + 0, this.textureOffsetY + d, this.textureOffsetX + d, this.textureOffsetY + d + h);
    poly[2] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 }, this.textureOffsetX + d, this.textureOffsetY + 0, this.textureOffsetX + d + w, this.textureOffsetY + d);
    poly[3] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 }, this.textureOffsetX + d + w, this.textureOffsetY + 0, this.textureOffsetX + d + w + w, this.textureOffsetY + d);
    poly[4] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 }, this.textureOffsetX + d, this.textureOffsetY + d, this.textureOffsetX + d + w, this.textureOffsetY + d + h);
    poly[5] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 }, this.textureOffsetX + d + w + d, this.textureOffsetY + d, this.textureOffsetX + d + w + d + w, this.textureOffsetY + d + h);
    if (this.mirror ^ this.flip)
        for (final TexturedPolygon element : poly)
            element.flipFace();
    this.copyTo(verts, poly);
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
/**
 * Adds a cube the size of one pixel. It will take a pixel from the texture and uses that
 * as the texture of said cube. The accurate name would actually be "addVoxel". It will not
 * overwrite the model data, but rather, it will add to the model.
 *
 * @param x the starting x-position
 * @param y the starting y-position
 * @param z the starting z-position
 * @param scale the "scale" of the cube, where scale is a float integer consisting of three
 *        values
 * @param w the x-coordinate on the texture
 * @param h the y-coordinate on the texture
 */
public void addPixel (float x, float y, float z, float[] scale, int w, int h) {
    final PositionTextureVertex[] verts = new PositionTextureVertex[8];
    final TexturedPolygon[] poly = new TexturedPolygon[6];
    final float x1 = x + scale[0];
    final float y1 = y + scale[1];
    final float z1 = z + scale[2];
    final float[] f = { x, y, z };
    final float[] f1 = { x1, y, z };
    final float[] f2 = { x1, y1, z };
    final float[] f3 = { x, y1, z };
    final float[] f4 = { x, y, z1 };
    final float[] f5 = { x1, y, z1 };
    final float[] f6 = { x1, y1, z1 };
    final float[] f7 = { x, y1, z1 };
    final PositionTextureVertex positionTexturevertex = new PositionTextureVertex(f[0], f[1], f[2], 0.0F, 0.0F);
    final PositionTextureVertex positionTexturevertex1 = new PositionTextureVertex(f1[0], f1[1], f1[2], 0.0F, 8F);
    final PositionTextureVertex positionTexturevertex2 = new PositionTextureVertex(f2[0], f2[1], f2[2], 8F, 8F);
    final PositionTextureVertex positionTexturevertex3 = new PositionTextureVertex(f3[0], f3[1], f3[2], 8F, 0.0F);
    final PositionTextureVertex positionTexturevertex4 = new PositionTextureVertex(f4[0], f4[1], f4[2], 0.0F, 0.0F);
    final PositionTextureVertex positionTexturevertex5 = new PositionTextureVertex(f5[0], f5[1], f5[2], 0.0F, 8F);
    final PositionTextureVertex positionTexturevertex6 = new PositionTextureVertex(f6[0], f6[1], f6[2], 8F, 8F);
    final PositionTextureVertex positionTexturevertex7 = new PositionTextureVertex(f7[0], f7[1], f7[2], 8F, 0.0F);
    verts[0] = positionTexturevertex;
    verts[1] = positionTexturevertex1;
    verts[2] = positionTexturevertex2;
    verts[3] = positionTexturevertex3;
    verts[4] = positionTexturevertex4;
    verts[5] = positionTexturevertex5;
    verts[6] = positionTexturevertex6;
    verts[7] = positionTexturevertex7;
    poly[0] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex1, positionTexturevertex2, positionTexturevertex6 }, w, h, w + 1, h + 1);
    poly[1] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex, positionTexturevertex4, positionTexturevertex7, positionTexturevertex3 }, w, h, w + 1, h + 1);
    poly[2] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex5, positionTexturevertex4, positionTexturevertex, positionTexturevertex1 }, w, h, w + 1, h + 1);
    poly[3] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex2, positionTexturevertex3, positionTexturevertex7, positionTexturevertex6 }, w, h, w + 1, h + 1);
    poly[4] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex1, positionTexturevertex, positionTexturevertex3, positionTexturevertex2 }, w, h, w + 1, h + 1);
    poly[5] = this.addPolygonReturn(new PositionTextureVertex[] { positionTexturevertex4, positionTexturevertex5, positionTexturevertex6, positionTexturevertex7 }, w, h, w + 1, h + 1);
    this.copyTo(verts, poly);
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
/**
 * Adds model format support. Model files use the entire texture file.
 *
 * @param file the location of the model file. The location is relative to the base
 *        directories, which are either resources/models or resources/mods/models.
 * @param modelFormat the class of the model format interpreter
 */
public void addModel (String file, Class modelFormat) {
    final ModelPoolEntry entry = ModelPool.addFile(file, modelFormat, this.transformGroup, this.textureGroup);
    if (entry == null)
        return;
    final PositionTextureVertex[] verts = Arrays.copyOf(entry.vertices, entry.vertices.length);
    final TexturedPolygon[] poly = Arrays.copyOf(entry.faces, entry.faces.length);
    if (this.flip)
        for (final TexturedPolygon face : this.faces)
            face.flipFace();
    this.copyTo(verts, poly, false);
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
public void addModelF (String file, Class modelFormat) throws IOException {
    final ModelPoolEntry entry = ModelPool.addFileF(file, modelFormat, this.transformGroup, this.textureGroup);
    if (entry == null)
        return;
    final PositionTextureVertex[] verts = Arrays.copyOf(entry.vertices, entry.vertices.length);
    final TexturedPolygon[] poly = Arrays.copyOf(entry.faces, entry.faces.length);
    if (this.flip)
        for (final TexturedPolygon face : this.faces)
            face.flipFace();
    this.copyTo(verts, poly, false);
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
/**
 * Mirrors the model in any direction.
 *
 * @param x whether the model should be mirrored in the x-direction
 * @param y whether the model should be mirrored in the y-direction
 * @param z whether the model should be mirrored in the z-direction
 */
public void doMirror (boolean x, boolean y, boolean z) {
    for (final TexturedPolygon face : this.faces) {
        final PositionTextureVertex[] verts = face.vertexPositions;
        for (final PositionTextureVertex vert : verts)
            /*
             * verts[j].vector3D.xCoord *= (x ? -1 : 1); verts[j].vector3D.yCoord *= (y ?
             * -1 : 1); verts[j].vector3D.zCoord *= (z ? -1 : 1);
             */
            vert.vector3D.addVector(vert.vector3D.xCoord * (x ? -1 : 1), vert.vector3D.xCoord * (y ? -1 : 1), vert.vector3D.xCoord * (z ? -1 : 1));
        if (x ^ y ^ z)
            face.flipFace();
    }
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
/**
 * Clears the current shape. Since all shapes are stacked into one shape, you can't just
 * replace a shape by overwriting the shape with another one. In this case you would need
 * to clear the shape first.
 */
public void clear () {
    this.vertices = new PositionTextureVertex[0];
    this.faces = new TexturedPolygon[0];
    this.transformGroup.clear();
    this.transformGroup.put("0", new TransformGroupBone(new Bone(0, 0, 0, 0), 1D));
    this.currentGroup = this.transformGroup.get("0");
}
项目:MMDLib-old    文件:ModelRendererTurbo.java   
public void copyTo (PositionTextureVertex[] verts, TexturedPolygon[] poly, boolean copyGroup) {
    this.vertices = Arrays.copyOf(this.vertices, this.vertices.length + verts.length);
    this.faces = Arrays.copyOf(this.faces, this.faces.length + poly.length);
    for (int idx = 0; idx < verts.length; idx++) {
        this.vertices[this.vertices.length - verts.length + idx] = verts[idx];
        if (copyGroup && verts[idx] instanceof PositionTransformVertex)
            ((PositionTransformVertex) verts[idx]).addGroup(this.currentGroup);
    }
    for (int idx = 0; idx < poly.length; idx++) {
        this.faces[this.faces.length - poly.length + idx] = poly[idx];
        if (copyGroup)
            this.currentTextureGroup.addPoly(poly[idx]);
    }
}
项目:MMDLib-old    文件:TexturedPolygon.java   
public void draw (Tessellator tessellator, float f) {
    if (this.nVertices == 3)
        tessellator.startDrawing(GL11.GL_TRIANGLES);
    else if (this.nVertices == 4)
        tessellator.startDrawing(GL11.GL_QUADS);
    else
        tessellator.startDrawing(GL11.GL_POLYGON);
    if (this.iNormals.size() == 0)
        if (this.normals.length == 3) {
            if (this.invertNormal)
                tessellator.setNormal(-this.normals[0], -this.normals[1], -this.normals[2]);
            else
                tessellator.setNormal(this.normals[0], this.normals[1], this.normals[2]);
        }
        else if (this.vertexPositions.length >= 3) {
            final Vec3d Vec3d = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[0].vector3D);
            final net.minecraft.util.math.Vec3d Vec3d1 = this.vertexPositions[1].vector3D.subtract(this.vertexPositions[2].vector3D);
            final net.minecraft.util.math.Vec3d Vec3d2 = Vec3d1.crossProduct(Vec3d).normalize();
            if (this.invertNormal)
                tessellator.setNormal(-(float) Vec3d2.xCoord, -(float) Vec3d2.yCoord, -(float) Vec3d2.zCoord);
            else
                tessellator.setNormal((float) Vec3d2.xCoord, (float) Vec3d2.yCoord, (float) Vec3d2.zCoord);
        }
        else
            return;
    for (int i = 0; i < this.nVertices; i++) {
        final PositionTextureVertex positionTexturevertex = this.vertexPositions[i];
        if (positionTexturevertex instanceof PositionTransformVertex)
            ((PositionTransformVertex) positionTexturevertex).setTransformation();
        if (i < this.iNormals.size())
            if (this.invertNormal)
                tessellator.setNormal(-(float) this.iNormals.get(i).xCoord, -(float) this.iNormals.get(i).yCoord, -(float) this.iNormals.get(i).zCoord);
            else
                tessellator.setNormal((float) this.iNormals.get(i).xCoord, (float) this.iNormals.get(i).yCoord, (float) this.iNormals.get(i).zCoord);
        tessellator.addVertexWithUV((float) positionTexturevertex.vector3D.xCoord * f, (float) positionTexturevertex.vector3D.yCoord * f, (float) positionTexturevertex.vector3D.zCoord * f, positionTexturevertex.texturePositionX, positionTexturevertex.texturePositionY);
    }
    tessellator.draw();
}
项目:TFC2    文件:ModelBoxTFC.java   
public TexturedQuadTFC(PositionTextureVertex[] vertices, float texcoordU1, float texcoordV1, float texcoordU2, float texcoordV2, 
        float textureWidth, float textureHeight) 
{
    super(vertices);
    float f = 0.0F / textureWidth;
    float f1 = 0.0F / textureHeight;
    vertices[0] = vertices[0].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV1 / textureHeight + f1);
    vertices[1] = vertices[1].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV1 / textureHeight + f1);
    vertices[2] = vertices[2].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV2 / textureHeight - f1);
    vertices[3] = vertices[3].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV2 / textureHeight - f1);
}
项目:TFC2    文件:ModelBoxTFC.java   
public TexturedQuadTFC(PositionTextureVertex[] vertices, float texcoordU1, float texcoordV1, float texcoordU2, float texcoordV2, 
        float textureWidth, float textureHeight) 
{
    super(vertices);
    float f = 0.0F / textureWidth;
    float f1 = 0.0F / textureHeight;
    vertices[0] = vertices[0].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV1 / textureHeight + f1);
    vertices[1] = vertices[1].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV1 / textureHeight + f1);
    vertices[2] = vertices[2].setTexturePosition((float)texcoordU1 / textureWidth + f, (float)texcoordV2 / textureHeight - f1);
    vertices[3] = vertices[3].setTexturePosition((float)texcoordU2 / textureWidth - f, (float)texcoordV2 / textureHeight - f1);
}
项目:RuneCraftery    文件:TexturedQuad.java   
public TexturedQuad(PositionTextureVertex[] p_i1153_1_, int p_i1153_2_, int p_i1153_3_, int p_i1153_4_, int p_i1153_5_, float p_i1153_6_, float p_i1153_7_) {
   this(p_i1153_1_);
   float var8 = 0.0F / p_i1153_6_;
   float var9 = 0.0F / p_i1153_7_;
   p_i1153_1_[0] = p_i1153_1_[0].func_78240_a((float)p_i1153_4_ / p_i1153_6_ - var8, (float)p_i1153_3_ / p_i1153_7_ + var9);
   p_i1153_1_[1] = p_i1153_1_[1].func_78240_a((float)p_i1153_2_ / p_i1153_6_ + var8, (float)p_i1153_3_ / p_i1153_7_ + var9);
   p_i1153_1_[2] = p_i1153_1_[2].func_78240_a((float)p_i1153_2_ / p_i1153_6_ + var8, (float)p_i1153_5_ / p_i1153_7_ - var9);
   p_i1153_1_[3] = p_i1153_1_[3].func_78240_a((float)p_i1153_4_ / p_i1153_6_ - var8, (float)p_i1153_5_ / p_i1153_7_ - var9);
}
项目:RuneCraftery    文件:TexturedQuad.java   
public void func_78235_a() {
   PositionTextureVertex[] var1 = new PositionTextureVertex[this.field_78239_a.length];

   for(int var2 = 0; var2 < this.field_78239_a.length; ++var2) {
      var1[var2] = this.field_78239_a[this.field_78239_a.length - var2 - 1];
   }

   this.field_78239_a = var1;
}
项目:ObsidianSuite    文件:TexturedTri.java   
public TexturedTri(PositionTextureVertex[] vertices)
{
    this.vertexPositions = vertices;
}
项目:MineLittlePony    文件:ModelHornGlow.java   
public ModelHornGlow(HornGlowRenderer par1ModelRenderer, int par2, int par3, float par4, float par5, float par6, int par7, int par8, int par9, float par10) {
    super(par1ModelRenderer, par2, par3, par4, par5, par6, par7, par8, par9, par10);

    this.quadList = new TexturedQuad[6];
    float var11 = par4 + par7;
    float var12 = par5 + par8;
    float var13 = par6 + par9;
    float halfpar4 = par4 + par7 * 0.05F;
    float halfpar6 = par6 + par9 * 0.05F;
    float halfvar11 = par4 + par7 * 0.95F;
    float halfvar13 = par6 + par9 * 0.95F;
    par4 -= par10;
    par5 -= par10;
    par6 -= par10;
    var11 += par10;
    var12 += par10;
    var13 += par10;
    if (par1ModelRenderer.mirror) {
        float var26 = var11;
        var11 = par4;
        par4 = var26;
    }

    PositionTextureVertex var32 = new PositionTextureVertex(halfpar4, par5, halfpar6, 0.0F, 0.0F);
    PositionTextureVertex var15 = new PositionTextureVertex(halfvar11, par5, halfpar6, 0.0F, 8.0F);
    PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, par6, 8.0F, 8.0F);
    PositionTextureVertex var17 = new PositionTextureVertex(par4, var12, par6, 8.0F, 0.0F);
    PositionTextureVertex var18 = new PositionTextureVertex(halfpar4, par5, halfvar13, 0.0F, 0.0F);
    PositionTextureVertex var19 = new PositionTextureVertex(halfvar11, par5, halfvar13, 0.0F, 8.0F);
    PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F);
    PositionTextureVertex var21 = new PositionTextureVertex(par4, var12, var13, 8.0F, 0.0F);

    this.quadList[0] = new TexturedQuad(new PositionTextureVertex[]{var19, var15, var16, var20},
            par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par9, par3 + par9 + par8,
            par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    this.quadList[1] = new TexturedQuad(new PositionTextureVertex[]{var32, var18, var21, var17}, par2,
            par3 + par9, par2 + par9, par3 + par9 + par8, par1ModelRenderer.textureWidth,
            par1ModelRenderer.textureHeight);
    this.quadList[2] = new TexturedQuad(new PositionTextureVertex[]{var19, var18, var32, var15}, par2 + par9,
            par3, par2 + par9 + par7, par3 + par9, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    this.quadList[3] = new TexturedQuad(new PositionTextureVertex[]{var16, var17, var21, var20},
            par2 + par9 + par7, par3 + par9, par2 + par9 + par7 + par7, par3, par1ModelRenderer.textureWidth,
            par1ModelRenderer.textureHeight);
    this.quadList[4] = new TexturedQuad(new PositionTextureVertex[]{var15, var32, var17, var16}, par2 + par9,
            par3 + par9, par2 + par9 + par7, par3 + par9 + par8, par1ModelRenderer.textureWidth,
            par1ModelRenderer.textureHeight);
    this.quadList[5] = new TexturedQuad(new PositionTextureVertex[]{var18, var19, var20, var21},
            par2 + par9 + par7 + par9, par3 + par9, par2 + par9 + par7 + par9 + par7, par3 + par9 + par8,
            par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    if (par1ModelRenderer.mirror) {
        TexturedQuad[] var22 = this.quadList;

        for (TexturedQuad var25 : var22) {
            var25.flipFace();
        }
    }

}
项目:ShearMadness    文件:EntityMesh.java   
@SuppressWarnings("ObjectAllocationInLoop")
@Override
@SideOnly(Side.CLIENT)
public void render(VertexBuffer renderer, float scale)
{
    if (quadList == null)
    {
        final List<TexturedQuad> outputQuads = Lists.newArrayList();

        for (final FutureQuad<TexturedQuad> texturedQuads : allTexturedQuads) {
            for (final TexturedQuad texturedQuad : texturedQuads.quads) {
                final PositionTextureVertex[] newPositions = new PositionTextureVertex[4];
                for (int i = 0; i < texturedQuad.vertexPositions.length; i++)
                {
                    final PositionTextureVertex vertexPosition = texturedQuad.vertexPositions[i];
                    @SuppressWarnings("NumericCastThatLosesPrecision")
                    final Vector4f position = new Vector4f((float) vertexPosition.vector3D.xCoord,
                            (float) vertexPosition.vector3D.yCoord,
                            (float) vertexPosition.vector3D.zCoord, 1);

                    final Vector3f textureCoords = new Vector3f(
                            vertexPosition.texturePositionX,
                            vertexPosition.texturePositionY,
                            1);

                    final Vector4f transformedPosition = Matrix4f.transform(texturedQuads.positionTransform, position, null);
                    final Vector3f transformedTexture = Matrix3f.transform(texturedQuads.textureTransform, textureCoords, null);

                    newPositions[i] = new PositionTextureVertex(
                            transformedPosition.getX(),
                            transformedPosition.getY(),
                            transformedPosition.getZ(),
                            transformedTexture.getX(),
                            transformedTexture.getY()
                    );
                }

                outputQuads.add(new TexturedQuad(newPositions));
            }

        }

        for (final FutureQuad<BakedQuad> bakedQuads : allBakedQuads)
        {
            for (final BakedQuad bakedQuad : bakedQuads.quads) {
                try {
                    final VertexConsumer consumer = new VertexConsumer(bakedQuad.getFormat(), bakedQuads.positionTransform, bakedQuads.textureTransform);
                    bakedQuad.pipe(consumer);
                    outputQuads.add(consumer.getOutputQuad());
                } catch (Exception e) {
                    if (!errored) {
                        LogManager.getLogger("ShearMadnessAPI").log(Level.ERROR, "Error creating chiseled model", e);
                    }
                    errored = true;
                }
            }
        }

        quadList = new TexturedQuad[outputQuads.size()];
        quadList = outputQuads.toArray(quadList);
    }

    for (final TexturedQuad texturedquad : quadList)
    {
        texturedquad.draw(renderer, scale);
    }
}
项目:ShearMadness    文件:VertexConsumer.java   
@Override
public void put(int element, float... data)
{
    if (element == 0)
    {
        ++currentVertexIndex;
    }

    final VertexFormatElement element1 = vertexFormat.getElement(element);
    switch (element1.getUsage())
    {
        case POSITION:
            if (data.length < 3)
            {
                currentPosition = null;
                return;
            }
            final Vector4f position = new Vector4f(data[0], data[1], data[2], 1);
            final Vector4f transform = Matrix4f.transform(positionTransform, position, null);
            currentPosition = new Vec3d(transform.x, transform.y, transform.z);

            break;
        case UV:
            if (data.length < 2)
            {
                currentTexture = null;
                return;
            }

            final Vector3f uvs = new Vector3f(data[0], data[1], 1);
            final Vector3f transformedTexture = Matrix3f.transform(textureTransform, uvs, null);
            currentTexture = new Vector3f(transformedTexture.x, transformedTexture.y, transformedTexture.z);
            break;
        default:
            break;
    }

    if (element == vertexFormat.getElementCount() - 1)
    {
        if (currentPosition == null || currentTexture == null) {
            String vertexInfo = "";
            for (final VertexFormatElement vertexFormatElement : vertexFormat.getElements()) {
                vertexInfo += String.format("Element %d - %s\n", vertexFormatElement.getIndex(), vertexFormatElement.getUsage());
            }

            throw new RuntimeException("Unexpected Vertex Format:\n" + vertexInfo);
        }

        vertices[currentVertexIndex] = new PositionTextureVertex(currentPosition, currentTexture.x, currentTexture.y);
        currentPosition = null;
        currentTexture = null;
    }
}
项目:CraftStudioAPI    文件:CSModelBox.java   
/**
 * Set the vertices of the box ! A
 * {@link #setTexture(ModelRenderer, int[][]) setTexture()} is necessary
 * after that.<br>
 *
 * Order of the vertices:<br>
 * vertices[0] = (0, 0, 0) (bloc's origin)<br>
 * vertices[1] = (x, 0, 0)<br>
 * vertices[2] = (x, y, 0)<br>
 * vertices[3] = (0, y, 0)<br>
 * vertices[4] = (0, 0, z)<br>
 * vertices[5] = (x, 0, z)<br>
 * vertices[6] = (x, y, z) (bloc's end)<br>
 * vertices[7] = (0, y, z)<br>
 *
 * @param positionTextureVertex
 *            The 8 vertices that will replace the old ones.
 */
public void setVertex(PositionTextureVertex positionTextureVertex[]) {
    if (positionTextureVertex.length == 8) {
        this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] { positionTextureVertex[5], positionTextureVertex[1],
                positionTextureVertex[2], positionTextureVertex[6] });
        this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] { positionTextureVertex[0], positionTextureVertex[4],
                positionTextureVertex[7], positionTextureVertex[3] });
        this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] { positionTextureVertex[5], positionTextureVertex[4],
                positionTextureVertex[0], positionTextureVertex[1] });
        this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] { positionTextureVertex[2], positionTextureVertex[3],
                positionTextureVertex[7], positionTextureVertex[6] });
        this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] { positionTextureVertex[1], positionTextureVertex[0],
                positionTextureVertex[3], positionTextureVertex[2] });
        this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] { positionTextureVertex[4], positionTextureVertex[5],
                positionTextureVertex[6], positionTextureVertex[7] });
    }
}
项目:CraftStudioAPI    文件:CSModelRenderer.java   
public ModelRenderer addBox(PositionTextureVertex positionTextureVertex[], int[][] textUVs) {
    this.cubeCSList.add(new CSModelBox(this, positionTextureVertex, textUVs));
    return this;
}
项目:CraftStudioAPI    文件:CSModelRenderer.java   
public ModelRenderer addBox(PositionTextureVertex positionTextureVertex[], int[][] textUVs, boolean mirror) {
    this.cubeCSList.add(new CSModelBox(this, positionTextureVertex, textUVs, mirror));
    return this;
}
项目:blockbuster    文件:ModelExporter.java   
/**
 * Get texture offset of the model based on its box
 */
private int[] getModelOffset(ModelBox box, ModelRenderer renderer, ModelBase model)
{
    TextureOffset offset = model.getTextureOffset(box.boxName);

    if (offset != null)
    {
        return new int[] {offset.textureOffsetX, offset.textureOffsetY};
    }

    int[] zero = new int[] {0, 0};

    Field field = this.getFieldByType(TexturedQuad[].class, ModelBox.class);
    TexturedQuad[] quads;

    field.setAccessible(true);

    try
    {
        quads = (TexturedQuad[]) field.get(box);
    }
    catch (Exception e)
    {
        e.printStackTrace();

        return zero;
    }

    /* Getting the minimum */
    float minX = 1.0F;
    float minY = 1.0F;

    for (TexturedQuad quad : quads)
    {
        for (PositionTextureVertex vertex : quad.vertexPositions)
        {
            minX = Math.min(vertex.texturePositionX, minX);
            minY = Math.min(vertex.texturePositionY, minY);
        }
    }

    minX *= renderer.textureWidth;
    minY *= renderer.textureHeight;

    return new int[] {(int) minX, (int) minY};
}
项目:PopularMMOS-EpicProportions-Mod    文件:MCAModelBox.java   
public MCAModelBox(ModelRenderer par1ModelRenderer, int textureX, int textureY, float posX, float posY, float posZ, int sizeX, int sizeY, int sizeZ, float scaleFactor) {
    super(par1ModelRenderer, textureX, textureY, posX, posY, posZ, sizeX, sizeY, sizeZ, scaleFactor);

    this.MCAquadList = new TexturedQuad[6];

    float endX = posX + (float)sizeX;
    float endY = posY + (float)sizeY;
    float endZ = posZ + (float)sizeZ;
    posX -= scaleFactor;
    posY -= scaleFactor;
    posZ -= scaleFactor;
    endX += scaleFactor;
    endY += scaleFactor;
    endZ += scaleFactor;

    if (par1ModelRenderer.mirror)
    {
        float tempValueForSwitch = endX;
        endX = posX;
        posX = tempValueForSwitch;
    }

    /** Create PTV with RANDOM UV values (0 and 8). They will be set correctly later. */
    PositionTextureVertex PTV_back_left_bottom = new PositionTextureVertex(posX, posY, posZ, 0.0F, 0.0F);
    PositionTextureVertex PTV_back_right_bottom = new PositionTextureVertex(endX, posY, posZ, 0.0F, 8.0F);
    PositionTextureVertex PTV_back_right_top = new PositionTextureVertex(endX, endY, posZ, 8.0F, 8.0F);
    PositionTextureVertex PTV_back_left_top = new PositionTextureVertex(posX, endY, posZ, 8.0F, 0.0F);
    PositionTextureVertex PTV_front_left_bottom = new PositionTextureVertex(posX, posY, endZ, 0.0F, 0.0F);
    PositionTextureVertex PTV_front_right_bottom = new PositionTextureVertex(endX, posY, endZ, 0.0F, 8.0F);
    PositionTextureVertex PTV_front_right_top = new PositionTextureVertex(endX, endY, endZ, 8.0F, 8.0F);
    PositionTextureVertex PTV_front_left_top = new PositionTextureVertex(posX, endY, endZ, 8.0F, 0.0F);
    //...
    /** Create the TexturedQuads. The constructor of each quad defines the order of the PTV (counterclockwise) and fixes their UV. */
    //Right quad (TODO fix texture)
    this.MCAquadList[0] = new TexturedQuad(new PositionTextureVertex[] {PTV_back_right_top, PTV_front_right_top, PTV_front_right_bottom, PTV_back_right_bottom}, textureX + sizeZ + sizeX, textureY + sizeZ, textureX + sizeZ + sizeX + sizeZ, textureY + sizeZ + sizeY, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    //Left quad (TODO fix texture)
    this.MCAquadList[1] = new TexturedQuad(new PositionTextureVertex[] {PTV_front_left_top, PTV_back_left_top, PTV_back_left_bottom, PTV_front_left_bottom}, textureX, textureY + sizeZ, textureX + sizeZ, textureY + sizeZ + sizeY, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    //Bottom quad
    this.MCAquadList[2] = new TexturedQuad(new PositionTextureVertex[] {PTV_front_right_bottom, PTV_front_left_bottom, PTV_back_left_bottom, PTV_back_right_bottom}, textureX + sizeZ + sizeX, textureY, textureX + sizeZ + sizeX + sizeX, textureY + sizeZ, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    //Top quad
    this.MCAquadList[3] = new TexturedQuad(new PositionTextureVertex[] {PTV_back_right_top, PTV_back_left_top, PTV_front_left_top, PTV_front_right_top}, textureX + sizeZ, textureY, textureX + sizeZ + sizeX, textureY + sizeZ, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    //Back quad 
    this.MCAquadList[4] = new TexturedQuad(new PositionTextureVertex[] {PTV_back_left_top, PTV_back_right_top, PTV_back_right_bottom, PTV_back_left_bottom}, textureX + sizeZ + sizeX + sizeZ, textureY + sizeZ, textureX + sizeZ + sizeX + sizeZ + sizeX, textureY + sizeZ + sizeY, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);
    //Front quad 
    this.MCAquadList[5] = new TexturedQuad(new PositionTextureVertex[] {PTV_front_right_top, PTV_front_left_top, PTV_front_left_bottom, PTV_front_right_bottom}, textureX + sizeZ, textureY + sizeZ, textureX + sizeZ + sizeX, textureY + sizeZ + sizeY, par1ModelRenderer.textureWidth, par1ModelRenderer.textureHeight);

    if (par1ModelRenderer.mirror)
    {
        for (int j1 = 0; j1 < this.MCAquadList.length; ++j1)
        {
            this.MCAquadList[j1].flipFace();
        }
    }

}
项目:MMDLib-old    文件:PositionTransformVertex.java   
public PositionTransformVertex(PositionTextureVertex vertex) {
    this(vertex, vertex.texturePositionX, vertex.texturePositionY);
}
项目:MMDLib-old    文件:TexturedPolygon.java   
public TexturedPolygon(PositionTextureVertex apositionTexturevertex[]) {
    super(apositionTexturevertex);
    this.invertNormal = false;
    this.normals = new float[0];
    this.iNormals = new ArrayList<>();
}
项目:TFC2    文件:ModelBoxTFC.java   
public ModelBoxTFC(ModelRenderer renderer, int textureX,int textureY, float xPos, float yPos,
        float zPos, float width, float height, float depth, float p_i46359_10_, boolean mirror) 
{
    super(renderer, textureX, textureY, xPos,yPos,zPos, (int)width, (int)height, (int)depth, p_i46359_10_, mirror);

    this.quadList = new TexturedQuad[6];
    float f = xPos + (float)width;
    float f1 = yPos + (float)height;
    float f2 = zPos + (float)depth;
    xPos = xPos - p_i46359_10_;
    yPos = yPos - p_i46359_10_;
    zPos = zPos - p_i46359_10_;
    f = f + p_i46359_10_;
    f1 = f1 + p_i46359_10_;
    f2 = f2 + p_i46359_10_;

    if (mirror)
    {
        float f3 = f;
        f = xPos;
        xPos = f3;
    }

    PositionTextureVertex positiontexturevertex7 = new PositionTextureVertex(xPos, yPos, zPos, 0.0F, 0.0F);
    PositionTextureVertex positiontexturevertex = new PositionTextureVertex(f, yPos, zPos, 0.0F, 8.0F);
    PositionTextureVertex positiontexturevertex1 = new PositionTextureVertex(f, f1, zPos, 8.0F, 8.0F);
    PositionTextureVertex positiontexturevertex2 = new PositionTextureVertex(xPos, f1, zPos, 8.0F, 0.0F);
    PositionTextureVertex positiontexturevertex3 = new PositionTextureVertex(xPos, yPos, f2, 0.0F, 0.0F);
    PositionTextureVertex positiontexturevertex4 = new PositionTextureVertex(f, yPos, f2, 0.0F, 8.0F);
    PositionTextureVertex positiontexturevertex5 = new PositionTextureVertex(f, f1, f2, 8.0F, 8.0F);
    PositionTextureVertex positiontexturevertex6 = new PositionTextureVertex(xPos, f1, f2, 8.0F, 0.0F);

    this.quadList[0] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex, positiontexturevertex1, positiontexturevertex5}, textureX + depth + width, textureY + depth, textureX + depth + width + depth, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//Left side
    if(height == 0 || depth == 0)
        quadList[0] = null;
    this.quadList[1] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex7, positiontexturevertex3, positiontexturevertex6, positiontexturevertex2}, textureX, textureY + depth, textureX + depth, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//Right Side
    if(height == 0 || depth == 0)
        quadList[1] = null;
    this.quadList[2] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex3, positiontexturevertex7, positiontexturevertex}, textureX + depth, textureY, textureX + depth + width, textureY + depth, renderer.textureWidth, renderer.textureHeight);//Top
    if(width == 0 || depth == 0)
        quadList[2] = null;
    this.quadList[3] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex1, positiontexturevertex2, positiontexturevertex6, positiontexturevertex5}, textureX + depth + width, textureY + depth, textureX + depth + width + width, textureY, renderer.textureWidth, renderer.textureHeight);//bottom
    if(width == 0 || depth == 0)
        quadList[3] = null;
    this.quadList[4] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex, positiontexturevertex7, positiontexturevertex2, positiontexturevertex1}, textureX + depth, textureY + depth, textureX + depth + width, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//front
    if(height == 0 || width == 0)
        quadList[4] = null;
    this.quadList[5] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex3, positiontexturevertex4, positiontexturevertex5, positiontexturevertex6}, textureX + depth + width + depth, textureY + depth, textureX + depth + width + depth + width, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//back
    if(height == 0 || width == 0)
        quadList[5] = null;
    if (mirror)
    {
        for (int i = 0; i < this.quadList.length; ++i)
        {
            this.quadList[i].flipFace();
        }
    }
}
项目:TFC2    文件:ModelBoxTFC.java   
public ModelBoxTFC(ModelRenderer renderer, int textureX,int textureY, float xPos, float yPos,
        float zPos, float width, float height, float depth, float p_i46359_10_, boolean mirror) 
{
    super(renderer, textureX, textureY, xPos,yPos,zPos, (int)width, (int)height, (int)depth, p_i46359_10_, mirror);

    this.quadList = new TexturedQuad[6];
    float f = xPos + (float)width;
    float f1 = yPos + (float)height;
    float f2 = zPos + (float)depth;
    xPos = xPos - p_i46359_10_;
    yPos = yPos - p_i46359_10_;
    zPos = zPos - p_i46359_10_;
    f = f + p_i46359_10_;
    f1 = f1 + p_i46359_10_;
    f2 = f2 + p_i46359_10_;

    if (mirror)
    {
        float f3 = f;
        f = xPos;
        xPos = f3;
    }

    PositionTextureVertex positiontexturevertex7 = new PositionTextureVertex(xPos, yPos, zPos, 0.0F, 0.0F);
    PositionTextureVertex positiontexturevertex = new PositionTextureVertex(f, yPos, zPos, 0.0F, 8.0F);
    PositionTextureVertex positiontexturevertex1 = new PositionTextureVertex(f, f1, zPos, 8.0F, 8.0F);
    PositionTextureVertex positiontexturevertex2 = new PositionTextureVertex(xPos, f1, zPos, 8.0F, 0.0F);
    PositionTextureVertex positiontexturevertex3 = new PositionTextureVertex(xPos, yPos, f2, 0.0F, 0.0F);
    PositionTextureVertex positiontexturevertex4 = new PositionTextureVertex(f, yPos, f2, 0.0F, 8.0F);
    PositionTextureVertex positiontexturevertex5 = new PositionTextureVertex(f, f1, f2, 8.0F, 8.0F);
    PositionTextureVertex positiontexturevertex6 = new PositionTextureVertex(xPos, f1, f2, 8.0F, 0.0F);

    this.quadList[0] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex, positiontexturevertex1, positiontexturevertex5}, textureX + depth + width, textureY + depth, textureX + depth + width + depth, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//Left side
    if(height == 0 || depth == 0)
        quadList[0] = null;
    this.quadList[1] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex7, positiontexturevertex3, positiontexturevertex6, positiontexturevertex2}, textureX, textureY + depth, textureX + depth, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//Right Side
    if(height == 0 || depth == 0)
        quadList[1] = null;
    this.quadList[2] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex4, positiontexturevertex3, positiontexturevertex7, positiontexturevertex}, textureX + depth, textureY, textureX + depth + width, textureY + depth, renderer.textureWidth, renderer.textureHeight);//Top
    if(width == 0 || depth == 0)
        quadList[2] = null;
    this.quadList[3] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex1, positiontexturevertex2, positiontexturevertex6, positiontexturevertex5}, textureX + depth + width, textureY + depth, textureX + depth + width + width, textureY, renderer.textureWidth, renderer.textureHeight);//bottom
    if(width == 0 || depth == 0)
        quadList[3] = null;
    this.quadList[4] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex, positiontexturevertex7, positiontexturevertex2, positiontexturevertex1}, textureX + depth, textureY + depth, textureX + depth + width, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//front
    if(height == 0 || width == 0)
        quadList[4] = null;
    this.quadList[5] = new TexturedQuadTFC(new PositionTextureVertex[] {positiontexturevertex3, positiontexturevertex4, positiontexturevertex5, positiontexturevertex6}, textureX + depth + width + depth, textureY + depth, textureX + depth + width + depth + width, textureY + depth + height, renderer.textureWidth, renderer.textureHeight);//back
    if(height == 0 || width == 0)
        quadList[5] = null;
    if (mirror)
    {
        for (int i = 0; i < this.quadList.length; ++i)
        {
            this.quadList[i].flipFace();
        }
    }
}
项目:vintagecraft    文件:ModelIngot.java   
public ModelIngot(ModelRenderer renderer, int textureOffsetX, int textureOffsetY) {
    //                                               x1  y1  z1   wdt hgt detph scalechange 
    super(renderer, textureOffsetX, textureOffsetY, 0.5F, 0, 0.5F, 15, 4, 7, 0);

    float originX = .5f;
    float originY = 0;
    float originZ = .5f;

       this.vertexPositions = new PositionTextureVertex[8];
       this.quadList = new TexturedQuad[6];
       float maxX = originX + 15;
       float maxY = originY + 4;
       float maxZ = originZ + 7;

       PositionTextureVertex vert0 = new PositionTextureVertex(originX, originY, originZ, 0.0F, 0.0F);
       PositionTextureVertex vert1 = new PositionTextureVertex(maxX, originY, originZ, 0.0F, 8.0F);
       PositionTextureVertex vert2 = new PositionTextureVertex(maxX-1, maxY, originZ+1, 8.0F, 8.0F);
       PositionTextureVertex vert3 = new PositionTextureVertex(originX+1, maxY, originZ+1, 8.0F, 0.0F);
       PositionTextureVertex vert4 = new PositionTextureVertex(originX, originY, maxZ, 0.0F, 0.0F);
       PositionTextureVertex vert5 = new PositionTextureVertex(maxX, originY, maxZ, 0.0F, 8.0F);
       PositionTextureVertex vert6 = new PositionTextureVertex(maxX-1, maxY, maxZ-1, 8.0F, 8.0F);
       PositionTextureVertex vert7 = new PositionTextureVertex(originX+1, maxY, maxZ-1, 8.0F, 0.0F);
       this.vertexPositions[0] = vert0;
       this.vertexPositions[1] = vert1;
       this.vertexPositions[2] = vert2;
       this.vertexPositions[3] = vert3;
       this.vertexPositions[4] = vert4;
       this.vertexPositions[5] = vert5;
       this.vertexPositions[6] = vert6;
       this.vertexPositions[7] = vert7;

       int x1 = textureOffsetX + 4;
       int x2 = textureOffsetX + 20;
       int x3 = textureOffsetX + 44;
       int x4 = textureOffsetX + 60;

       int y1 = textureOffsetY + 4;
       int y2 = textureOffsetY + 8;
       int y3 = textureOffsetY + 16;
       int y4 = textureOffsetY + 20;
       int y5 = textureOffsetY + 28 + 10;

       this.quadList[0] = new TexturedQuad(new PositionTextureVertex[] {vert5, vert1, vert2, vert6}, 
            x3, y1, x4, y2, renderer.textureWidth, renderer.textureHeight); // petit

       this.quadList[1] = new TexturedQuad(new PositionTextureVertex[] {vert0, vert4, vert7, vert3}, 
            x1, y1, x2, y2, renderer.textureWidth, renderer.textureHeight); // petit

       this.quadList[2] = new TexturedQuad(new PositionTextureVertex[] {vert5, vert4, vert0, vert1}, 
            x2, y4, x3, y5, renderer.textureWidth, renderer.textureHeight); // bottom

       this.quadList[3] = new TexturedQuad(new PositionTextureVertex[] {vert2, vert3, vert7, vert6}, 
            x2, y2, x3, y3, renderer.textureWidth, renderer.textureHeight); // top

       this.quadList[4] = new TexturedQuad(new PositionTextureVertex[] {vert1, vert0, vert3, vert2}, 
            x2, y1, x3, y2, renderer.textureWidth, renderer.textureHeight); // long

       this.quadList[5] = new TexturedQuad(new PositionTextureVertex[] {vert4, vert5, vert6, vert7}, 
            x3, y4, x2, y3, renderer.textureWidth, renderer.textureHeight); // long
}
项目:RuneCraftery    文件:TexturedQuad.java   
public TexturedQuad(PositionTextureVertex[] p_i1152_1_) {
   this.field_78239_a = p_i1152_1_;
   this.field_78237_b = p_i1152_1_.length;
}
项目:RuneCraftery    文件:ModelBox.java   
public ModelBox(ModelRenderer p_i1171_1_, int p_i1171_2_, int p_i1171_3_, float p_i1171_4_, float p_i1171_5_, float p_i1171_6_, int p_i1171_7_, int p_i1171_8_, int p_i1171_9_, float p_i1171_10_) {
   this.field_78252_a = p_i1171_4_;
   this.field_78250_b = p_i1171_5_;
   this.field_78251_c = p_i1171_6_;
   this.field_78248_d = p_i1171_4_ + (float)p_i1171_7_;
   this.field_78249_e = p_i1171_5_ + (float)p_i1171_8_;
   this.field_78246_f = p_i1171_6_ + (float)p_i1171_9_;
   this.field_78253_h = new PositionTextureVertex[8];
   this.field_78254_i = new TexturedQuad[6];
   float var11 = p_i1171_4_ + (float)p_i1171_7_;
   float var12 = p_i1171_5_ + (float)p_i1171_8_;
   float var13 = p_i1171_6_ + (float)p_i1171_9_;
   p_i1171_4_ -= p_i1171_10_;
   p_i1171_5_ -= p_i1171_10_;
   p_i1171_6_ -= p_i1171_10_;
   var11 += p_i1171_10_;
   var12 += p_i1171_10_;
   var13 += p_i1171_10_;
   if(p_i1171_1_.field_78809_i) {
      float var14 = var11;
      var11 = p_i1171_4_;
      p_i1171_4_ = var14;
   }

   PositionTextureVertex var23 = new PositionTextureVertex(p_i1171_4_, p_i1171_5_, p_i1171_6_, 0.0F, 0.0F);
   PositionTextureVertex var15 = new PositionTextureVertex(var11, p_i1171_5_, p_i1171_6_, 0.0F, 8.0F);
   PositionTextureVertex var16 = new PositionTextureVertex(var11, var12, p_i1171_6_, 8.0F, 8.0F);
   PositionTextureVertex var17 = new PositionTextureVertex(p_i1171_4_, var12, p_i1171_6_, 8.0F, 0.0F);
   PositionTextureVertex var18 = new PositionTextureVertex(p_i1171_4_, p_i1171_5_, var13, 0.0F, 0.0F);
   PositionTextureVertex var19 = new PositionTextureVertex(var11, p_i1171_5_, var13, 0.0F, 8.0F);
   PositionTextureVertex var20 = new PositionTextureVertex(var11, var12, var13, 8.0F, 8.0F);
   PositionTextureVertex var21 = new PositionTextureVertex(p_i1171_4_, var12, var13, 8.0F, 0.0F);
   this.field_78253_h[0] = var23;
   this.field_78253_h[1] = var15;
   this.field_78253_h[2] = var16;
   this.field_78253_h[3] = var17;
   this.field_78253_h[4] = var18;
   this.field_78253_h[5] = var19;
   this.field_78253_h[6] = var20;
   this.field_78253_h[7] = var21;
   this.field_78254_i[0] = new TexturedQuad(new PositionTextureVertex[]{var19, var15, var16, var20}, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.field_78801_a, p_i1171_1_.field_78799_b);
   this.field_78254_i[1] = new TexturedQuad(new PositionTextureVertex[]{var23, var18, var21, var17}, p_i1171_2_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.field_78801_a, p_i1171_1_.field_78799_b);
   this.field_78254_i[2] = new TexturedQuad(new PositionTextureVertex[]{var19, var18, var23, var15}, p_i1171_2_ + p_i1171_9_, p_i1171_3_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_, p_i1171_1_.field_78801_a, p_i1171_1_.field_78799_b);
   this.field_78254_i[3] = new TexturedQuad(new PositionTextureVertex[]{var16, var17, var21, var20}, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_7_, p_i1171_3_, p_i1171_1_.field_78801_a, p_i1171_1_.field_78799_b);
   this.field_78254_i[4] = new TexturedQuad(new PositionTextureVertex[]{var15, var23, var17, var16}, p_i1171_2_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.field_78801_a, p_i1171_1_.field_78799_b);
   this.field_78254_i[5] = new TexturedQuad(new PositionTextureVertex[]{var18, var19, var20, var21}, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_9_, p_i1171_3_ + p_i1171_9_, p_i1171_2_ + p_i1171_9_ + p_i1171_7_ + p_i1171_9_ + p_i1171_7_, p_i1171_3_ + p_i1171_9_ + p_i1171_8_, p_i1171_1_.field_78801_a, p_i1171_1_.field_78799_b);
   if(p_i1171_1_.field_78809_i) {
      for(int var22 = 0; var22 < this.field_78254_i.length; ++var22) {
         this.field_78254_i[var22].func_78235_a();
      }
   }

}
项目:Agriculture2    文件:TexturedQuadIcon.java   
public TexturedQuadIcon(final PositionTextureVertex[] par1ArrayOfPositionTextureVertex, final int par2, final int par3, final int par4, final int par5, final float par6, final float par7)
{
    super(par1ArrayOfPositionTextureVertex, par2, par3, par4, par5, par6, par7);
}
项目:Agriculture2    文件:ModelSimpleBox.java   
public ModelSimpleBox(final int textureWidth, final int textureHeight, final int textureX, final int textureZ, float posX, float posY, float posZ, final int width, final int height, final int width2, final int par10, final IIcon liquidIcon)
{
    icon = liquidIcon;
    posX1 = posX;
    posY1 = posY;
    posZ1 = posZ;
    posX2 = posX + width;
    posY2 = posY + height;
    posZ2 = posZ + width2;
    vertexPositions = new PositionTextureVertex[8];
    quadList = new TexturedQuadIcon[6];
    float f4 = posX + width;
    float f5 = posY + height;
    float f6 = posZ + width2;
    posX -= par10;
    posY -= par10;
    posZ -= par10;
    f4 += par10;
    f5 += par10;
    f6 += par10;

    final PositionTextureVertex positiontexturevertex = new PositionTextureVertex(posX, posY, posZ, 0.0F, 0.0F);
    final PositionTextureVertex positiontexturevertex1 = new PositionTextureVertex(f4, posY, posZ, 0.0F, 8.0F);
    final PositionTextureVertex positiontexturevertex2 = new PositionTextureVertex(f4, f5, posZ, 8.0F, 8.0F);
    final PositionTextureVertex positiontexturevertex3 = new PositionTextureVertex(posX, f5, posZ, 8.0F, 0.0F);
    final PositionTextureVertex positiontexturevertex4 = new PositionTextureVertex(posX, posY, f6, 0.0F, 0.0F);
    final PositionTextureVertex positiontexturevertex5 = new PositionTextureVertex(f4, posY, f6, 0.0F, 8.0F);
    final PositionTextureVertex positiontexturevertex6 = new PositionTextureVertex(f4, f5, f6, 8.0F, 8.0F);
    final PositionTextureVertex positiontexturevertex7 = new PositionTextureVertex(posX, f5, f6, 8.0F, 0.0F);
    vertexPositions[0] = positiontexturevertex;
    vertexPositions[1] = positiontexturevertex1;
    vertexPositions[2] = positiontexturevertex2;
    vertexPositions[3] = positiontexturevertex3;
    vertexPositions[4] = positiontexturevertex4;
    vertexPositions[5] = positiontexturevertex5;
    vertexPositions[6] = positiontexturevertex6;
    vertexPositions[7] = positiontexturevertex7;
    quadList[0] = new TexturedQuadIcon(new PositionTextureVertex[] { positiontexturevertex5, positiontexturevertex1, positiontexturevertex2, positiontexturevertex6 }, textureX + width2 + width, textureZ + width2, textureX + width2 + width + width2, textureZ + width2 + height, textureWidth, textureHeight);
    quadList[1] = new TexturedQuadIcon(new PositionTextureVertex[] { positiontexturevertex, positiontexturevertex4, positiontexturevertex7, positiontexturevertex3 }, textureX, textureZ + width2, textureX + width2, textureZ + width2 + height, textureWidth, textureHeight);
    quadList[2] = new TexturedQuadIcon(new PositionTextureVertex[] { positiontexturevertex5, positiontexturevertex4, positiontexturevertex, positiontexturevertex1 }, textureX + width2, textureZ, textureX + width2 + width, textureZ + width2, textureWidth, textureHeight);
    quadList[3] = new TexturedQuadIcon(new PositionTextureVertex[] { positiontexturevertex2, positiontexturevertex3, positiontexturevertex7, positiontexturevertex6 }, textureX + width2 + width, textureZ + width2, textureX + width2 + width + width, textureZ, textureWidth, textureHeight);
    quadList[4] = new TexturedQuadIcon(new PositionTextureVertex[] { positiontexturevertex1, positiontexturevertex, positiontexturevertex3, positiontexturevertex2 }, textureX + width2, textureZ + width2, textureX + width2 + width, textureZ + width2 + height, textureWidth, textureHeight);
    quadList[5] = new TexturedQuadIcon(new PositionTextureVertex[] { positiontexturevertex4, positiontexturevertex5, positiontexturevertex6, positiontexturevertex7 }, textureX + width2 + width + width2, textureZ + width2, textureX + width2 + width + width2 + width, textureZ + width2 + height, textureWidth, textureHeight);
}
项目:Agriculture    文件:TexturedQuadIcon.java   
public TexturedQuadIcon(final PositionTextureVertex[] par1ArrayOfPositionTextureVertex, final int par2, final int par3, final int par4, final int par5, final float par6, final float par7)
{
    super(par1ArrayOfPositionTextureVertex, par2, par3, par4, par5, par6, par7);
}