MinecraftConsoles/Minecraft.Client/HumanoidModel.h
Langtanium cef65c8df3 Fixed a few issues and added more functionality
Fixed player not rendering in third person and armor arm0 not moving with 64x64 skins. Added offsets to held item (main hand) and armor (boots).
2026-04-18 11:41:06 -07:00

97 lines
3.5 KiB
C++

#pragma once
#include "Model.h"
#include "SkinOffset.h"
class HumanoidModel : public Model
{
public:
// Base geometry
ModelPart *head, *hair, *body, *arm0, *arm1, *leg0, *leg1, *ear, *cloak;
// Second layer/64x64 skin geometry
ModelPart *jacket, *sleeve0, *sleeve1, *pants0, *pants1;
// Extra geometry for DLC skins
ModelPart *waist, *belt, *bodyArmor, *armArmor0, *armArmor1, *legging0, *legging1, *sock0, *sock1, *boot0, *boot1;
//ModelPart *hat;
int holdingLeftHand;
int holdingRightHand;
bool idle;
bool sneaking;
bool bowAndArrow;
bool eating; // 4J added
float eating_t; // 4J added
float eating_swing; // 4J added
unsigned int m_uiAnimOverrideBitmask; // 4J added
float m_fYOffset; // 4J added
bool m_isArmor;
enum animbits
{
eAnim_ArmsDown =0,
eAnim_ArmsOutFront,
eAnim_NoLegAnim,
eAnim_HasIdle,
eAnim_ForceAnim, // Claptrap looks bad if the user turns off custom skin anim
// 4J-PB - DaveK wants Fish characters to move both legs in the same way
eAnim_SingleLegs,
eAnim_SingleArms,
eAnim_StatueOfLiberty, // Dr Who Weeping Angel
eAnim_DontRenderArmour, // Dr Who Daleks
eAnim_NoBobbing, // Dr Who Daleks
eAnim_DisableRenderHead,
eAnim_DisableRenderArm0,
eAnim_DisableRenderArm1,
eAnim_DisableRenderTorso,
eAnim_DisableRenderLeg0,
eAnim_DisableRenderLeg1,
eAnim_DisableRenderHair,
eAnim_SmallModel, // Maggie Simpson for riding horse, etc
eAnim_ClassicModel,
eAnim_SlimModel,
// Hide overlay/second layer on 64x64 skins
eAnim_DisableRenderSleeve1,
eAnim_DisableRenderSleeve0,
eAnim_DisableRenderPants1,
eAnim_DisableRenderPants0,
eAnim_DisableRenderJacket,
eAnim_RenderArmorHead,
eAnim_RenderArmorArm0,
eAnim_RenderArmorArm1,
eAnim_RenderArmorTorso,
eAnim_RenderArmorLeg0,
eAnim_RenderArmorLeg1,
eAnim_Dinnerbone
};
static const unsigned int m_staticBitmaskIgnorePlayerCustomAnimSetting= (1<<HumanoidModel::eAnim_ForceAnim) |
(1<<HumanoidModel::eAnim_DisableRenderArm0) |
(1<<HumanoidModel::eAnim_DisableRenderArm1) |
(1<<HumanoidModel::eAnim_DisableRenderTorso) |
(1<<HumanoidModel::eAnim_DisableRenderLeg0) |
(1<<HumanoidModel::eAnim_DisableRenderLeg1) |
(1<<HumanoidModel::eAnim_DisableRenderHair) |
(1<<HumanoidModel::eAnim_DisableRenderSleeve1) |
(1<<HumanoidModel::eAnim_DisableRenderSleeve0) |
(1<<HumanoidModel::eAnim_DisableRenderPants1) |
(1<<HumanoidModel::eAnim_DisableRenderPants0) |
(1<<HumanoidModel::eAnim_DisableRenderJacket);
void _init(float g, float yOffset, int texWidth, int texHeight, bool slim, bool isArmor); // 4J added
HumanoidModel();
HumanoidModel(float g);
HumanoidModel(float g, bool isArmor);
HumanoidModel(float g, float yOffset, int texWidth, int texHeight);
HumanoidModel(float g, float yOffset, int texWidth, int texHeight, bool slim);
virtual void render(shared_ptr<Entity> entity, float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled);
virtual void renderUIOffset(float time, float r, float bob, float yRot, float xRot, float scale, bool usecompiled, vector<SKIN_OFFSET *> *modelOffsets);
virtual void setupAnim(float time, float r, float bob, float yRot, float xRot, float scale, shared_ptr<Entity> entity, unsigned int uiBitmaskOverrideAnim = 0);
void renderHair(float scale, bool usecompiled);
void renderEars(float scale, bool usecompiled);
void renderCloak(float scale, bool usecompiled);
void render(HumanoidModel *model, float scale, bool usecompiled);
// Add new bits to models
ModelPart * AddOrRetrievePart(SKIN_BOX *pBox);
};