Package cofh.repack.codechicken.lib.vec

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


    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


          quads.add(plane.iterator().next());
          continue;
        }

        int side = key & 7;
        Rectangle4i rect = null;
        for (QBQuad q : plane) {
          if (rect == null) {
            rect = q.flatten();
          } else {
            rect.include(q.flatten());
          }
        }

        QBImage img = new QBImage();
        img.data = new int[rect.w][rect.h];
        for (QBQuad q : plane) {
          QBImage from = q.image;
          Rectangle4i r = q.flatten();
          int du = r.x - rect.x;
          int dv = r.y - rect.y;
          for (int u = 0; u < from.width(); u++) {
            for (int v = 0; v < from.height(); v++) {
              img.data[du + u][dv + v] = from.data[u][v];
View Full Code Here

    ImagePackNode child2;
    QBImage packed;

    public ImagePackNode(int x, int y, int w, int h) {

      rect = new Rectangle4i(x, y, w, h);
    }
View Full Code Here

TOP

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

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.