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


Java Entity.getLook方法代码示例

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


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

示例1: getObjectMouseOver

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
private MovingObjectPosition getObjectMouseOver(DiscreteMovementCommand command)
{
    MovingObjectPosition mop = null;
    if (command.equals(DiscreteMovementCommand.USE))
        mop = Minecraft.getMinecraft().objectMouseOver;
    else if (command.equals(DiscreteMovementCommand.JUMPUSE))
    {
        long partialTicks = 0;  //Minecraft.timer.renderPartialTicks
        Entity viewer = Minecraft.getMinecraft().thePlayer;
        double blockReach = Minecraft.getMinecraft().playerController.getBlockReachDistance();
        Vec3 eyePos = viewer.getPositionEyes(partialTicks);
        Vec3 lookVec = viewer.getLook(partialTicks);
        int yOffset = 1;    // For the jump
        Vec3 searchVec = eyePos.addVector(lookVec.xCoord * blockReach, yOffset + lookVec.yCoord * blockReach, lookVec.zCoord * blockReach);
        mop = Minecraft.getMinecraft().theWorld.rayTraceBlocks(eyePos, searchVec, false, false, false);
    }
    return mop;
}
 
开发者ID:Yarichi,项目名称:Proyecto-DASI,代码行数:19,代码来源:DiscreteMovementCommandsImplementation.java

示例2: renderDebugBoundingBox

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
/**
 * 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);
}
 
开发者ID:Notoh,项目名称:DecompiledMinecraft,代码行数:35,代码来源:RenderManager.java

示例3: renderDebugBoundingBox

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
/**
 * Renders the bounding box around an entity when F3+B is pressed
 */
private void renderDebugBoundingBox(Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.depthMask(false);
    GlStateManager.disableTexture2D();
    GlStateManager.disableLighting();
    GlStateManager.disableCull();
    GlStateManager.disableBlend();
    float f = entityIn.width / 2.0F;
    AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
    RenderGlobal.drawBoundingBox(axisalignedbb.minX - entityIn.posX + x, axisalignedbb.minY - entityIn.posY + y, axisalignedbb.minZ - entityIn.posZ + z, axisalignedbb.maxX - entityIn.posX + x, axisalignedbb.maxY - entityIn.posY + y, axisalignedbb.maxZ - entityIn.posZ + z, 1.0F, 1.0F, 1.0F, 1.0F);

    if (entityIn instanceof EntityLivingBase)
    {
        float f1 = 0.01F;
        RenderGlobal.drawBoundingBox(x - (double)f, y + (double)entityIn.getEyeHeight() - 0.009999999776482582D, z - (double)f, x + (double)f, y + (double)entityIn.getEyeHeight() + 0.009999999776482582D, z + (double)f, 1.0F, 0.0F, 0.0F, 1.0F);
    }

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    Vec3d vec3d = entityIn.getLook(partialTicks);
    vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
    vertexbuffer.pos(x, y + (double)entityIn.getEyeHeight(), z).color(0, 0, 255, 255).endVertex();
    vertexbuffer.pos(x + vec3d.xCoord * 2.0D, y + (double)entityIn.getEyeHeight() + vec3d.yCoord * 2.0D, z + vec3d.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.enableTexture2D();
    GlStateManager.enableLighting();
    GlStateManager.enableCull();
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
}
 
开发者ID:F1r3w477,项目名称:CustomWorldGen,代码行数:34,代码来源:RenderManager.java

示例4: rayTraceEntity

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public static RayTraceResult rayTraceEntity(Entity e, double blockReachDistance) {
    Vec3d eyes = e.getPositionEyes(1);
    Vec3d look = e.getLook(1);
    Vec3d end = eyes.addVector(look.x * blockReachDistance, look.y * blockReachDistance, look.z * blockReachDistance);
    return e.world.rayTraceBlocks(eyes, end, false, false, true);
}
 
开发者ID:kenzierocks,项目名称:HardVox,代码行数:7,代码来源:RayTraceHelper.java

示例5: actualRayTrace

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public static Entity actualRayTrace(Entity entity, double dist)
{
    Vec3d vec3d = entity.getPositionEyes(1.0F);
    Vec3d vec3d1 = entity.getLook(1.0F);
    Vec3d vec3d2 = vec3d.addVector(vec3d1.xCoord * dist, vec3d1.yCoord * dist, vec3d1.zCoord * dist);

    Entity pointedEntity = null;
    List<Entity> list = entity.worldObj.getEntitiesInAABBexcluding(entity, entity.getEntityBoundingBox().addCoord(vec3d1.xCoord * dist, vec3d1.yCoord * dist, vec3d1.zCoord * dist).expand(1.0D, 1.0D, 1.0D), Predicates.and(EntitySelectors.NOT_SPECTATING, new Predicate<Entity>()
    {
        public boolean apply(@Nullable Entity p_apply_1_)
        {
            return p_apply_1_ != null && p_apply_1_.canBeCollidedWith();
        }
    }));


    for (int j = 0; j < list.size(); ++j)
    {
        Entity entity1 = (Entity)list.get(j);
        AxisAlignedBB axisalignedbb = entity1.getEntityBoundingBox().expandXyz((double)entity1.getCollisionBorderSize());
        RayTraceResult raytraceresult = axisalignedbb.calculateIntercept(vec3d, vec3d2);

        if (axisalignedbb.isVecInside(vec3d))
        {
            if (dist >= 0.0D)
            {
                pointedEntity = entity1;
                dist = 0.0D;
            }
        }
        else if (raytraceresult != null)
        {
            double d3 = vec3d.distanceTo(raytraceresult.hitVec);

            if (d3 < dist || dist == 0.0D)
            {
                if (entity1.getLowestRidingEntity() == entity.getLowestRidingEntity() && !entity.canRiderInteract())
                {
                    if (dist == 0.0D)
                    {
                        pointedEntity = entity1;
                    }
                }
                else
                {
                    pointedEntity = entity1;
                    dist = d3;
                }
            }
        }
    }

    return pointedEntity;


}
 
开发者ID:Drazuam,项目名称:RunicArcana,代码行数:57,代码来源:DustSymbolSight.java

示例6: getLookVector

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
public static Vec3d getLookVector(Entity ent, float delta) {
    return ent.getLook(delta);
}
 
开发者ID:NSExceptional,项目名称:Zombe-Modpack,代码行数:4,代码来源:ZWrapper.java

示例7: renderDebugBoundingBox

import net.minecraft.entity.Entity; //导入方法依赖的package包/类
/**
 * Renders the bounding box around an entity when F3+B is pressed
 */
private void renderDebugBoundingBox(Entity entityIn, double x, double y, double z, float entityYaw, float partialTicks)
{
    GlStateManager.depthMask(false);
    GlStateManager.disableTexture2D();
    GlStateManager.disableLighting();
    GlStateManager.disableCull();
    GlStateManager.disableBlend();
    float f = entityIn.width / 2.0F;
    AxisAlignedBB axisalignedbb = entityIn.getEntityBoundingBox();
    RenderGlobal.drawBoundingBox(axisalignedbb.minX - entityIn.posX + x, axisalignedbb.minY - entityIn.posY + y, axisalignedbb.minZ - entityIn.posZ + z, axisalignedbb.maxX - entityIn.posX + x, axisalignedbb.maxY - entityIn.posY + y, axisalignedbb.maxZ - entityIn.posZ + z, 1.0F, 1.0F, 1.0F, 1.0F);
    Entity[] aentity = entityIn.getParts();

    if (aentity != null)
    {
        for (Entity entity : aentity)
        {
            double d0 = (entity.posX - entity.prevPosX) * (double)partialTicks;
            double d1 = (entity.posY - entity.prevPosY) * (double)partialTicks;
            double d2 = (entity.posZ - entity.prevPosZ) * (double)partialTicks;
            AxisAlignedBB axisalignedbb1 = entity.getEntityBoundingBox();
            RenderGlobal.drawBoundingBox(axisalignedbb1.minX - this.renderPosX + d0, axisalignedbb1.minY - this.renderPosY + d1, axisalignedbb1.minZ - this.renderPosZ + d2, axisalignedbb1.maxX - this.renderPosX + d0, axisalignedbb1.maxY - this.renderPosY + d1, axisalignedbb1.maxZ - this.renderPosZ + d2, 0.25F, 1.0F, 0.0F, 1.0F);
        }
    }

    if (entityIn instanceof EntityLivingBase)
    {
        float f1 = 0.01F;
        RenderGlobal.drawBoundingBox(x - (double)f, y + (double)entityIn.getEyeHeight() - 0.009999999776482582D, z - (double)f, x + (double)f, y + (double)entityIn.getEyeHeight() + 0.009999999776482582D, z + (double)f, 1.0F, 0.0F, 0.0F, 1.0F);
    }

    Tessellator tessellator = Tessellator.getInstance();
    VertexBuffer vertexbuffer = tessellator.getBuffer();
    Vec3d vec3d = entityIn.getLook(partialTicks);
    vertexbuffer.begin(3, DefaultVertexFormats.POSITION_COLOR);
    vertexbuffer.pos(x, y + (double)entityIn.getEyeHeight(), z).color(0, 0, 255, 255).endVertex();
    vertexbuffer.pos(x + vec3d.xCoord * 2.0D, y + (double)entityIn.getEyeHeight() + vec3d.yCoord * 2.0D, z + vec3d.zCoord * 2.0D).color(0, 0, 255, 255).endVertex();
    tessellator.draw();
    GlStateManager.enableTexture2D();
    GlStateManager.enableLighting();
    GlStateManager.enableCull();
    GlStateManager.disableBlend();
    GlStateManager.depthMask(true);
}
 
开发者ID:sudofox,项目名称:Backmemed,代码行数:47,代码来源:RenderManager.java


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