Package net.minecraft.util

Examples of net.minecraft.util.Vec3.normalize()


    private void calculateVector() {
        Vec3 endPoint = Vec3.createVectorHelper(source.getX(), source.getY(), source.getZ());
        Vec3 vecParticle = Vec3.createVectorHelper(posX, posY, posZ);

        Vec3 vel = vecParticle.subtract(endPoint);
        vel = vel.normalize();

        float velScale = 0.1f;
        this.motionX = vel.xCoord * velScale;
        this.motionY = vel.yCoord * velScale;
        this.motionZ = vel.zCoord * velScale;
 
View Full Code Here


    private void calculateVector() {
        Vec3 endPoint = Vec3.createVectorHelper(source.getX(), source.getY(), source.getZ());
        Vec3 vecParticle = Vec3.createVectorHelper(posX, posY, posZ);

        Vec3 vel = vecParticle.subtract(endPoint);
        vel = vel.normalize();

        float velScale = 0.04f;
        this.motionX = vel.xCoord * velScale;
        this.motionY = vel.yCoord * velScale;
        this.motionZ = vel.zCoord * velScale;
 
View Full Code Here

    private void calculateVector() {
        Vec3 endPoint = Vec3.createVectorHelper(source.getX(), source.getY(), source.getZ());
        Vec3 vecParticle = Vec3.createVectorHelper(posX, posY, posZ);

        Vec3 vel = vecParticle.subtract(endPoint);
        vel = vel.normalize();

        float velScale = 0.1f;
        this.motionX = vel.xCoord * velScale;
        this.motionY = vel.yCoord * velScale;
        this.motionZ = vel.zCoord * velScale;
 
View Full Code Here

            float f8 = f3 * f5;
            double d3 = 32.0D;

            Vec3 vec31 = vec3.addVector( f7 * d3, f6 * d3, f8 * d3 );
            Vec3 direction = Vec3.createVectorHelper( f7 * d3, f6 * d3, f8 * d3 );
            direction.normalize();

            float penetration = AEApi.instance().registries().matterCannon().getPenetration( ammo ); // 196.96655f;
            if ( penetration <= 0 )
            {
              ItemStack type = ((IAEItemStack) aeAmmo).getItemStack();
View Full Code Here

  private void setSteamDirection(int x, int y, int z) {
    if (!worldObj.isRemote) {
      RPCHandler.rpcBroadcastAllPlayers(this, "setSteamDirection", x, y, z);
    } else {
      Vec3 v = Vec3.createVectorHelper(x, y, z);
      v.normalize();

      steamDx = (int) v.xCoord;
      steamDy = (int) v.yCoord;
      steamDz = (int) v.zCoord;
    }
View Full Code Here

    private boolean isPlayerLookingAtTarget(){
        Vec3 vec3 = player.getLook(1.0F).normalize();
        Vec3 vec31 = Vec3.createVectorHelper(blockX + 0.5D - player.posX, blockY + 0.5D - player.posY + player.getEyeHeight(), blockZ + 0.5D - player.posZ);
        double d0 = vec31.lengthVector();
        vec31 = vec31.normalize();
        double d1 = vec3.dotProduct(vec31);
        return d1 > 1.0D - 0.025D / d0;
    }

    public void hack(){
View Full Code Here

    private boolean isEntityWithinPlayerFOV(EntityPlayer player, Entity entity){
        // code used from the Enderman player looking code.
        Vec3 vec3 = player.getLook(1.0F).normalize();
        Vec3 vec31 = Vec3.createVectorHelper(entity.posX - player.posX, entity.boundingBox.minY + entity.height / 2.0F - (player.posY + player.getEyeHeight()), entity.posZ - player.posZ);
        double d0 = vec31.lengthVector();
        vec31 = vec31.normalize();
        double d1 = vec3.dotProduct(vec31);
        return d1 > 1.0D - 2.5D / d0;
        // return d1 > 1.0D - 0.025D / d0;
    }
View Full Code Here

        EntityPlayer player = FMLClientHandler.instance().getClient().thePlayer;
        World world = FMLClientHandler.instance().getClient().theWorld;
        Vec3 vec3 = player.getLook(1.0F).normalize();
        Vec3 vec31 = Vec3.createVectorHelper(entity.posX - player.posX, entity.boundingBox.minY + entity.height / 2.0F - (player.posY + player.getEyeHeight()), entity.posZ - player.posZ);
        double d0 = vec31.lengthVector();
        vec31 = vec31.normalize();
        double d1 = vec3.dotProduct(vec31);
        return d1 > 1.0D - 0.050D / d0;
    }

    public void hack(){
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.