Examples of Vec3


Examples of net.minecraft.src.Vec3

    }

    public static Quaternion exp(Quaternion input)
    {
        float inputA = input.w;
        Vec3 inputV = Vec3.fakePool.getVecFromPool(input.x, input.y, input.z);
        float outputA = (float)(Math.exp(inputA) * Math.cos(inputV.lengthVector()));
        Vec3 outputV = Vec3.fakePool.getVecFromPool(0, 0, 0);
        outputV.xCoord = Math.exp(inputA) * (inputV.normalize().xCoord * (float)Math.sin(inputV.lengthVector()));
        outputV.yCoord = Math.exp(inputA) * (inputV.normalize().yCoord * (float)Math.sin(inputV.lengthVector()));
        outputV.zCoord = Math.exp(inputA) * (inputV.normalize().zCoord * (float)Math.sin(inputV.lengthVector()));

        return new Quaternion((float)outputV.xCoord, (float)outputV.yCoord, (float)outputV.zCoord, outputA);
View Full Code Here

Examples of net.minecraft.src.Vec3

      }
      return new Coordinate(m.blockX, m.blockY, m.blockZ);
   }

   public MovingObjectPosition rayTrace(double distance, float partialTickTime) {
      Vec3 positionVec = getPositionVec(partialTickTime);
      Vec3 lookVec = player.getLook(partialTickTime);
      Vec3 hitVec = positionVec.addVector(lookVec.xCoord * distance, lookVec.yCoord * distance, lookVec.zCoord * distance);
      return player.worldObj.rayTraceBlocks_do_do(positionVec, hitVec, false, true); // TODO: Validate correct params
   }
View Full Code Here

Examples of net.minecraft.util.Vec3

    ItemWandCasting wand = (ItemWandCasting) itemstack.getItem();
    if (!ConfigHandler.enableFlight) {
      return itemstack;
    }
    if (wand.consumeAllVis(itemstack, p, getVisCost(), true, false)) {
      Vec3 vec = p.getLookVec();
      double force = 1 / 1.5 * (1 + EnchantmentHelper.getEnchantmentLevel(Config.enchPotency.effectId, wand.getFocusItem(itemstack)) * 0.2);
      p.motionX = vec.xCoord * force;
      p.motionY = vec.yCoord * force;
      p.motionZ = vec.zCoord * force;
      p.fallDistance = 0F;
View Full Code Here

Examples of net.minecraft.util.Vec3

  {
    if(densityDir > 0)
    {
      return;
    }
    Vec3 vec_flow = this.getFlowVector(world, x, y, z);
    vec.xCoord += vec_flow.xCoord * (quantaPerBlock * 4);
    vec.yCoord += vec_flow.yCoord * (quantaPerBlock * 4);
    vec.zCoord += vec_flow.zCoord * (quantaPerBlock * 4);
  }
 
View Full Code Here

Examples of net.minecraft.util.Vec3

    Block block = Block.blocksList[world.getBlockId(x, y, z)];
    if(!(Block.blocksList[world.getBlockId(x, y, z)] instanceof BlockFluidRoot))
    {
      return -1000.0;
    }
    Vec3 vec = ((BlockFluidRoot) block).getFlowVector(world, x, y, z);

    return vec.xCoord == 0.0D && vec.zCoord == 0.0D ? -1000.0D : Math.atan2(vec.zCoord, vec.xCoord) - Math.PI / 2D;
  }
View Full Code Here

Examples of net.minecraft.util.Vec3

  }

  public Vec3 getFlowVector(IBlockAccess world, int x, int y, int z)
  {

    Vec3 vec = world.getWorldVec3Pool().getVecFromPool(0.0D, 0.0D, 0.0D);
    int decay = quantaPerBlock - getQuantaValue(world, x, y, z);

    for(int side = 0; side < 4; ++side)
    {
      int x2 = x;
      int z2 = z;

      switch(side)
      {
      case 0:
        --x2;
        break;
      case 1:
        --z2;
        break;
      case 2:
        ++x2;
        break;
      case 3:
        ++z2;
        break;
      }

      int otherDecay = quantaPerBlock - getQuantaValue(world, x2, y, z2);
      if(otherDecay >= quantaPerBlock)
      {
        if(!world.getBlockMaterial(x2, y, z2).blocksMovement())
        {
          otherDecay = quantaPerBlock - getQuantaValue(world, x2, y - 1, z2);

          if(otherDecay >= 0)
          {
            int power = otherDecay - (decay - quantaPerBlock);
            vec = vec.addVector((x2 - x) * power, (y - y) * power, (z2 - z) * power);
          }
        }
      }
      else if(otherDecay >= 0)
      {
        int power = otherDecay - decay;
        vec = vec.addVector((x2 - x) * power, (y - y) * power, (z2 - z) * power);
      }
    }

    if(world.getBlockId(x, y + 1, z) == blockID)
    {
      boolean flag = false;

      if(this.isBlockSolid(world, x, y, z - 1, 2))
      {
        flag = true;
      }
      else if(this.isBlockSolid(world, x, y, z + 1, 3))
      {
        flag = true;
      }
      else if(this.isBlockSolid(world, x - 1, y, z, 4))
      {
        flag = true;
      }
      else if(this.isBlockSolid(world, x + 1, y, z, 5))
      {
        flag = true;
      }
      else if(this.isBlockSolid(world, x, y + 1, z - 1, 2))
      {
        flag = true;
      }
      else if(this.isBlockSolid(world, x, y + 1, z + 1, 3))
      {
        flag = true;
      }
      else if(this.isBlockSolid(world, x - 1, y + 1, z, 4))
      {
        flag = true;
      }
      else if(this.isBlockSolid(world, x + 1, y + 1, z, 5))
      {
        flag = true;
      }

      if(flag)
      {
        vec = vec.normalize().addVector(0.0D, -6.0D, 0.0D);
      }
    }
    vec = vec.normalize();
    return vec;
  }
View Full Code Here

Examples of net.minecraft.util.Vec3

    return y;
  }

  public static MovingObjectPosition getCurrentMovingObjectPosition(EntityPlayer player, double distance) {

    Vec3 posVec = Vec3.createVectorHelper(player.posX, player.posY, player.posZ);
    Vec3 lookVec = player.getLook(1);
    posVec.yCoord += player.getEyeHeight();
    lookVec = posVec.addVector(lookVec.xCoord * distance, lookVec.yCoord * distance, lookVec.zCoord * distance);
    return player.worldObj.rayTraceBlocks(posVec, lookVec);
  }
View Full Code Here

Examples of net.minecraft.util.Vec3

    }
    return null;
  }

  public static Vec3 getEyePosition(EntityPlayer player) {
    Vec3 v = Vec3.createVectorHelper(player.posX, player.posY, player.posZ);
    if(player.worldObj.isRemote) {
      //take into account any eye changes done by mods.
      v.yCoord += player.getEyeHeight() - player.getDefaultEyeHeight();
    } else {
      v.yCoord += player.getEyeHeight();
View Full Code Here

Examples of net.minecraft.util.Vec3

    }
    return res;
  }

  public static Vector3d getLookVecEio(EntityPlayer player) {
    Vec3 lv = player.getLookVec();
    return new Vector3d(lv.xCoord, lv.yCoord, lv.zCoord);
  }
View Full Code Here

Examples of net.minecraft.util.Vec3

            startVec.xCoord += d6 * d5;
            startVec.yCoord += d7 * d5;
            startVec.zCoord = d2;
          }

          Vec3 vec32 = Vec3.createVectorHelper(startVec.xCoord, startVec.yCoord, startVec.zCoord);
          l = (int) (vec32.xCoord = (double) MathHelper.floor_double(startVec.xCoord));
          if(b0 == 5) {
            --l;
            ++vec32.xCoord;
          }
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.