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 "EnderCrystalModel.h"
3
4
5
6EnderCrystalModel::EnderCrystalModel(float g)
7{
8 glass = new ModelPart(this, L"glass");
9 glass->texOffs(0, 0)->addBox(-4, -4, -4, 8, 8, 8);
10
11 cube = new ModelPart(this, L"cube");
12 cube->texOffs(32, 0)->addBox(-4, -4, -4, 8, 8, 8);
13
14 base = new ModelPart(this, L"base");
15 base->texOffs(0, 16)->addBox(-6, 0, -6, 12, 4, 12);
16
17 // 4J added - compile now to avoid random performance hit first time cubes are rendered
18 glass->compile(1.0f/16.0f);
19 cube->compile(1.0f/16.0f);
20 base->compile(1.0f/16.0f);
21}
22
23
24void EnderCrystalModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
25{
26 glPushMatrix();
27 glScalef(2, 2, 2);
28 glTranslatef(0, -0.5f, 0);
29 base->render(scale,usecompiled);
30 glRotatef(r, 0, 1, 0);
31 glTranslatef(0, 0.8f + bob, 0);
32 glRotatef(60, 0.7071f, 0, 0.7071f);
33 glass->render(scale,usecompiled);
34 float ss = 14 / 16.0f;
35 glScalef(ss, ss, ss);
36 glRotatef(60, 0.7071f, 0, 0.7071f);
37 glRotatef(r, 0, 1, 0);
38 glass->render(scale,usecompiled);
39 glScalef(ss, ss, ss);
40 glRotatef(60, 0.7071f, 0, 0.7071f);
41 glRotatef(r, 0, 1, 0);
42 cube->render(scale,usecompiled);
43 glPopMatrix();
44}