當前位置: 首頁>>代碼示例>>Java>>正文


Java VertexTransform.apply方法代碼示例

本文整理匯總了Java中com.enderio.core.api.client.render.VertexTransform.apply方法的典型用法代碼示例。如果您正苦於以下問題:Java VertexTransform.apply方法的具體用法?Java VertexTransform.apply怎麽用?Java VertexTransform.apply使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在com.enderio.core.api.client.render.VertexTransform的用法示例。


在下文中一共展示了VertexTransform.apply方法的8個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: setupVertices

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
public static void setupVertices(BoundingBox bound, VertexTransform xForm) {
  verts[0].set(bound.minX, bound.minY, bound.minZ);
  verts[1].set(bound.maxX, bound.minY, bound.minZ);
  verts[2].set(bound.maxX, bound.maxY, bound.minZ);
  verts[3].set(bound.minX, bound.maxY, bound.minZ);
  verts[4].set(bound.minX, bound.minY, bound.maxZ);
  verts[5].set(bound.maxX, bound.minY, bound.maxZ);
  verts[6].set(bound.maxX, bound.maxY, bound.maxZ);
  verts[7].set(bound.minX, bound.maxY, bound.maxZ);

  if (xForm != null) {
    for (Vector3d vec : verts) {
      xForm.apply(vec);
    }
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:17,代碼來源:CubeRenderer.java

示例2: setupVertices

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
void setupVertices(BoundingBox bound, VertexTransform xForm) {
  verts[0].set(bound.minX, bound.minY, bound.minZ);
  verts[1].set(bound.maxX, bound.minY, bound.minZ);
  verts[2].set(bound.maxX, bound.maxY, bound.minZ);
  verts[3].set(bound.minX, bound.maxY, bound.minZ);
  verts[4].set(bound.minX, bound.minY, bound.maxZ);
  verts[5].set(bound.maxX, bound.minY, bound.maxZ);
  verts[6].set(bound.maxX, bound.maxY, bound.maxZ);
  verts[7].set(bound.minX, bound.maxY, bound.maxZ);

  if (xForm != null) {
    for (Vector3d vec : verts) {
      if (vec != null) {
        xForm.apply(vec);
      }
    }
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:19,代碼來源:TESRPowerMonitor.java

示例3: setupVertices

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
protected void setupVertices(BoundingBox bound, VertexTransform xForm) {
  verts[0].set(bound.minX, bound.minY, bound.minZ);
  verts[1].set(bound.maxX, bound.minY, bound.minZ);
  verts[2].set(bound.maxX, bound.maxY, bound.minZ);
  verts[3].set(bound.minX, bound.maxY, bound.minZ);
  verts[4].set(bound.minX, bound.minY, bound.maxZ);
  verts[5].set(bound.maxX, bound.minY, bound.maxZ);
  verts[6].set(bound.maxX, bound.maxY, bound.maxZ);
  verts[7].set(bound.minX, bound.maxY, bound.maxZ);

  if (xForm != null) {
    for (Vector3d vec : verts) {
      xForm.apply(vec);
    }
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:17,代碼來源:DefaultConduitRenderer.java

示例4: transform

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
public BoundingBox transform(VertexTransform iTransformation) {
  Vector3d min = new Vector3d(minX, minY, minZ);
  Vector3d max = new Vector3d(maxX, maxY, maxZ);

  iTransformation.apply(min);
  iTransformation.apply(max);

  return new BoundingBox(Math.min(min.x, max.x), Math.min(min.y, max.y), Math.min(min.z, max.z), Math.max(min.x, max.x), Math.max(min.y, max.y), Math.max(
      min.z, max.z));

}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:12,代碼來源:BoundingBox.java

示例5: setXform

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
public CacheRenderer setXform(VertexTransform xForm) {
  calculateVerts();
  this.xForm = xForm;
  for (Vector3d vec : verts) {
    xForm.apply(vec);
  }
  return this;
}
 
開發者ID:HenryLoenwind,項目名稱:EnderIOAddons,代碼行數:9,代碼來源:CacheRenderer.java

示例6: createVerticesForDir

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
private static List<Vertex> createVerticesForDir(BoundingBox refBB, VertexTransform xform) {
  List<Vertex> result = new ArrayList<Vertex>(24);
  for (EnumFacing face : EnumFacing.VALUES) {
    result.addAll(refBB.getCornersWithUvForFace(face));
  }
  for (Vertex v : result) {
    xform.apply(v.xyz);
    xform.applyToNormal(v.normal);

  }
  return result;
}
 
開發者ID:SleepyTrousers,項目名稱:EnderIO,代碼行數:13,代碼來源:ConnectionModeGeometry.java

示例7: apply

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
@Override
public void apply(Vertex vertex) {
  for (VertexTransform xform : xforms) {
    xform.apply(vertex);
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:7,代碼來源:VertexTransformComposite.java

示例8: renderWithIcon

import com.enderio.core.api.client.render.VertexTransform; //導入方法依賴的package包/類
public static void renderWithIcon(GroupObject go, IIcon icon, IIcon override, Tessellator tes, IBlockAccess world, int x, int y, int z, VertexTransform vt,
    boolean isbrh) {
  for (Face f : go.faces) {
    Vertex n = f.faceNormal;
    tes.setNormal(n.x, n.y, n.z);
    ForgeDirection normal = getNormalFor(n);
    ForgeDirection right = normal.getRotation(ForgeDirection.DOWN);
    if (normal == right) {
      right = ForgeDirection.EAST;
    }
    ForgeDirection down = normal.getRotation(right.getOpposite());

    if (isbrh && world != null && world.getBlock(x, y, z).getLightOpacity() > 0) {
      int bx = x + normal.offsetX;
      int by = y + normal.offsetY;
      int bz = z + normal.offsetZ;
      tes.setBrightness(world.getBlock(bx, by, bz).getMixedBrightnessForBlock(world, bx, by, bz));
    }

    for (int i = 0; i < f.vertices.length; i++) {
      Vertex vert = f.vertices[i];
      Vector3d v = new Vector3d(vert);
      Vector3d tv = new Vector3d(v);
      tv.add(0.5, 0, 0.5);
      if (vt != null) {
        vt.apply(v);
        // TODO BLECH
        if (vt instanceof VertexRotationFacing) {
          normal = ((VertexRotationFacing) vt).rotate(normal);
        }
        if (vt instanceof VertexTransformComposite) {
          for (VertexTransform xform : ((VertexTransformComposite) vt).xforms) {
            if (xform instanceof VertexRotationFacing) {
              normal = ((VertexRotationFacing) xform).rotate(normal);
            }
          }
        }
      }

      if (isbrh) {
        int c = (int) (0xFF * RenderUtil.getColorMultiplierForFace(normal));
        tes.setColorOpaque(c, c, c);
      }

      if (override != null) {

        double interpX = Math.abs(tv.x * right.offsetX + tv.y * right.offsetY + tv.z * right.offsetZ);
        double interpY = Math.abs(tv.x * down.offsetX + tv.y * down.offsetY + tv.z * down.offsetZ);

        // Handles verts outside block bounds. Modulo fails at 1.0.
        while (interpX > 1) {
          interpX--;
        }
        while (interpY > 1) {
          interpY--;
        }

        if (normal == ForgeDirection.SOUTH || normal == ForgeDirection.WEST) {
          interpX = 1 - interpX;
        }
        if (normal != ForgeDirection.UP && normal != ForgeDirection.DOWN) {
          interpY = 1 - interpY;
        }
        tes.addVertexWithUV(v.x, v.y, v.z, override.getInterpolatedU(interpX * 16), override.getInterpolatedV(interpY * 16));
      } else {
        TextureCoordinate t = f.textureCoordinates[i];
        tes.addVertexWithUV(v.x, v.y, v.z, getInterpolatedU(icon, t.u), getInterpolatedV(icon, t.v));
      }
    }
  }
}
 
開發者ID:SleepyTrousers,項目名稱:EnderCore,代碼行數:72,代碼來源:TechneUtil.java


注:本文中的com.enderio.core.api.client.render.VertexTransform.apply方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。