Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 3.91 KB | None | 0 0
  1. public void addBox(float f, float f1, float f2, int i, int j, int k, float f3, float l)
  2.     {
  3.     float f4 = f / l;
  4.         float f5 = f1 / l;
  5.         float f6 = f2 / l;
  6.     if(f3 == 0.0F){ f3 += 1.0F; }
  7.     float f7 = f3 * l;
  8.     float i2 = i / l;
  9.     float j2 = j / l;
  10.     float k2 = k / l;
  11.    
  12.     addBox2(f4, f5, f6, i2, j2, k2, f7);
  13.    
  14.     }
  15.    
  16.     public void addBox2(float f, float f1, float f2, float i, float j, float k, float f3)
  17.     {
  18.         corners = new PositionTexureVertex[8];
  19.         faces = new TexturedQuad[6];
  20.         float f4 = f + i;
  21.         float f5 = f1 + j;
  22.         float f6 = f2 + k;
  23.         f -= f3;
  24.         f1 -= f3;
  25.         f2 -= f3;
  26.         f4 += f3;
  27.         f5 += f3;
  28.         f6 += f3;
  29.         if(mirror)
  30.         {
  31.             float f7 = f4;
  32.             f4 = f;
  33.             f = f7;
  34.         }
  35.         PositionTexureVertex positiontexurevertex = new PositionTexureVertex(f, f1, f2, 0.0F, 0.0F);
  36.         PositionTexureVertex positiontexurevertex1 = new PositionTexureVertex(f4, f1, f2, 0.0F, 8F);
  37.         PositionTexureVertex positiontexurevertex2 = new PositionTexureVertex(f4, f5, f2, 8F, 8F);
  38.         PositionTexureVertex positiontexurevertex3 = new PositionTexureVertex(f, f5, f2, 8F, 0.0F);
  39.         PositionTexureVertex positiontexurevertex4 = new PositionTexureVertex(f, f1, f6, 0.0F, 0.0F);
  40.         PositionTexureVertex positiontexurevertex5 = new PositionTexureVertex(f4, f1, f6, 0.0F, 8F);
  41.         PositionTexureVertex positiontexurevertex6 = new PositionTexureVertex(f4, f5, f6, 8F, 8F);
  42.         PositionTexureVertex positiontexurevertex7 = new PositionTexureVertex(f, f5, f6, 8F, 0.0F);
  43.         corners[0] = positiontexurevertex;
  44.         corners[1] = positiontexurevertex1;
  45.         corners[2] = positiontexurevertex2;
  46.         corners[3] = positiontexurevertex3;
  47.         corners[4] = positiontexurevertex4;
  48.         corners[5] = positiontexurevertex5;
  49.         corners[6] = positiontexurevertex6;
  50.         corners[7] = positiontexurevertex7;
  51.         faces[0] = new TexturedQuad(new PositionTexureVertex[] {
  52.             positiontexurevertex5, positiontexurevertex1, positiontexurevertex2, positiontexurevertex6
  53.         }, textureOffsetX + (int)k + (int)i, textureOffsetY + (int)k, textureOffsetX + (int)k + (int)i + (int)k, textureOffsetY + (int)k + (int)j);
  54.         faces[1] = new TexturedQuad(new PositionTexureVertex[] {
  55.             positiontexurevertex, positiontexurevertex4, positiontexurevertex7, positiontexurevertex3
  56.         }, textureOffsetX + 0, textureOffsetY + (int)k, textureOffsetX + (int)k, textureOffsetY + (int)k + (int)j);
  57.         faces[2] = new TexturedQuad(new PositionTexureVertex[] {
  58.             positiontexurevertex5, positiontexurevertex4, positiontexurevertex, positiontexurevertex1
  59.         }, textureOffsetX + (int)k, textureOffsetY + 0, textureOffsetX + (int)k + (int)i, textureOffsetY + (int)k);
  60.         faces[3] = new TexturedQuad(new PositionTexureVertex[] {
  61.             positiontexurevertex2, positiontexurevertex3, positiontexurevertex7, positiontexurevertex6
  62.         }, textureOffsetX + (int)k + (int)i, textureOffsetY + 0, textureOffsetX + (int)k + (int)i + (int)i, textureOffsetY + (int)k);
  63.         faces[4] = new TexturedQuad(new PositionTexureVertex[] {
  64.             positiontexurevertex1, positiontexurevertex, positiontexurevertex3, positiontexurevertex2
  65.         }, textureOffsetX + (int)k, textureOffsetY + (int)k, textureOffsetX + (int)k + (int)i, textureOffsetY + (int)k + (int)j);
  66.         faces[5] = new TexturedQuad(new PositionTexureVertex[] {
  67.             positiontexurevertex4, positiontexurevertex5, positiontexurevertex6, positiontexurevertex7
  68.         }, textureOffsetX + (int)k + (int)i + (int)k, textureOffsetY + (int)k, textureOffsetX + (int)k + (int)i + (int)k + (int)i, textureOffsetY + (int)k + (int)j);
  69.         if(mirror)
  70.         {
  71.             for(int l = 0; l < faces.length; l++)
  72.             {
  73.                 faces[l].func_809_a();
  74.             }
  75.  
  76.         }
  77.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement