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


Java RenderManager.renderEntityWithPosYaw方法代码示例

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


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

示例1: renderParticle

import net.minecraft.client.renderer.entity.RenderManager; //导入方法依赖的package包/类
/**
 * Renders the particle
 */
public void renderParticle(WorldRenderer worldRendererIn, Entity entityIn, float partialTicks, float p_180434_4_, float p_180434_5_, float p_180434_6_, float p_180434_7_, float p_180434_8_)
{
    if (this.entity != null)
    {
        RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
        rendermanager.setRenderPosition(EntityFX.interpPosX, EntityFX.interpPosY, EntityFX.interpPosZ);
        float f = 0.42553192F;
        float f1 = ((float)this.particleAge + partialTicks) / (float)this.particleMaxAge;
        GlStateManager.depthMask(true);
        GlStateManager.enableBlend();
        GlStateManager.enableDepth();
        GlStateManager.blendFunc(770, 771);
        float f2 = 240.0F;
        OpenGlHelper.setLightmapTextureCoords(OpenGlHelper.lightmapTexUnit, f2, f2);
        GlStateManager.pushMatrix();
        float f3 = 0.05F + 0.5F * MathHelper.sin(f1 * (float)Math.PI);
        GlStateManager.color(1.0F, 1.0F, 1.0F, f3);
        GlStateManager.translate(0.0F, 1.8F, 0.0F);
        GlStateManager.rotate(180.0F - entityIn.rotationYaw, 0.0F, 1.0F, 0.0F);
        GlStateManager.rotate(60.0F - 150.0F * f1 - entityIn.rotationPitch, 1.0F, 0.0F, 0.0F);
        GlStateManager.translate(0.0F, -0.4F, -1.5F);
        GlStateManager.scale(f, f, f);
        this.entity.rotationYaw = this.entity.prevRotationYaw = 0.0F;
        this.entity.rotationYawHead = this.entity.prevRotationYawHead = 0.0F;
        rendermanager.renderEntityWithPosYaw(this.entity, 0.0D, 0.0D, 0.0D, 0.0F, partialTicks);
        GlStateManager.popMatrix();
        GlStateManager.enableDepth();
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:33,代码来源:MobAppearance.java

示例2: drawEntityOnScreen

import net.minecraft.client.renderer.entity.RenderManager; //导入方法依赖的package包/类
/**
 * Draws the entity to the screen. Args: xPos, yPos, scale, mouseX, mouseY, entityLiving
 */
public static void drawEntityOnScreen(int posX, int posY, int scale, float mouseX, float mouseY, EntityLivingBase ent)
{
    GlStateManager.enableColorMaterial();
    GlStateManager.pushMatrix();
    GlStateManager.translate((float)posX, (float)posY, 50.0F);
    GlStateManager.scale((float)(-scale), (float)scale, (float)scale);
    GlStateManager.rotate(180.0F, 0.0F, 0.0F, 1.0F);
    float f = ent.renderYawOffset;
    float f1 = ent.rotationYaw;
    float f2 = ent.rotationPitch;
    float f3 = ent.prevRotationYawHead;
    float f4 = ent.rotationYawHead;
    GlStateManager.rotate(135.0F, 0.0F, 1.0F, 0.0F);
    RenderHelper.enableStandardItemLighting();
    GlStateManager.rotate(-135.0F, 0.0F, 1.0F, 0.0F);
    GlStateManager.rotate(-((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F, 1.0F, 0.0F, 0.0F);
    ent.renderYawOffset = (float)Math.atan((double)(mouseX / 40.0F)) * 20.0F;
    ent.rotationYaw = (float)Math.atan((double)(mouseX / 40.0F)) * 40.0F;
    ent.rotationPitch = -((float)Math.atan((double)(mouseY / 40.0F))) * 20.0F;
    ent.rotationYawHead = ent.rotationYaw;
    ent.prevRotationYawHead = ent.rotationYaw;
    GlStateManager.translate(0.0F, 0.0F, 0.0F);
    RenderManager rendermanager = Minecraft.getMinecraft().getRenderManager();
    rendermanager.setPlayerViewY(180.0F);
    rendermanager.setRenderShadow(false);
    rendermanager.renderEntityWithPosYaw(ent, 0.0D, 0.0D, 0.0D, 0.0F, 1.0F);
    rendermanager.setRenderShadow(true);
    ent.renderYawOffset = f;
    ent.rotationYaw = f1;
    ent.rotationPitch = f2;
    ent.prevRotationYawHead = f3;
    ent.rotationYawHead = f4;
    GlStateManager.popMatrix();
    RenderHelper.disableStandardItemLighting();
    GlStateManager.disableRescaleNormal();
    GlStateManager.setActiveTexture(OpenGlHelper.lightmapTexUnit);
    GlStateManager.disableTexture2D();
    GlStateManager.setActiveTexture(OpenGlHelper.defaultTexUnit);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:43,代码来源:GuiInventory.java


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