Package cofh.repack.codechicken.lib.vec

Examples of cofh.repack.codechicken.lib.vec.Scale


    public static QBQuad restore(Rectangle4i flat, int side, double d, QBImage img) {

      QBQuad quad = new QBQuad(side);
      quad.image = img;

      Transformation t = new Scale(-1, 1, -1).with(Rotation.sideOrientation(side, 0)).with(new Translation(new Vector3().setSide(side, d)));
      quad.verts[0] = new Vertex5(flat.x, 0, flat.y, 0, 0);
      quad.verts[1] = new Vertex5(flat.x + flat.w, 0, flat.y, 1, 0);
      quad.verts[2] = new Vertex5(flat.x + flat.w, 0, flat.y + flat.h, 1, 1);
      quad.verts[3] = new Vertex5(flat.x, 0, flat.y + flat.h, 0, 1);
      for (Vertex5 vert : quad.verts) {
View Full Code Here


      return quad;
    }

    public Rectangle4i flatten() {

      Transformation t = Rotation.sideOrientation(side, 0).inverse().with(new Scale(-1, 0, -1));
      Vector3 vmin = verts[0].vec.copy().apply(t);
      Vector3 vmax = verts[2].vec.copy().apply(t);
      return new Rectangle4i((int) vmin.x, (int) vmin.z, (int) (vmax.x - vmin.x), (int) (vmax.z - vmin.z));
    }
View Full Code Here

        m.verts[i++] = quad.verts[3];
      }
      m.apply(new UVScale(1D / img.getWidth(), 1D / img.getHeight()));
      m.apply(new Translation(pos.x, pos.y, pos.z));
      if (scaleMC) {
        m.apply(new Scale(1 / 16D));
      }
      m.computeNormals();
      return m;
    }
View Full Code Here

    i++;
  }

  public static Matrix4 getRenderMatrix(Vector3 position, Rotation rotation, double scale) {

    return new Matrix4().translate(position).apply(new Scale(scale)).apply(rotation);
  }
View Full Code Here

TOP

Related Classes of cofh.repack.codechicken.lib.vec.Scale

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.