the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
1#include "stdafx.h"
2#include "ModelPart.h"
3#include "VillagerZombieModel.h"
4#include "..\Minecraft.World\Mth.h"
5
6void VillagerZombieModel::_init(float g, float yOffset, bool isArmor)
7{
8 delete head;
9 if (isArmor)
10 {
11 head = new ModelPart(this, 0, 0);
12 head->addBox(-4, -10, -4, 8, 6, 8, g); // Head
13 head->setPos(0, 0 + yOffset, 0);
14 }
15 else
16 {
17 head = new ModelPart(this);
18 head->setPos(0, 0 + yOffset, 0);
19 head->texOffs(0, 32)->addBox(-4, -10, -4, 8, 10, 8, g);
20 head->texOffs(24, 32)->addBox(-1, -3, -6, 2, 4, 2, g);
21 }
22
23
24 // 4J added - compile now to avoid random performance hit first time cubes are rendered
25 head->compile(1.0f/16.0f);
26}
27
28VillagerZombieModel::VillagerZombieModel() : HumanoidModel(0, 0, 64, 64)
29{
30 _init(0, 0, false);
31}
32
33VillagerZombieModel::VillagerZombieModel(float g, float yOffset, bool isArmor) : HumanoidModel(g, 0, 64, isArmor ? 32 : 64)
34{
35 _init(g, yOffset, isArmor);
36}
37
38int VillagerZombieModel::version()
39{
40 return 10;
41}
42
43void VillagerZombieModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim)
44{
45 HumanoidModel::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim);
46
47 float attack2 = Mth::sin(attackTime * PI);
48 float attack = Mth::sin((1 - (1 - attackTime) * (1 - attackTime)) * PI);
49 arm0->zRot = 0;
50 arm1->zRot = 0;
51 arm0->yRot = -(0.1f - attack2 * 0.6f);
52 arm1->yRot = +(0.1f - attack2 * 0.6f);
53 arm0->xRot = -PI / 2.0f;
54 arm1->xRot = -PI / 2.0f;
55 arm0->xRot -= attack2 * 1.2f - attack * 0.4f;
56 arm1->xRot -= attack2 * 1.2f - attack * 0.4f;
57
58 arm0->zRot += (Mth::cos(bob * 0.09f) * 0.05f + 0.05f);
59 arm1->zRot -= (Mth::cos(bob * 0.09f) * 0.05f + 0.05f);
60 arm0->xRot += (Mth::sin(bob * 0.067f) * 0.05f);
61 arm1->xRot -= (Mth::sin(bob * 0.067f) * 0.05f);
62}