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


Java ICamera类代码示例

本文整理汇总了Java中net.minecraft.client.renderer.culling.ICamera的典型用法代码示例。如果您正苦于以下问题:Java ICamera类的具体用法?Java ICamera怎么用?Java ICamera使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


ICamera类属于net.minecraft.client.renderer.culling包,在下文中一共展示了ICamera类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: shouldRender

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
public boolean shouldRender(T livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else if (livingEntity.getLeashed() && livingEntity.getLeashedToEntity() != null)
    {
        Entity entity = livingEntity.getLeashedToEntity();
        return camera.isBoundingBoxInFrustum(entity.getEntityBoundingBox());
    }
    else
    {
        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:17,代码来源:RenderLiving.java

示例2: shouldRender

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
public boolean shouldRender(T livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else if (livingEntity.getLeashed() && livingEntity.getLeashedToEntity() != null)
    {
        Entity entity = livingEntity.getLeashedToEntity();
        return camera.isBoundingBoxInFrustum(entity.getRenderBoundingBox());
    }
    else
    {
        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:RenderLiving.java

示例3: shouldRender

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
public boolean shouldRender(EntityShulker livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else
    {
        if (livingEntity.getClientTeleportInterp() > 0 && livingEntity.isAttachedToBlock())
        {
            BlockPos blockpos = livingEntity.getOldAttachPos();
            BlockPos blockpos1 = livingEntity.getAttachmentPos();
            Vec3d vec3d = new Vec3d((double)blockpos1.getX(), (double)blockpos1.getY(), (double)blockpos1.getZ());
            Vec3d vec3d1 = new Vec3d((double)blockpos.getX(), (double)blockpos.getY(), (double)blockpos.getZ());

            if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord, vec3d.zCoord)))
            {
                return true;
            }
        }

        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:25,代码来源:RenderShulker.java

示例4: checkLoadVisibleChunks

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
private void checkLoadVisibleChunks(Entity p_checkLoadVisibleChunks_1_, float p_checkLoadVisibleChunks_2_, ICamera p_checkLoadVisibleChunks_3_, boolean p_checkLoadVisibleChunks_4_)
{
    if (this.loadVisibleChunks)
    {
        this.loadVisibleChunks = false;
        this.loadAllVisibleChunks(p_checkLoadVisibleChunks_1_, (double)p_checkLoadVisibleChunks_2_, p_checkLoadVisibleChunks_3_, p_checkLoadVisibleChunks_4_);
    }

    if (Keyboard.isKeyDown(61) && Keyboard.isKeyDown(38))
    {
        this.loadVisibleChunks = true;
        TextComponentString textcomponentstring = new TextComponentString(I18n.format("of.message.loadingVisibleChunks", new Object[0]));
        this.mc.ingameGUI.getChatGUI().printChatMessage(textcomponentstring);
        Reflector.Minecraft_actionKeyF3.setValue(this.mc, Boolean.TRUE);
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:17,代码来源:EntityRenderer.java

示例5: visitChain

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
@SideOnly(Side.CLIENT)
void visitChain(ICamera camera, float partial, ChainRender cr) {
    // This is far from efficient as it ought to be.
    // If the line is diagonal, then there will be huge amounts of
    // space where the line is drawn even tho it is far off-screen.
    if (start == null) return;
    Vec3 s = getStart(partial);
    Vec3 e = getEnd(partial);
    // The lines are drawn fat, so make the box a bit fatter as well
    final double d = 0.125;
    AxisAlignedBB box = SpaceUtil.newBoxSort(s, e).expand(d, d, d);

    if (camera.isBoundingBoxInFrustum(box)) {
        cr.drawChain(s, e, partial);
    }
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:17,代码来源:ChainLink.java

示例6: refreshCamera

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
private static void refreshCamera()
{
    Entity entity = Minecraft.getMinecraft().getRenderViewEntity();
    if(entity == null) return;

    float partialTicks = Animation.getPartialTickTime();
    
    ICamera newCam = new Frustum();
    double d0 = entity.lastTickPosX + (entity.posX - entity.lastTickPosX) * partialTicks;
    double d1 = entity.lastTickPosY + (entity.posY - entity.lastTickPosY) * partialTicks;
    double d2 = entity.lastTickPosZ + (entity.posZ - entity.lastTickPosZ) * partialTicks;
    newCam.setPosition(d0, d1, d2);
    cameraX = d0;
    cameraY = d1;
    cameraZ = d2;
    camera = newCam;
}
 
开发者ID:grondag,项目名称:Hard-Science,代码行数:18,代码来源:ClientProxy.java

示例7: shouldRender

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else
    {
        if (livingEntity.hasTargetedEntity())
        {
            EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();

            if (entitylivingbase != null)
            {
                Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
                Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);

                if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
                {
                    return true;
                }
            }
        }

        return false;
    }
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:28,代码来源:RenderGuardian.java

示例8: shouldRender

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender((EntityLiving)livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else
    {
        if (livingEntity.hasTargetedEntity())
        {
            EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();

            if (entitylivingbase != null)
            {
                Vec3 vec3 = this.func_177110_a(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
                Vec3 vec31 = this.func_177110_a(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);

                if (camera.isBoundingBoxInFrustum(AxisAlignedBB.fromBounds(vec31.xCoord, vec31.yCoord, vec31.zCoord, vec3.xCoord, vec3.yCoord, vec3.zCoord)))
                {
                    return true;
                }
            }
        }

        return false;
    }
}
 
开发者ID:SkidJava,项目名称:BaseClient,代码行数:28,代码来源:RenderGuardian.java

示例9: shouldRender

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
public boolean shouldRender(EntityGuardian livingEntity, ICamera camera, double camX, double camY, double camZ)
{
    if (super.shouldRender(livingEntity, camera, camX, camY, camZ))
    {
        return true;
    }
    else
    {
        if (livingEntity.hasTargetedEntity())
        {
            EntityLivingBase entitylivingbase = livingEntity.getTargetedEntity();

            if (entitylivingbase != null)
            {
                Vec3d vec3d = this.getPosition(entitylivingbase, (double)entitylivingbase.height * 0.5D, 1.0F);
                Vec3d vec3d1 = this.getPosition(livingEntity, (double)livingEntity.getEyeHeight(), 1.0F);

                if (camera.isBoundingBoxInFrustum(new AxisAlignedBB(vec3d1.xCoord, vec3d1.yCoord, vec3d1.zCoord, vec3d.xCoord, vec3d.yCoord, vec3d.zCoord)))
                {
                    return true;
                }
            }
        }

        return false;
    }
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:28,代码来源:RenderGuardian.java

示例10: isOutlineActive

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
private boolean isOutlineActive(Entity p_184383_1_, Entity p_184383_2_, ICamera p_184383_3_)
{
	if(Hacks.findMod(OutlineESP.class).isEnabled())
		return true;
	
    boolean flag = p_184383_2_ instanceof EntityLivingBase && ((EntityLivingBase)p_184383_2_).isPlayerSleeping();
    return p_184383_1_ == p_184383_2_ && this.mc.gameSettings.thirdPersonView == 0 && !flag ? false : (p_184383_1_.isGlowing() ? true : (this.mc.player.isSpectator() && this.mc.gameSettings.keyBindSpectatorOutlines.isKeyDown() && p_184383_1_ instanceof EntityPlayer ? p_184383_1_.ignoreFrustumCheck || p_184383_3_.isBoundingBoxInFrustum(p_184383_1_.getEntityBoundingBox()) || p_184383_1_.isRidingOrBeingRiddenBy(this.mc.player) : false));
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:9,代码来源:RenderGlobal.java

示例11: drawChains

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
@SubscribeEvent
public void drawChains(RenderWorldLastEvent event) {
    if (chains.isEmpty()) return;
    final float partial = event.partialTicks;
    final ICamera camera = getFrustum(partial);

    final Minecraft mc = Minecraft.getMinecraft();
    final EntityRenderer er = mc.entityRenderer;
    final TextureManager textureManager = mc.getTextureManager();
    setup = false;
    world = mc.theWorld;

    for (WeakReference<ChainLink> ref : chains) {
        ChainLink chain = ref.get();
        if (chain == null) {
            needsRebag = true;
            continue;
        }
        chain.visitChain(camera, partial, this);
    }
    if (!setup) {
        cleanup();
        return;
    }

    GL11.glPushAttrib(GL11.GL_ENABLE_BIT | GL11.GL_COLOR_BUFFER_BIT );
    textureManager.bindTexture(new ResourceLocation("factorization", "textures/chain.png"));
    er.enableLightmap();
    GL11.glEnable(GL11.GL_BLEND);
    GL11.glBlendFunc(GL11.GL_ONE, GL11.GL_ZERO);
    GL11.glDisable(GL11.GL_LIGHTING);
    GL11.glDisable(GL11.GL_CULL_FACE);

    tessI.draw();
    er.disableLightmap();
    GL11.glPopAttrib();
    textureManager.bindTexture(Core.blockAtlas);
    cleanup();
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:40,代码来源:ChainRender.java

示例12: getFrustum

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
ICamera getFrustum(float partial) {
    // Unfortunately we have to make our own Frustum.
    final Minecraft mc = Minecraft.getMinecraft();
    final Entity eye = mc.getRenderViewEntity();
    double eyeX = eye.lastTickPosX + (eye.posX - eye.lastTickPosX) * (double)partial;
    double eyeY = eye.lastTickPosY + (eye.posY - eye.lastTickPosY) * (double)partial;
    double eyeZ = eye.lastTickPosZ + (eye.posZ - eye.lastTickPosZ) * (double)partial;

    Frustum frustum = new Frustum(); // Notch can't spell
    frustum.setPosition(eyeX, eyeY, eyeZ);
    return frustum;
}
 
开发者ID:purpleposeidon,项目名称:Factorization,代码行数:13,代码来源:ChainRender.java

示例13: setupTerrain

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
@Override
public void setupTerrain(Entity viewEntity, double partialTicks, ICamera camera, int frameCount, boolean playerSpectator) {
	if (Minecraft.getMinecraft().player != null && Minecraft.getMinecraft().player instanceof EntityPlayerSP) 
		super.setupTerrain(viewEntity, partialTicks, camera, frameCount, playerSpectator || ((EntityPlayerSP) Minecraft.getMinecraft().player).getOverrideNoclip());
	else 
		super.setupTerrain(viewEntity, partialTicks, camera, frameCount, playerSpectator);
}
 
开发者ID:MrNobody98,项目名称:morecommands,代码行数:8,代码来源:PatchRenderGlobal.java

示例14: updateInFrustum

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
public void updateInFrustum(ICamera par1ICamera)
{
    this.isInFrustum = par1ICamera.isBoundingBoxInFrustum(this.rendererBoundingBox);

    if (this.isInFrustum && Config.isOcclusionFancy())
    {
        this.isInFrustrumFully = par1ICamera.isBoundingBoxInFrustumFully(this.rendererBoundingBox);
    }
    else
    {
        this.isInFrustrumFully = false;
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:14,代码来源:WorldRenderer.java

示例15: clipRenderersByFrustum

import net.minecraft.client.renderer.culling.ICamera; //导入依赖的package包/类
/**
 * Checks all renderers that previously weren't in the frustum and 1/16th of those that previously were in the
 * frustum for frustum clipping Args: frustum, partialTickTime
 */
public void clipRenderersByFrustum(ICamera par1ICamera, float par2)
{
    for (int var3 = 0; var3 < this.countSortedWorldRenderers; ++var3)
    {
        WorldRenderer wr = this.sortedWorldRenderers[var3];

        if (!wr.skipAllRenderPasses())
        {
            wr.updateInFrustum(par1ICamera);
        }
    }
}
 
开发者ID:MinecraftModdedClients,项目名称:Resilience-Client-Source,代码行数:17,代码来源:RenderGlobal.java


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