Examples of rayTrace()


Examples of com.flansmod.common.guns.raytracing.PlayerSnapshot.raytrace()

                  if(snapshot == null)
                    shouldDoNormalHitDetect = true;
                  else
                  {
                    //Raytrace
                    ArrayList<BulletHit> playerHits = snapshot.raytrace(data.lastMeleePositions[k] == null ? nextPosInWorldCoords : data.lastMeleePositions[k], dPos);
                    hits.addAll(playerHits);
                  }
                }
               
                //If we couldn't get a snapshot, use normal entity hitbox calculations
View Full Code Here

Examples of com.flansmod.common.guns.raytracing.PlayerSnapshot.raytrace()

          if(snapshot == null)
            shouldDoNormalHitDetect = true;
          else
          {
            //Raytrace
            ArrayList<BulletHit> playerHits = snapshot.raytrace(origin, motion);
            hits.addAll(playerHits);
          }
        }
       
        //If we couldn't get a snapshot, use normal entity hitbox calculations
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer.rayTrace()

        int metadata = tileEntity.worldObj.getBlockMetadata(tileEntity.xCoord, tileEntity.yCoord, tileEntity.zCoord);
        String status = StatCollector.translateToLocal(te.stepUp ? "function.transformer.stepUp" : "function.transformer.stepDown");
        String name = StatCollector.translateToLocal(ElectricExpansionItems.blockTransformer.getUnlocalizedName() + "." + (int) Math.pow(2, metadata +1) + "x.name");
       
        EntityPlayer player = Minecraft.getMinecraft().thePlayer;
        MovingObjectPosition movingPosition = player.rayTrace(5, 1f);
       
       
       
        if (movingPosition != null)
        {
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer.rayTrace()

    TileEntity tileEntity = (TileEntity)configurable;
    EntityPlayer player = mc.thePlayer;
    World world = mc.thePlayer.worldObj;
    ItemStack itemStack = player.getCurrentEquippedItem();
    MovingObjectPosition pos = player.rayTrace(8.0D, 1.0F);

    if(pos != null && itemStack != null && itemStack.getItem() instanceof ItemConfigurator && ((ItemConfigurator)itemStack.getItem()).getState(itemStack) == 0)
    {
      int xPos = MathHelper.floor_double(pos.blockX);
      int yPos = MathHelper.floor_double(pos.blockY);
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer.rayTrace()

    if(transporter instanceof PartDiversionTransporter)
    {
      EntityPlayer player = mc.thePlayer;
      World world = mc.thePlayer.worldObj;
      ItemStack itemStack = player.getCurrentEquippedItem();
      MovingObjectPosition pos = player.rayTrace(8.0D, 1.0F);

      if(pos != null && itemStack != null && itemStack.getItem() instanceof ItemConfigurator)
      {
        int xPos = MathHelper.floor_double(pos.blockX);
        int yPos = MathHelper.floor_double(pos.blockY);
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer.rayTrace()

        EntityPlayer player = mc.thePlayer;
        World world = mc.thePlayer.worldObj;
 
        FontRenderer font = mc.fontRenderer;
 
        MovingObjectPosition pos = player.rayTrace(40.0D, 1.0F);
 
        if(pos != null)
        {
          int x = MathHelper.floor_double(pos.blockX);
          int y = MathHelper.floor_double(pos.blockY);
View Full Code Here

Examples of net.minecraft.entity.player.EntityPlayer.rayTrace()

          AttachmentType grip = type.getGrip(currentHeldItem);
          if(grip != null && grip.flashlight)
          {
            for(int i = 0; i < 2; i++)
            {
              MovingObjectPosition ray = player.rayTrace(grip.flashlightRange / 2F * (i + 1), 1F);
              if(ray != null)
              {
                int x = ray.blockX;
                int y = ray.blockY;
                int z = ray.blockZ;
View Full Code Here

Examples of org.terasology.physics.Physics.rayTrace()

        Vector3f originPos = location.getWorldPosition();
        originPos.y += characterComponent.eyeOffset;
        boolean ownedEntityUsage = usedOwnedEntity.exists();
        int activationId = nextActivationId++;
        Physics physics = CoreRegistry.get(Physics.class);
        HitResult result = physics.rayTrace(originPos, direction, characterComponent.interactionRange, filter);
        boolean eventWithTarget = result.isHit();
        if (eventWithTarget) {
            EntityRef activatedObject = usedOwnedEntity.exists() ? usedOwnedEntity : result.getEntity();
            activatedObject.send(new ActivationPredicted(character, result.getEntity(), originPos, direction,
                    result.getHitPoint(), result.getHitNormal(), activationId));
View Full Code Here

Examples of org.terasology.physics.Physics.rayTrace()

        // TODO: This will change when camera are handled better (via a component)
        Camera camera = CoreRegistry.get(WorldRenderer.class).getActiveCamera();

        Physics physicsRenderer = CoreRegistry.get(Physics.class);
        HitResult hitInfo = physicsRenderer.rayTrace(new Vector3f(camera.getPosition()), new Vector3f(camera.getViewingDirection()), TARGET_DISTANCE, filter);
        updateFocalDistance(hitInfo, delta);
        Vector3i newBlockPos = null;

        EntityRef newTarget = EntityRef.NULL;
        if (hitInfo.isHit()) {
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.