当前位置: 首页>>代码示例>>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;未经允许,请勿转载。