001package net.minecraft.client.model;
002
003import cpw.mods.fml.relauncher.Side;
004import cpw.mods.fml.relauncher.SideOnly;
005import net.minecraft.entity.Entity;
006import net.minecraft.util.MathHelper;
007
008@SideOnly(Side.CLIENT)
009public class ModelZombieVillager extends ModelBiped
010{
011    public ModelZombieVillager()
012    {
013        this(0.0F, 0.0F, false);
014    }
015
016    public ModelZombieVillager(float par1, float par2, boolean par3)
017    {
018        super(par1, 0.0F, 64, par3 ? 32 : 64);
019
020        if (par3)
021        {
022            this.bipedHead = new ModelRenderer(this, 0, 0);
023            this.bipedHead.addBox(-4.0F, -10.0F, -4.0F, 8, 6, 8, par1);
024            this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
025        }
026        else
027        {
028            this.bipedHead = new ModelRenderer(this);
029            this.bipedHead.setRotationPoint(0.0F, 0.0F + par2, 0.0F);
030            this.bipedHead.setTextureOffset(0, 32).addBox(-4.0F, -10.0F, -4.0F, 8, 10, 8, par1);
031            this.bipedHead.setTextureOffset(24, 32).addBox(-1.0F, -3.0F, -6.0F, 2, 4, 2, par1);
032        }
033    }
034
035    public int func_82897_a()
036    {
037        return 10;
038    }
039
040    /**
041     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
042     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
043     * "far" arms and legs can swing at most.
044     */
045    public void setRotationAngles(float par1, float par2, float par3, float par4, float par5, float par6, Entity par7Entity)
046    {
047        super.setRotationAngles(par1, par2, par3, par4, par5, par6, par7Entity);
048        float f6 = MathHelper.sin(this.onGround * (float)Math.PI);
049        float f7 = MathHelper.sin((1.0F - (1.0F - this.onGround) * (1.0F - this.onGround)) * (float)Math.PI);
050        this.bipedRightArm.rotateAngleZ = 0.0F;
051        this.bipedLeftArm.rotateAngleZ = 0.0F;
052        this.bipedRightArm.rotateAngleY = -(0.1F - f6 * 0.6F);
053        this.bipedLeftArm.rotateAngleY = 0.1F - f6 * 0.6F;
054        this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F);
055        this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F);
056        this.bipedRightArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
057        this.bipedLeftArm.rotateAngleX -= f6 * 1.2F - f7 * 0.4F;
058        this.bipedRightArm.rotateAngleZ += MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
059        this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(par3 * 0.09F) * 0.05F + 0.05F;
060        this.bipedRightArm.rotateAngleX += MathHelper.sin(par3 * 0.067F) * 0.05F;
061        this.bipedLeftArm.rotateAngleX -= MathHelper.sin(par3 * 0.067F) * 0.05F;
062    }
063}