本文整理汇总了Java中codechicken.lib.render.CCRenderState.model方法的典型用法代码示例。如果您正苦于以下问题:Java CCRenderState.model方法的具体用法?Java CCRenderState.model怎么用?Java CCRenderState.model使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类codechicken.lib.render.CCRenderState
的用法示例。
在下文中一共展示了CCRenderState.model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: renderMicroFace
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void renderMicroFace(final Vector3 pos, final int pass, final Cuboid6 b) {
if (!CCRenderState.model.getClass().equals(BlockRenderer.BlockFace.class)) {
super.renderMicroFace(pos, pass, b);
return;
}
final Cuboid6 bounds = b.copy();
final Cuboid6 renderBounds = bounds.copy();
final TMultiPart part = this.getPart(pos, bounds);
if (pass >= 0) {
final boolean isHollow = part instanceof HollowMicroblockClient;
final int s = ((BlockRenderer.BlockFace)CCRenderState.model).side;
if (isHollow) {
for (final Cuboid6 b2 : ((JNormalOcclusion)part).getOcclusionBoxes()) {
bounds.enclose(b2);
}
}
if (this.isGlass) {
this.glassChange(bounds);
}
}
if (!this.hasConnected || !this.renderConnected(pos, pass, bounds, renderBounds)) {
super.renderMicroFace(pos, pass, bounds);
}
if (this.resetIcons != null) {
this.resetIcons.resetType();
}
}
示例2: glassChange
import codechicken.lib.render.CCRenderState; //导入方法依赖的package包/类
@SideOnly(Side.CLIENT)
public void glassChange(final Cuboid6 c) {
final BlockRenderer.BlockFace face = (BlockRenderer.BlockFace)CCRenderState.model;
final int side = face.side;
final double x1 = c.min.x;
final double x2 = c.max.x;
final double y1 = c.min.y;
final double y2 = c.max.y;
final double z1 = c.min.z;
final double z2 = c.max.z;
double u1 = 0.0;
double u2 = 0.0;
double v1 = 0.0;
double v2 = 0.0;
switch (side) {
case 0: {
u1 = x1;
u2 = x2;
v1 = z1;
v2 = z2;
break;
}
case 1: {
u1 = x1;
u2 = x2;
v1 = z1;
v2 = z2;
break;
}
case 2: {
u1 = 1.0 - x2;
u2 = 1.0 - x1;
v1 = 1.0 - y2;
v2 = 1.0 - y1;
break;
}
case 3: {
u1 = x1;
u2 = x2;
v1 = 1.0 - y2;
v2 = 1.0 - y1;
break;
}
case 4: {
u1 = z1;
v1 = 1.0 - y2;
u2 = z2;
v2 = 1.0 - y1;
break;
}
case 5: {
u1 = 1.0 - z2;
u2 = 1.0 - z1;
v1 = 1.0 - y2;
v2 = 1.0 - y1;
break;
}
default: {
return;
}
}
if (v1 == v2 || u1 == u2) {
return;
}
for (final Vertex5 v3 : face.verts) {
v3.uv.u = (v3.uv.u - u1) / (u2 - u1);
v3.uv.v = (v3.uv.v - v1) / (v2 - v1);
}
face.lcComputed = false;
face.computeLightCoords();
}