本文整理汇总了Java中codechicken.lib.lighting.LightMatrix类的典型用法代码示例。如果您正苦于以下问题:Java LightMatrix类的具体用法?Java LightMatrix怎么用?Java LightMatrix使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
LightMatrix类属于codechicken.lib.lighting包,在下文中一共展示了LightMatrix类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: renderMicroFace
import codechicken.lib.lighting.LightMatrix; //导入依赖的package包/类
@Override
public void renderMicroFace(Vertex5[] verts, int side, Vector3 pos,
LightMatrix lightMatrix, IMicroMaterialRender part) {
icontr.bindPart(part);
RenderVariation var = ((Carvable) block()).getVariation(meta());
// test.submap=var.submap;
//test.submapSmall=var.submapSmall;
proxyWorld world = null;
if (part.world() != null)
world = new proxyWorld(part.world(), pos, icontr.getBlock(), icontr.getMetadata());
var.setup(verts, side % 6, pos, world, part.getRenderBounds());
var.renderSide(verts, side % 6, pos, lightMatrix, getColour(0), part.getRenderBounds());
}
开发者ID:delta534,项目名称:Chisel,代码行数:15,代码来源:ChiselMicroMaterial.java
示例2: renderMicroFace
import codechicken.lib.lighting.LightMatrix; //导入依赖的package包/类
public void renderMicroFace(Vertex5[] verts, int side, Vector3 pos,
LightMatrix lightMatrix, IMicroMaterialRender part) {
icontr.bindPart(part);
((BlockPillarUVTransform) icontr).bindSide(side);
((BlockPillarUVTransform) icontr).update();
UV uv = new UV();
Tessellator t = Tessellator.instance;
for (int i = 0; i < 4; i++) {
if (CCRenderState.useNormals()) {
Vector3 n = Rotation.axes[side % 6];
t.setNormal((float) n.x, (float) n.y, (float) n.z);
}
Vertex5 vert = verts[i];
if (lightMatrix != null) {
LC lc = LC.computeO(vert.vec, side);
if (CCRenderState.useModelColours())
lightMatrix.setColour(t, lc, getColour(part));
lightMatrix.setBrightness(t, lc);
} else {
if (CCRenderState.useModelColours())
CCRenderState.vertexColour(getColour(part));
}
icontr.transform(uv.set(vert.uv));
t.addVertexWithUV(vert.vec.x + pos.x, vert.vec.y + pos.y, vert.vec.z + pos.z, uv.u, uv.v);
}
}
开发者ID:delta534,项目名称:Chisel,代码行数:32,代码来源:ChiselPillarMicroMaterial.java
示例3: renderSide
import codechicken.lib.lighting.LightMatrix; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
public boolean renderSide(Vertex5[] verts, int side, Vector3 pos,
LightMatrix lightMatrix, int color, Cuboid6 bounds) {
UV uv = new UV();
Tessellator t = Tessellator.instance;
int lim=4;
int start=0;
int change=1;
int p=BlockGlassCarvable.pass;
for (int i = start; i != lim; i+=change) {
int s=p==1?(side%2==0)?side%6+1:side%6-1:side%6;
if (CCRenderState.useNormals()) {
Vector3 n = Rotation.axes[side% 6];
t.setNormal((float) n.x, (float) n.y, (float) n.z);
}
Vertex5 vert = verts[i];
if (lightMatrix != null) {
LC lc = LC.compute(vert.vec, s);
if (CCRenderState.useModelColours())
lightMatrix.setColour(t, lc, color);
lightMatrix.setBrightness(t, lc);
} else {
if (CCRenderState.useModelColours())
CCRenderState.vertexColour(color);
}
apply(uv.set(vert.uv));
if(p==1)
t.addVertexWithUV(vert.vec.x + pos.x+microAdjust[side % 6].x,
vert.vec.y + pos.y+microAdjust[side % 6].y,
vert.vec.z + pos.z+microAdjust[side % 6].z, uv.u, uv.v);
else
t.addVertexWithUV(vert.vec.x + pos.x, vert.vec.y + pos.y, vert.vec.z + pos.z, uv.u, uv.v);
}
return true;
}
开发者ID:delta534,项目名称:Chisel,代码行数:39,代码来源:RenderVariation.java
示例4: renderSide
import codechicken.lib.lighting.LightMatrix; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
@Override
public boolean renderSide(Vertex5[] verts, int side, Vector3 pos,
LightMatrix lightMatrix, int color, Cuboid6 bounds) {
if (grass.isTop(side)) {
Tessellator.instance.setColorOpaque_I(color >> 8);
grass.renderSide(verts, side, pos, lightMatrix, color, bounds);
} else {
Tessellator.instance.setColorOpaque_I(0xFFFFFFFF >> 8);
dirt.renderSide(verts, side, pos, lightMatrix, 0xFFFFFFFF, bounds);
if (dirt.isSide(side)) {
//dummy.renderSide(verts, side, pos, lightMatrix, color);
Tessellator.instance.setColorOpaque_I(color >> 8);
IIcon temp = grass.getBoundIcon();
grass.setBoundIcon(BlockGrass.getIconSideOverlay());
if (bounds != null) {
for (int i = 0; i < 4; i++) {
verts[i].uv.v -= 1 - bounds.max.y;
}
}
grass.renderSide(verts, side, pos, lightMatrix, color, bounds);
grass.setBoundIcon(temp);
}
}
return true;
}
开发者ID:delta534,项目名称:Chisel,代码行数:29,代码来源:GrassVariation.java
注:本文中的codechicken.lib.lighting.LightMatrix类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论