Files
daoge b3feddfef3 feat: TU19 (Dec 2014) Features & Content (#155)
* try to resolve merge conflict

* feat: TU19 (Dec 2014) Features & Content (#32)

* December 2014 files

* Working release build

* Fix compilation issues

* Add sound to Windows64Media

* Add DLC content and force Tutorial DLC

* Revert "Add DLC content and force Tutorial DLC"

This reverts commit 97a4399472.

* Disable broken light packing

* Disable breakpoint during DLC texture map load

Allows DLC loading but the DLC textures are still broken

* Fix post build not working

* ...

* fix vs2022 build

* fix cmake build

---------

Co-authored-by: Loki <lokirautio@gmail.com>
2026-03-03 03:04:10 +08:00

76 lines
2.2 KiB
C++

#include "stdafx.h"
#include "..\Minecraft.World\Mth.h"
#include "BlazeModel.h"
#include "ModelPart.h"
BlazeModel::BlazeModel() : Model()
{
upperBodyParts = ModelPartArray(12);
for (unsigned int i = 0; i < upperBodyParts.length; i++)
{
upperBodyParts[i] = new ModelPart(this, 0, 16);
upperBodyParts[i]->addBox(0, 0, 0, 2, 8, 2);
}
head = new ModelPart(this, 0, 0);
head->addBox(-4, -4, -4, 8, 8, 8);
// 4J added - compile now to avoid random performance hit first time cubes are rendered
// 4J Stu - Not just performance, but alpha+depth tests don't work right unless we compile here
for (unsigned int i = 0; i < upperBodyParts.length; i++)
{
upperBodyParts[i]->compile(1.0f/16.0f);
}
head->compile(1.0f/16.0f);
}
int BlazeModel::modelVersion()
{
return 8;
}
void BlazeModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
{
setupAnim(time, r, bob, yRot, xRot, scale, entity);
head->render(scale, usecompiled);
for (unsigned int i = 0; i < upperBodyParts.length; i++)
{
upperBodyParts[i]->render(scale, usecompiled);
}
}
void BlazeModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim)
{
float angle = bob * PI * -.1f;
for (int i = 0; i < 4; i++)
{
upperBodyParts[i]->y = -2 + Mth::cos((i * 2 + bob) * .25f);
upperBodyParts[i]->x = Mth::cos(angle) * 9.0f;
upperBodyParts[i]->z = Mth::sin(angle) * 9.0f;
angle += PI * 0.5f;
}
angle = .25f * PI + bob * PI * .03f;
for (int i = 4; i < 8; i++)
{
upperBodyParts[i]->y = 2 + Mth::cos((i * 2 + bob) * .25f);
upperBodyParts[i]->x = Mth::cos(angle) * 7.0f;
upperBodyParts[i]->z = Mth::sin(angle) * 7.0f;
angle += PI * 0.5f;
}
angle = .15f * PI + bob * PI * -.05f;
for (int i = 8; i < 12; i++)
{
upperBodyParts[i]->y = 11 + Mth::cos((i * 1.5f + bob) * .5f);
upperBodyParts[i]->x = Mth::cos(angle) * 5.0f;
upperBodyParts[i]->z = Mth::sin(angle) * 5.0f;
angle += PI * 0.5f;
}
head->yRot = yRot / (float) (180 / PI);
head->xRot = xRot / (float) (180 / PI);
}