ModelZombie .java

net.minecraft.client.model.ModelZombie (class, 47 lines): extends ModelBiped. members: setRotationAngles. imports: MathHelper.

net.minecraft.client.modelclass47 linesclientextends ModelBiped2.1 KB

API Surface (1)

void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)

Code Graph: Dependencies (3)

Edges (calls / imports / inherits / references) resolved by graphify from the AST. Every chip opens the class source.

Full Source

ModelZombie.java47 lines · MCP 1.8.9 · verbatimOriginal ↗
1
package net.minecraft.client.model;
2
3
import net.minecraft.entity.Entity;
4
import net.minecraft.util.MathHelper;
5
6
public class ModelZombie extends ModelBiped
7
{
8
    public ModelZombie()
9
    {
10
        this(0.0F, false);
11
    }
12
13
    protected ModelZombie(float modelSize, float p_i1167_2_, int textureWidthIn, int textureHeightIn)
14
    {
15
        super(modelSize, p_i1167_2_, textureWidthIn, textureHeightIn);
16
    }
17
18
    public ModelZombie(float modelSize, boolean p_i1168_2_)
19
    {
20
        super(modelSize, 0.0F, 64, p_i1168_2_ ? 32 : 64);
21
    }
22
23
    /**
24
     * Sets the model's various rotation angles. For bipeds, par1 and par2 are used for animating the movement of arms
25
     * and legs, where par1 represents the time(so that arms and legs swing back and forth) and par2 represents how
26
     * "far" arms and legs can swing at most.
27
     */
28
    public void setRotationAngles(float limbSwing, float limbSwingAmount, float ageInTicks, float netHeadYaw, float headPitch, float scaleFactor, Entity entityIn)
29
    {
30
        super.setRotationAngles(limbSwing, limbSwingAmount, ageInTicks, netHeadYaw, headPitch, scaleFactor, entityIn);
31
        float f = MathHelper.sin(this.swingProgress * (float)Math.PI);
32
        float f1 = MathHelper.sin((1.0F - (1.0F - this.swingProgress) * (1.0F - this.swingProgress)) * (float)Math.PI);
33
        this.bipedRightArm.rotateAngleZ = 0.0F;
34
        this.bipedLeftArm.rotateAngleZ = 0.0F;
35
        this.bipedRightArm.rotateAngleY = -(0.1F - f * 0.6F);
36
        this.bipedLeftArm.rotateAngleY = 0.1F - f * 0.6F;
37
        this.bipedRightArm.rotateAngleX = -((float)Math.PI / 2F);
38
        this.bipedLeftArm.rotateAngleX = -((float)Math.PI / 2F);
39
        this.bipedRightArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
40
        this.bipedLeftArm.rotateAngleX -= f * 1.2F - f1 * 0.4F;
41
        this.bipedRightArm.rotateAngleZ += MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
42
        this.bipedLeftArm.rotateAngleZ -= MathHelper.cos(ageInTicks * 0.09F) * 0.05F + 0.05F;
43
        this.bipedRightArm.rotateAngleX += MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
44
        this.bipedLeftArm.rotateAngleX -= MathHelper.sin(ageInTicks * 0.067F) * 0.05F;
45
    }
46
}
47

Deobfuscated MCP 1.8.9 source of ModelZombie from Marcelektro/MavenMCP-1.8.9 (net/minecraft/client/model/ModelZombie.java), stored verbatim.