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 "SkeletonHeadModel.h"
4
5void SkeletonHeadModel::_init(int u, int v, int tw, int th)
6{
7 texWidth = tw;
8 texHeight = th;
9 head = new ModelPart(this, u, v);
10
11 // 4J Stu - Set "g" param to 0.1 to fix z-fighting issues (hair has this set to 0.5, so need to be less that that)
12 // Fix for #101501 - TU12: Content: Art: Z-Fighting occurs on the bottom side of a character's head when a Mob Head is equipped.
13 head->addBox(-4, -8, -4, 8, 8, 8, 0.1); // Head
14 head->setPos(0, 0, 0);
15
16 // 4J added - compile now to avoid random performance hit first time cubes are rendered
17 head->compile(1.0f/16.0f);
18}
19
20SkeletonHeadModel::SkeletonHeadModel()
21{
22 _init(0, 35, 64, 64);
23}
24
25SkeletonHeadModel::SkeletonHeadModel(int u, int v, int tw, int th)
26{
27 _init(u,v,tw,th);
28}
29
30void SkeletonHeadModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
31{
32 setupAnim(time, r, bob, yRot, xRot, scale, entity);
33
34 head->render(scale,usecompiled);
35}
36
37void SkeletonHeadModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim)
38{
39 Model::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim);
40
41 head->yRot = yRot / (180 / PI);
42 head->xRot = xRot / (180 / PI);
43}