本文整理汇总了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);
}
}
}
示例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);
}
}
}
}
示例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);
}
}
}
示例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));
}
示例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;
}
示例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;
}
示例7: apply
import com.enderio.core.api.client.render.VertexTransform; //导入方法依赖的package包/类
@Override
public void apply(Vertex vertex) {
for (VertexTransform xform : xforms) {
xform.apply(vertex);
}
}
示例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));
}
}
}
}