java类net.minecraft.client.renderer.RenderGlobal的实例源码

RenderChunk.java 文件源码 项目:ExpandedRailsMod 阅读 19 收藏 0 点赞 0 评论 0
public RenderChunk(World p_i47120_1_, RenderGlobal p_i47120_2_, int p_i47120_3_)
{
    for (int i = 0; i < this.mapEnumFacing.length; ++i)
    {
        this.mapEnumFacing[i] = new BlockPos.MutableBlockPos();
    }

    this.world = p_i47120_1_;
    this.renderGlobal = p_i47120_2_;
    this.index = p_i47120_3_;

    if (OpenGlHelper.useVbo())
    {
        for (int j = 0; j < BlockRenderLayer.values().length; ++j)
        {
            this.vertexBuffers[j] = new VertexBuffer(DefaultVertexFormats.BLOCK);
        }
    }
}
RenderManager.java 文件源码 项目:Cauldron 阅读 19 收藏 0 点赞 0 评论 0
private void renderDebugBoundingBox(Entity p_85094_1_, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_)
{
    GL11.glDepthMask(false);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
    float f2 = p_85094_1_.width / 2.0F;
    AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(p_85094_2_ - (double)f2, p_85094_4_, p_85094_6_ - (double)f2, p_85094_2_ + (double)f2, p_85094_4_ + (double)p_85094_1_.height, p_85094_6_ + (double)f2);
    RenderGlobal.drawOutlinedBoundingBox(axisalignedbb, 16777215);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
}
RenderManager.java 文件源码 项目:Cauldron 阅读 25 收藏 0 点赞 0 评论 0
private void renderDebugBoundingBox(Entity p_85094_1_, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_)
{
    GL11.glDepthMask(false);
    GL11.glDisable(GL11.GL_TEXTURE_2D);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
    float f2 = p_85094_1_.width / 2.0F;
    AxisAlignedBB axisalignedbb = AxisAlignedBB.getBoundingBox(p_85094_2_ - (double)f2, p_85094_4_, p_85094_6_ - (double)f2, p_85094_2_ + (double)f2, p_85094_4_ + (double)p_85094_1_.height, p_85094_6_ + (double)f2);
    RenderGlobal.drawOutlinedBoundingBox(axisalignedbb, 16777215);
    GL11.glEnable(GL11.GL_TEXTURE_2D);
    GL11.glEnable(GL11.GL_LIGHTING);
    GL11.glEnable(GL11.GL_CULL_FACE);
    GL11.glDisable(GL11.GL_BLEND);
    GL11.glDepthMask(true);
}
RenderManager.java 文件源码 项目:DecompiledMinecraft 阅读 24 收藏 0 点赞 0 评论 0
/**
 * Renders the bounding box around an entity when F3+B is pressed
 */
private void renderDebugBoundingBox(Entity entityIn, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_)
{
    GlStateManager.depthMask(false);
    GlStateManager.disableTexture2D();
    GlStateManager.disableLighting();
    GlStateManager.disableCull();
    GlStateManager.disableBlend();
    float f = entityIn.width / 2.0F;
    AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
    AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX - entityIn.posX + p_85094_2_, axisalignedbb.minY - entityIn.posY + p_85094_4_, axisalignedbb.minZ - entityIn.posZ + p_85094_6_, axisalignedbb.maxX - entityIn.posX + p_85094_2_, axisalignedbb.maxY - entityIn.posY + p_85094_4_, axisalignedbb.maxZ - entityIn.posZ + p_85094_6_);
    RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255);

    if (entityIn instanceof EntityLivingBase)
    {
        float f1 = 0.01F;
        RenderGlobal.func_181563_a(new AxisAlignedBB(p_85094_2_ - (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() + 0.009999999776482582D, p_85094_6_ + (double)f), 255, 0, 0, 255);
    }

    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    Vec3 vec3 = entityIn.getLook(p_85094_9_);
    worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR);
    worldrenderer.pos(p_85094_2_, p_85094_4_ + (double)entityIn.getEyeHeight(), p_85094_6_).color(0, 0, 255, 255).endVertex();
    worldrenderer.pos(p_85094_2_ + vec3.xCoord * 2.0D, p_85094_4_ + (double)entityIn.getEyeHeight() + vec3.yCoord * 2.0D, p_85094_6_ + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.enableTexture2D();
    GlStateManager.enableLighting();
    GlStateManager.enableCull();
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
}
RenderInfoLazy.java 文件源码 项目:BaseClient 阅读 15 收藏 0 点赞 0 评论 0
public RenderGlobal.ContainerLocalRenderInformation getRenderInfo()
{
    if (this.renderInfo == null)
    {
        this.renderInfo = new RenderGlobal.ContainerLocalRenderInformation(this.renderChunk, (EnumFacing)null, 0);
    }

    return this.renderInfo;
}
DynamicLights.java 文件源码 项目:BaseClient 阅读 20 收藏 0 点赞 0 评论 0
public static void entityRemoved(Entity p_entityRemoved_0_, RenderGlobal p_entityRemoved_1_)
{
    synchronized (mapDynamicLights)
    {
        DynamicLight dynamiclight = (DynamicLight)mapDynamicLights.remove(IntegerCache.valueOf(p_entityRemoved_0_.getEntityId()));

        if (dynamiclight != null)
        {
            dynamiclight.updateLitChunks(p_entityRemoved_1_);
        }
    }
}
DynamicLights.java 文件源码 项目:BaseClient 阅读 19 收藏 0 点赞 0 评论 0
private static void updateMapDynamicLights(RenderGlobal p_updateMapDynamicLights_0_)
{
    World world = p_updateMapDynamicLights_0_.getWorld();

    if (world != null)
    {
        for (Entity entity : world.getLoadedEntityList())
        {
            int i = getLightLevel(entity);

            if (i > 0)
            {
                Integer integer = IntegerCache.valueOf(entity.getEntityId());
                DynamicLight dynamiclight = (DynamicLight)mapDynamicLights.get(integer);

                if (dynamiclight == null)
                {
                    dynamiclight = new DynamicLight(entity);
                    mapDynamicLights.put(integer, dynamiclight);
                }
            }
            else
            {
                Integer integer1 = IntegerCache.valueOf(entity.getEntityId());
                DynamicLight dynamiclight1 = (DynamicLight)mapDynamicLights.remove(integer1);

                if (dynamiclight1 != null)
                {
                    dynamiclight1.updateLitChunks(p_updateMapDynamicLights_0_);
                }
            }
        }
    }
}
DynamicLights.java 文件源码 项目:BaseClient 阅读 19 收藏 0 点赞 0 评论 0
public static void removeLights(RenderGlobal p_removeLights_0_)
{
    synchronized (mapDynamicLights)
    {
        Collection<DynamicLight> collection = mapDynamicLights.values();
        Iterator iterator = collection.iterator();

        while (iterator.hasNext())
        {
            DynamicLight dynamiclight = (DynamicLight)iterator.next();
            iterator.remove();
            dynamiclight.updateLitChunks(p_removeLights_0_);
        }
    }
}
DynamicLight.java 文件源码 项目:BaseClient 阅读 22 收藏 0 点赞 0 评论 0
public void updateLitChunks(RenderGlobal p_updateLitChunks_1_)
{
    for (BlockPos blockpos : this.setLitChunkPos)
    {
        RenderChunk renderchunk = p_updateLitChunks_1_.getRenderChunk(blockpos);
        this.updateChunkLight(renderchunk, (Set<BlockPos>)null, (Set<BlockPos>)null);
    }
}
RenderManager.java 文件源码 项目:BaseClient 阅读 18 收藏 0 点赞 0 评论 0
/**
 * Renders the bounding box around an entity when F3+B is pressed
 */
private void renderDebugBoundingBox(Entity entityIn, double p_85094_2_, double p_85094_4_, double p_85094_6_, float p_85094_8_, float p_85094_9_)
{
    GlStateManager.depthMask(false);
    GlStateManager.disableTexture2D();
    GlStateManager.disableLighting();
    GlStateManager.disableCull();
    GlStateManager.disableBlend();
    float f = entityIn.width / 2.0F;
    AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
    AxisAlignedBB axisalignedbb1 = new AxisAlignedBB(axisalignedbb.minX - entityIn.posX + p_85094_2_, axisalignedbb.minY - entityIn.posY + p_85094_4_, axisalignedbb.minZ - entityIn.posZ + p_85094_6_, axisalignedbb.maxX - entityIn.posX + p_85094_2_, axisalignedbb.maxY - entityIn.posY + p_85094_4_, axisalignedbb.maxZ - entityIn.posZ + p_85094_6_);
    RenderGlobal.func_181563_a(axisalignedbb1, 255, 255, 255, 255);

    if (entityIn instanceof EntityLivingBase)
    {
        float f1 = 0.01F;
        RenderGlobal.func_181563_a(new AxisAlignedBB(p_85094_2_ - (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() - 0.009999999776482582D, p_85094_6_ - (double)f, p_85094_2_ + (double)f, p_85094_4_ + (double)entityIn.getEyeHeight() + 0.009999999776482582D, p_85094_6_ + (double)f), 255, 0, 0, 255);
    }

    Tessellator tessellator = Tessellator.getInstance();
    WorldRenderer worldrenderer = tessellator.getWorldRenderer();
    Vec3 vec3 = entityIn.getLook(p_85094_9_);
    worldrenderer.begin(3, DefaultVertexFormats.POSITION_COLOR);
    worldrenderer.pos(p_85094_2_, p_85094_4_ + (double)entityIn.getEyeHeight(), p_85094_6_).color(0, 0, 255, 255).endVertex();
    worldrenderer.pos(p_85094_2_ + vec3.xCoord * 2.0D, p_85094_4_ + (double)entityIn.getEyeHeight() + vec3.yCoord * 2.0D, p_85094_6_ + vec3.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.enableTexture2D();
    GlStateManager.enableLighting();
    GlStateManager.enableCull();
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
}


问题


面经


文章

微信
公众号

扫码关注公众号