the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 65 lines 1.5 kB view raw
1#include "stdafx.h" 2#include "SkiModel.h" 3 4SkiModel::SkiModel() 5{ 6 _init(false); 7} 8 9SkiModel::SkiModel(bool leftSki) 10{ 11 _init(leftSki); 12} 13 14void SkiModel::_init(bool leftSki) 15{ 16 this->leftSki = leftSki; 17 texWidth = 32; 18 texHeight = 64; 19 int xOffTex = 0; 20 if (!leftSki) { 21 xOffTex = 14; 22 } 23 24 cubes = ModelPartArray(2); 25 cubes[0] = new ModelPart(this, xOffTex, 0); 26 cubes[1] = new ModelPart(this, xOffTex, 5); 27 28 cubes[0]->addBox(0.f, 0.f, 0.f, 3, 1, 4, 0); 29 cubes[0]->setPos(0, 0, 0); 30 31 cubes[1]->addBox(0.f, 0.f, 0.f, 3, 52, 1, 0); 32 cubes[1]->setPos(0, 0, 0); 33} 34 35void SkiModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled) 36{ 37 for (int i = 0; i < cubes.length; i++) 38 { 39 cubes[i]->render(scale, usecompiled); 40 } 41} 42 43void SkiModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity) 44{ 45 cubes[0]->y = 24.2f; 46 cubes[0]->xRot = PI * .5f; 47 48 cubes[1]->y = 24.2f; 49 cubes[1]->xRot = PI * .5f; 50 51 if (leftSki) 52 { 53 cubes[0]->z = -26 - 12 * (cos(time * 0.6662f) * 0.7f) * r; 54 cubes[1]->z = -26 - 12 * (cos(time * 0.6662f) * 0.7f) * r; 55 cubes[0]->x = .5f; 56 cubes[1]->x = .5f; 57 } 58 else 59 { 60 cubes[0]->z = -26 + 12 * (cos(time * 0.6662f) * 0.7f) * r; 61 cubes[1]->z = -26 + 12 * (cos(time * 0.6662f) * 0.7f) * r; 62 cubes[0]->x = -3.5f; 63 cubes[1]->x = -3.5f; 64 } 65}