当前位置: 首页>>代码示例>>Java>>正文


Java CCRenderState.model方法代码示例

本文整理汇总了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();
    }
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:29,代码来源:ConnectedTextureMicroMaterial.java

示例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();
}
 
开发者ID:sameer,项目名称:ExtraUtilities,代码行数:72,代码来源:ConnectedTextureMicroMaterial.java


注:本文中的codechicken.lib.render.CCRenderState.model方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。