aboutsummaryrefslogtreecommitdiff
path: root/Minecraft.Client/HumanoidModel.cpp
diff options
context:
space:
mode:
authordaoge <3523206925@qq.com>2026-03-03 03:04:10 +0800
committerGitHub <noreply@github.com>2026-03-03 03:04:10 +0800
commitb3feddfef372618c8a9d7a0abcaf18cfad866c18 (patch)
tree267761c3bb39241ba5c347bfbe2254d06686e287 /Minecraft.Client/HumanoidModel.cpp
parent84c31a2331f7a0ec85b9d438992e244f60e5020f (diff)
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 97a43994725008e35fceb984d5549df9c8cea470. * 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>
Diffstat (limited to 'Minecraft.Client/HumanoidModel.cpp')
-rw-r--r--Minecraft.Client/HumanoidModel.cpp84
1 files changed, 59 insertions, 25 deletions
diff --git a/Minecraft.Client/HumanoidModel.cpp b/Minecraft.Client/HumanoidModel.cpp
index 444d9c90..05d132fa 100644
--- a/Minecraft.Client/HumanoidModel.cpp
+++ b/Minecraft.Client/HumanoidModel.cpp
@@ -142,12 +142,12 @@ HumanoidModel::HumanoidModel(float g, float yOffset, int texWidth, int texHeight
void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled)
{
- if(entity!=NULL)
+ if(entity != NULL)
{
m_uiAnimOverrideBitmask=entity->getAnimOverrideBitmask();
}
- setupAnim(time, r, bob, yRot, xRot, scale, m_uiAnimOverrideBitmask);
+ setupAnim(time, r, bob, yRot, xRot, scale, entity, m_uiAnimOverrideBitmask);
if (young)
{
@@ -180,7 +180,7 @@ void HumanoidModel::render(shared_ptr<Entity> entity, float time, float r, float
}
}
-void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, unsigned int uiBitmaskOverrideAnim)
+void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim)
{
//bool bIsAttacking = (attackTime > -9990.0f);
@@ -189,6 +189,7 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
head->xRot = xRot / (float) (180.0f / PI);
hair->yRot = head->yRot;
hair->xRot = head->xRot;
+ body->z = 0.0f;
// Does the skin have an override for anim?
@@ -240,12 +241,22 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
if (riding)
{
- arm0->xRot += -HALF_PI * 0.4f;
- arm1->xRot += -HALF_PI * 0.4f;
- leg0->xRot = -HALF_PI * 0.8f;
- leg1->xRot = -HALF_PI * 0.8f;
- leg0->yRot = HALF_PI * 0.2f;
- leg1->yRot = -HALF_PI * 0.2f;
+ if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel) == 0)
+ {
+ arm0->xRot += -HALF_PI * 0.4f;
+ arm1->xRot += -HALF_PI * 0.4f;
+ leg0->xRot = -HALF_PI * 0.8f;
+ leg1->xRot = -HALF_PI * 0.8f;
+ leg0->yRot = HALF_PI * 0.2f;
+ leg1->yRot = -HALF_PI * 0.2f;
+ }
+ else
+ {
+ arm0->xRot += -HALF_PI * 0.4f;
+ arm1->xRot += -HALF_PI * 0.4f;
+ leg0->xRot = -HALF_PI * 0.4f;
+ leg1->xRot = -HALF_PI * 0.4f;
+ }
}
else if(idle && !sneaking )
{
@@ -334,22 +345,45 @@ void HumanoidModel::setupAnim(float time, float r, float bob, float yRot, float
if (sneaking)
{
- body->xRot = 0.5f;
- leg0->xRot -= 0.0f;
- leg1->xRot -= 0.0f;
- arm0->xRot += 0.4f;
- arm1->xRot += 0.4f;
- leg0->z = +4.0f;
- leg1->z = +4.0f;
- body->y = 0.0f;
- arm0->y = 2.0f;
- arm1->y = 2.0f;
- leg0->y = +9.0f;
- leg1->y = +9.0f;
- head->y = +1.0f;
- hair->y = +1.0f;
- ear->y = +1.0f;
- cloak->y = 0.0f;
+ if(uiBitmaskOverrideAnim&(1<<eAnim_SmallModel))
+ {
+ body->xRot = -0.5f;
+ leg0->xRot -= 0.0f;
+ leg1->xRot -= 0.0f;
+ arm0->xRot += 0.4f;
+ arm1->xRot += 0.4f;
+ leg0->z = -4.0f;
+ leg1->z = -4.0f;
+ body->z = 2.0f;
+ body->y = 0.0f;
+ arm0->y = 2.0f;
+ arm1->y = 2.0f;
+ leg0->y = +9.0f;
+ leg1->y = +9.0f;
+ head->y = +1.0f;
+ hair->y = +1.0f;
+ ear->y = +1.0f;
+ cloak->y = 0.0f;
+ }
+ else
+ {
+ body->xRot = 0.5f;
+ leg0->xRot -= 0.0f;
+ leg1->xRot -= 0.0f;
+ arm0->xRot += 0.4f;
+ arm1->xRot += 0.4f;
+ leg0->z = +4.0f;
+ leg1->z = +4.0f;
+ body->y = 0.0f;
+ arm0->y = 2.0f;
+ arm1->y = 2.0f;
+ leg0->y = +9.0f;
+ leg1->y = +9.0f;
+ head->y = +1.0f;
+ hair->y = +1.0f;
+ ear->y = +1.0f;
+ cloak->y = 0.0f;
+ }
}
else
{