feat(component): add CCharacterComponent::ComponentOpenFingers

This commit is contained in:
fallenoak 2025-11-03 22:15:39 -06:00
parent 0c77e82e14
commit ccaf2af8cb
No known key found for this signature in database
GPG Key ID: 7628F8E61AEA070D
2 changed files with 18 additions and 0 deletions

View File

@ -244,6 +244,23 @@ void CCharacterComponent::ComponentCloseFingers(CM2Model* model, COMP_HAND_SLOT
} }
} }
void CCharacterComponent::ComponentOpenFingers(CM2Model* model, COMP_HAND_SLOT handSlot) {
uint32_t firstBone;
uint32_t lastBone;
if (handSlot == HAND_LEFT) {
firstBone = 13;
lastBone = 17;
} else {
firstBone = 8;
lastBone = 12;
}
for (uint32_t boneId = firstBone; boneId <= lastBone; boneId++) {
model->UnsetBoneSequence(boneId, 0, 1);
}
}
HTEXTURE CCharacterComponent::CreateTexture(const char* fileName, CStatus* status) { HTEXTURE CCharacterComponent::CreateTexture(const char* fileName, CStatus* status) {
auto texFlags = CGxTexFlags(GxTex_LinearMipNearest, 0, 0, 0, 0, 0, 1); auto texFlags = CGxTexFlags(GxTex_LinearMipNearest, 0, 0, 0, 0, 0, 1);
return TextureCreate(fileName, texFlags, status, 0); return TextureCreate(fileName, texFlags, status, 0);

View File

@ -51,6 +51,7 @@ class CCharacterComponent {
static void AddLink(CM2Model* parent, GEOCOMPONENTLINKS link, char const* modelPath, char const* texturePath, int32_t visualID, const ItemDisplayInfoRec* displayRec); static void AddLink(CM2Model* parent, GEOCOMPONENTLINKS link, char const* modelPath, char const* texturePath, int32_t visualID, const ItemDisplayInfoRec* displayRec);
static CCharacterComponent* AllocComponent(); static CCharacterComponent* AllocComponent();
static void ComponentCloseFingers(CM2Model* model, COMP_HAND_SLOT handSlot); static void ComponentCloseFingers(CM2Model* model, COMP_HAND_SLOT handSlot);
static void ComponentOpenFingers(CM2Model* model, COMP_HAND_SLOT handSlot);
static HTEXTURE CreateTexture(const char* fileName, CStatus* status); static HTEXTURE CreateTexture(const char* fileName, CStatus* status);
static GEOCOMPONENTLINKS GetSheatheLink(SHEATHE_TYPE sheatheType, bool a2); static GEOCOMPONENTLINKS GetSheatheLink(SHEATHE_TYPE sheatheType, bool a2);
static void Initialize(); static void Initialize();