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


Java ModelBiped.render方法代码示例

本文整理汇总了Java中net.minecraft.client.model.ModelBiped.render方法的典型用法代码示例。如果您正苦于以下问题:Java ModelBiped.render方法的具体用法?Java ModelBiped.render怎么用?Java ModelBiped.render使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在net.minecraft.client.model.ModelBiped的用法示例。


在下文中一共展示了ModelBiped.render方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: renderModel

import net.minecraft.client.model.ModelBiped; //导入方法依赖的package包/类
@Override
public void renderModel(EntityLivingBase entity, float par2, float par3, float par4, float par5, float par6, float par7){
super.renderModel(entity, par2, par3, par4, par5, par6, par7);
//(Conditions for the overlay to be rendered){
ModelBiped modelBiped;
for (int i = 0; i < 4; ++i)
{
modelBiped = this.tutModel;

GL11.glColor4f(1, 1, 1, 1);
this.bindTexture(texture);

modelBiped.bipedHead.showModel = i == 0;
modelBiped.bipedHeadwear.showModel = i == 0;
modelBiped.bipedBody.showModel = i == 1 || i == 2;
modelBiped.bipedRightArm.showModel = i == 1;
modelBiped.bipedLeftArm.showModel = i == 1;
modelBiped.bipedRightLeg.showModel = i == 2 || i == 3;
modelBiped.bipedLeftLeg.showModel = i == 2 || i == 3;
modelBiped.onGround = this.mainModel.onGround;
modelBiped.isRiding = this.mainModel.isRiding;
modelBiped.isChild = this.mainModel.isChild;
if (this.mainModel instanceof ModelBiped)
{
modelBiped.heldItemLeft = ((ModelBiped) this.mainModel).heldItemLeft;
modelBiped.heldItemRight = ((ModelBiped) this.mainModel).heldItemRight;
modelBiped.isSneak = ((ModelBiped) this.mainModel).isSneak;
modelBiped.aimedBow = ((ModelBiped) this.mainModel).aimedBow;
}
modelBiped.setLivingAnimations(entity, par2, par3, 0.0F);
modelBiped.render(entity, par2, par3, par4, par5, par6, par7);

// Start alpha render
GL11.glDisable(GL11.GL_LIGHTING);
this.bindTexture(texture);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glEnable(GL11.GL_BLEND);
GL11.glAlphaFunc(GL11.GL_GREATER, 0.0F);
GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA);
float time = entity.ticksExisted / 10.0F;
float sTime = (float) Math.sin(time) * 0.5F + 0.5F;

float r = 0.2F * sTime;
float g = 1.0F * sTime;
float b = 0.2F * sTime;


modelBiped.render(entity, par2, par3, par4, par5, par6, par7);
GL11.glDisable(GL11.GL_BLEND);
GL11.glEnable(GL11.GL_ALPHA_TEST);
GL11.glColor4f(1, 1, 1, 1);
GL11.glEnable(GL11.GL_LIGHTING);

}
}
 
开发者ID:GhostMonk3408,项目名称:MidgarCrusade,代码行数:56,代码来源:RenderTutorialPlayer.java


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