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 "SlimeModel.h"
3#include "ModelPart.h"
4
5SlimeModel::SlimeModel(int vOffs)
6{
7 cube = new ModelPart(this, 0, vOffs);
8 cube->addBox(-4, 16, -4, 8, 8, 8);
9 if (vOffs > 0)
10 {
11 cube = new ModelPart(this, 0, vOffs);
12 cube->addBox(-3, 16+1, -3, 6, 6, 6);
13
14 eye0 = new ModelPart(this, 32, 0);
15 eye0->addBox(-3-0.25f, 16+2, -3.5f, 2, 2, 2);
16
17 eye1 = new ModelPart(this, 32, 4);
18 eye1->addBox(+1+0.25f, 16+2, -3.5f, 2, 2, 2);
19
20 mouth = new ModelPart(this, 32, 8);
21 mouth->addBox(0, 16+5, -3.5f, 1, 1, 1);
22
23 // 4J added - compile now to avoid random performance hit first time cubes are rendered
24 eye0->compile(1.0f/16.0f);
25 eye1->compile(1.0f/16.0f);
26 mouth->compile(1.0f/16.0f);
27 }
28 else
29 {
30 eye0 = NULL;
31 eye1 = NULL;
32 mouth = NULL;
33 }
34 cube->compile(1.0f/16.0f);
35}
36
37void SlimeModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
38{
39 setupAnim(time, r, bob, yRot, xRot, scale, entity);
40
41 cube->render(scale,usecompiled);
42 if (eye0!=NULL)
43 {
44 eye0->render(scale,usecompiled);
45 eye1->render(scale,usecompiled);
46 mouth->render(scale,usecompiled);
47 }
48}