Package net.minecraft.util

Examples of net.minecraft.util.Vec3


          tessellator.setNormal(normals[0], normals[1], normals[2]);
        }
      } else
      if(vertexPositions.length >= 3)
      {
        Vec3 Vec3 = vertexPositions[1].vector3D.subtract(vertexPositions[0].vector3D);
        Vec3 Vec31 = vertexPositions[1].vector3D.subtract(vertexPositions[2].vector3D);
        Vec3 Vec32 = Vec31.crossProduct(Vec3).normalize();
   
        if(invertNormal)
        {
          tessellator.setNormal(-(float)Vec32.xCoord, -(float)Vec32.yCoord, -(float)Vec32.zCoord);
        } else
View Full Code Here


        float cosYaw = MathHelper.cos(-entityplayer.rotationYaw * 0.01745329F - 3.141593F);
        float sinYaw = MathHelper.sin(-entityplayer.rotationYaw * 0.01745329F - 3.141593F);
        float cosPitch = -MathHelper.cos(-entityplayer.rotationPitch * 0.01745329F);
        float sinPitch = MathHelper.sin(-entityplayer.rotationPitch * 0.01745329F);
        double length = 5D;
        Vec3 posVec = Vec3.createVectorHelper(entityplayer.posX, entityplayer.posY + 1.62D - entityplayer.yOffset, entityplayer.posZ);       
        Vec3 lookVec = posVec.addVector(sinYaw * cosPitch * length, sinPitch * length, cosYaw * cosPitch * length);
        MovingObjectPosition movingobjectposition = world.rayTraceBlocks(posVec, lookVec, type.placeableOnWater);
       
        //Result check
        if(movingobjectposition == null)
        {
View Full Code Here

        int k = MathHelper.floor_double(explosionY - explosionSize - 1.0D);
        int l1 = MathHelper.floor_double(explosionY + explosionSize + 1.0D);
        int i2 = MathHelper.floor_double(explosionZ - explosionSize - 1.0D);
        int j2 = MathHelper.floor_double(explosionZ + explosionSize + 1.0D);
        List list = worldObj.getEntitiesWithinAABBExcludingEntity(exploder, AxisAlignedBB.getBoundingBox(i, k, i2, j, l1, j2));
        Vec3 vec3 = Vec3.createVectorHelper(explosionX, explosionY, explosionZ);

        for (int k2 = 0; k2 < list.size(); ++k2)
        {
            Entity entity = (Entity)list.get(k2);
            double d7 = entity.getDistance(explosionX, explosionY, explosionZ) / explosionSize;
View Full Code Here

      return;
   
    //On the first spawn, we don't kill the player, we simply move them over, so do a /tp like command
    if(firstSpawn)
    {
      Vec3 spawnPoint = currentRound.gametype.getSpawnPoint(playerMP);
      if(spawnPoint != null)
      {
        player.setPositionAndUpdate(spawnPoint.xCoord, spawnPoint.yCoord, spawnPoint.zCoord);
      }
    }
View Full Code Here

    if(!enabled || currentRound == null)
      return;
   
    PlayerData data = PlayerHandler.getPlayerData(player);

    Vec3 spawnPoint = currentRound.gametype.getSpawnPoint(player);
    if(spawnPoint != null)
      setPlayersNextSpawnpoint(player, new ChunkCoordinates(MathHelper.floor_double(spawnPoint.xCoord), MathHelper.floor_double(spawnPoint.yCoord) + 1, MathHelper.floor_double(spawnPoint.zCoord)));
    else
      FlansMod.log("Could not find spawn point for " + player.getDisplayName() + " on team " + (data.newTeam == null ? "null" : data.newTeam.name));
  }
View Full Code Here

        float f1 = entityplayer.prevRotationPitch + (entityplayer.rotationPitch - entityplayer.prevRotationPitch) * f;
        float f2 = entityplayer.prevRotationYaw + (entityplayer.rotationYaw - entityplayer.prevRotationYaw) * f;
        double d = entityplayer.prevPosX + (entityplayer.posX - entityplayer.prevPosX) * f;
        double d1 = (entityplayer.prevPosY + (entityplayer.posY - entityplayer.prevPosY) * f + 1.6200000000000001D) - entityplayer.yOffset;
        double d2 = entityplayer.prevPosZ + (entityplayer.posZ - entityplayer.prevPosZ) * f;
        Vec3 vec3d = Vec3.createVectorHelper(d, d1, d2);
        float f3 = MathHelper.cos(-f2 * 0.01745329F - 3.141593F);
        float f4 = MathHelper.sin(-f2 * 0.01745329F - 3.141593F);
        float f5 = -MathHelper.cos(-f1 * 0.01745329F);
        float f6 = MathHelper.sin(-f1 * 0.01745329F);
        float f7 = f4 * f5;
        float f8 = f6;
        float f9 = f3 * f5;
        double d3 = 5D;
        Vec3 vec3d1 = vec3d.addVector(f7 * d3, f8 * d3, f9 * d3);
        MovingObjectPosition movingobjectposition = world.rayTraceBlocks(vec3d, vec3d1, true);
        if(movingobjectposition == null)
        {
            return itemstack;
        }
View Full Code Here

    setPosition(driveable.posX + relativePosition.x, driveable.posY + relativePosition.y, driveable.posZ + relativePosition.z);
   
    if(riddenByEntity != null)
    {
        DriveableType type = driveable.getDriveableType();
      Vec3 yOffset = driveable.rotate(0, riddenByEntity.getYOffset(), 0).toVec3();
     
      playerPosX = posX + yOffset.xCoord;
      playerPosY = posY + yOffset.yCoord;
      playerPosZ = posZ + yOffset.zCoord;
     
View Full Code Here

          float cosYaw = MathHelper.cos(-entityplayer.rotationYaw * 0.01745329F - 3.141593F);
          float sinYaw = MathHelper.sin(-entityplayer.rotationYaw * 0.01745329F - 3.141593F);
          float cosPitch = -MathHelper.cos(-entityplayer.rotationPitch * 0.01745329F);
          float sinPitch = MathHelper.sin(-entityplayer.rotationPitch * 0.01745329F);
          double length = 5D;
          Vec3 posVec = Vec3.createVectorHelper(entityplayer.posX, entityplayer.posY + 1.62D - entityplayer.yOffset, entityplayer.posZ);       
          Vec3 lookVec = posVec.addVector(sinYaw * cosPitch * length, sinPitch * length, cosYaw * cosPitch * length);
          MovingObjectPosition look = world.rayTraceBlocks(posVec, lookVec, true);
         
          //Result check
      if (look != null && look.typeOfHit == MovingObjectType.BLOCK)
      {
View Full Code Here

        }
      }
    }
   
    //Ray trace the bullet by comparing its next position to its current position
    Vec3 posVec = Vec3.createVectorHelper(posX, posY, posZ);
    Vec3 nextPosVec = Vec3.createVectorHelper(posX + motionX, posY + motionY, posZ + motionZ);
    MovingObjectPosition hit = worldObj.func_147447_a(posVec, nextPosVec, false, true, true);
   
    posVec = Vec3.createVectorHelper(posX, posY, posZ);
   
    if(hit != null)
    {
      //Calculate the lambda value of the intercept
      Vec3 hitVec = posVec.subtract(hit.hitVec);
      float lambda = 1;
      //Try each co-ordinate one at a time.
      if(motionX != 0)
        lambda = (float)(hitVec.xCoord / motionX);
      else if(motionY != 0)
View Full Code Here

          float cosYaw = MathHelper.cos(-entityplayer.rotationYaw * 0.01745329F);
          float sinYaw = MathHelper.sin(-entityplayer.rotationYaw * 0.01745329F);
          float cosPitch = -MathHelper.cos(entityplayer.rotationPitch * 0.01745329F);
          float sinPitch = MathHelper.sin(entityplayer.rotationPitch * 0.01745329F);
          double length = -5D;
          Vec3 posVec = Vec3.createVectorHelper(entityplayer.posX, entityplayer.posY + 1.62D - entityplayer.yOffset, entityplayer.posZ);       
          Vec3 lookVec = posVec.addVector(sinYaw * cosPitch * length, sinPitch * length, cosYaw * cosPitch * length);
         
          if(world.isRemote && FlansMod.DEBUG)
          {
            world.spawnEntityInWorld(new EntityDebugVector(world, new Vector3f(posVec), new Vector3f(posVec.subtract(lookVec)), 100));
          }
View Full Code Here

TOP

Related Classes of net.minecraft.util.Vec3

Copyright © 2018 www.massapicom. 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.