the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 42 lines 1.4 kB view raw
1#include "stdafx.h" 2#include "SquidRenderer.h" 3#include "..\Minecraft.World\net.minecraft.world.entity.animal.h" 4 5ResourceLocation SquidRenderer::SQUID_LOCATION = ResourceLocation(TN_MOB_SQUID); 6 7SquidRenderer::SquidRenderer(Model *model, float shadow) : MobRenderer(model, shadow) 8{ 9} 10 11void SquidRenderer::render(shared_ptr<Entity> mob, double x, double y, double z, float rot, float a) 12{ 13 MobRenderer::render(mob, x, y, z, rot, a); 14} 15 16void SquidRenderer::setupRotations(shared_ptr<LivingEntity> _mob, float bob, float bodyRot, float a) 17{ 18 // 4J - dynamic cast required because we aren't using templates/generics in our version 19 shared_ptr<Squid> mob = dynamic_pointer_cast<Squid>(_mob); 20 21 float bodyXRot = (mob->xBodyRotO + (mob->xBodyRot - mob->xBodyRotO) * a); 22 float bodyZRot = (mob->zBodyRotO + (mob->zBodyRot - mob->zBodyRotO) * a); 23 24 glTranslatef(0, 0.5f, 0); 25 glRotatef(180 - bodyRot, 0, 1, 0); 26 glRotatef(bodyXRot, 1, 0, 0); 27 glRotatef(bodyZRot, 0, 1, 0); 28 glTranslatef(0, -1.2f, 0); 29} 30 31float SquidRenderer::getBob(shared_ptr<LivingEntity> _mob, float a) 32{ 33 // 4J - dynamic cast required because we aren't using templates/generics in our version 34 shared_ptr<Squid> mob = dynamic_pointer_cast<Squid>(_mob); 35 36 return mob->oldTentacleAngle + (mob->tentacleAngle - mob->oldTentacleAngle) * a; 37} 38 39ResourceLocation *SquidRenderer::getTextureLocation(shared_ptr<Entity> mob) 40{ 41 return &SQUID_LOCATION; 42}