Files
MinecraftConsoles/Minecraft.Client/SkeletonHeadModel.cpp
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

43 lines
1.3 KiB
C++

#include "stdafx.h"
#include "ModelPart.h"
#include "SkeletonHeadModel.h"
void SkeletonHeadModel::_init(int u, int v, int tw, int th)
{
texWidth = tw;
texHeight = th;
head = new ModelPart(this, u, v);
// 4J Stu - Set "g" param to 0.1 to fix z-fighting issues (hair has this set to 0.5, so need to be less that that)
// Fix for #101501 - TU12: Content: Art: Z-Fighting occurs on the bottom side of a character's head when a Mob Head is equipped.
head->addBox(-4, -8, -4, 8, 8, 8, 0.1); // Head
head->setPos(0, 0, 0);
// 4J added - compile now to avoid random performance hit first time cubes are rendered
head->compile(1.0f/16.0f);
}
SkeletonHeadModel::SkeletonHeadModel()
{
_init(0, 35, 64, 64);
}
SkeletonHeadModel::SkeletonHeadModel(int u, int v, int tw, int th)
{
_init(u,v,tw,th);
}
void SkeletonHeadModel::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);
}
void SkeletonHeadModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim)
{
Model::setupAnim(time, r, bob, yRot, xRot, scale, entity, uiBitmaskOverrideAnim);
head->yRot = yRot / (180 / PI);
head->xRot = xRot / (180 / PI);
}