the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 73 lines 2.2 kB view raw
1#include "stdafx.h" 2#include "ModelPart.h" 3#include "WitchModel.h" 4#include "VillagerModel.h" 5#include "../Minecraft.World/Mth.h" 6 7WitchModel::WitchModel(float g) : VillagerModel(g, 0, 64, 128) 8{ 9 mole = (new ModelPart(this))->setTexSize(64, 128); 10 mole->setPos(0, -2, 0); 11 mole->texOffs(0, 0)->addBox(0, 3, -6.75f, 1, 1, 1, -0.25f); 12 nose->addChild(mole); 13 14 hat = (new ModelPart(this))->setTexSize(64, 128); 15 hat->setPos(-5, -10 - (0.5f / 16.f), -5); 16 hat->texOffs(0, 64)->addBox(0, 0, 0, 10, 2, 10); 17 head->addChild(hat); 18 19 ModelPart *hat2 = new ModelPart(this); 20 hat2->setTexSize(64, 128); 21 hat2->setPos(1.75f, -4, 2.f); 22 hat2->texOffs(0, 76)->addBox(0, 0, 0, 7, 4, 7); 23 hat2->xRot = -3.f * Mth::RAD_TO_GRAD; 24 hat2->zRot = 1.5f * Mth::RAD_TO_GRAD; 25 hat->addChild(hat2); 26 27 ModelPart *hat3 = new ModelPart(this); 28 hat3->setTexSize(64, 128); 29 hat3->setPos(1.75f, -4, 2.f); 30 hat3->texOffs(0, 87)->addBox(0, 0, 0, 4, 4, 4); 31 hat3->xRot = -6.f * Mth::RAD_TO_GRAD; 32 hat3->zRot = 3.f * Mth::RAD_TO_GRAD; 33 hat2->addChild(hat3); 34 35 ModelPart *hat4 = new ModelPart(this); 36 hat4->setTexSize(64, 128); 37 hat4->setPos(1.75f, -2, 2.f); 38 hat4->texOffs(0, 95)->addBox(0, 0, 0, 1, 2, 1, 0.25f); 39 hat4->xRot = -12.f * Mth::RAD_TO_GRAD; 40 hat4->zRot = 6.f * Mth::RAD_TO_GRAD; 41 hat3->addChild(hat4); 42 43 // 4J added - compile now to avoid random performance hit first time cubes are rendered 44 mole->compile(1.0f/16.0f); 45 hat->compile(1.0f/16.0f); 46 hat2->compile(1.0f/16.0f); 47 hat3->compile(1.0f/16.0f); 48 hat4->compile(1.0f/16.0f); 49} 50 51void WitchModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim) 52{ 53 VillagerModel::setupAnim(time, r, bob, yRot, xRot, scale, entity); 54 55 nose->translateX = nose->translateY = nose->translateZ = 0; 56 57 float speed = 0.01f * (entity->entityId % 10); 58 nose->xRot = (sin(entity->tickCount * speed) * 4.5f) * PI / 180; 59 nose->yRot = 0; 60 nose->zRot = (cos(entity->tickCount * speed) * 2.5f) * PI / 180; 61 62 if (holdingItem) 63 { 64 nose->xRot = -0.9f; 65 nose->translateZ = -1.5f / 16.f; 66 nose->translateY = 3 / 16.f; 67 } 68} 69 70int WitchModel::getModelVersion() 71{ 72 return 0; 73}