mirror of
https://github.com/whoahq/whoa.git
synced 2026-02-01 00:02:45 +03:00
feat(component): add CCharacterComponent::ComponentCloseFingers
This commit is contained in:
parent
9ef900f80f
commit
0c77e82e14
@ -200,12 +200,10 @@ void CCharacterComponent::AddLink(CM2Model* parent, GEOCOMPONENTLINKS link, char
|
|||||||
parent->DetachAllChildrenById(link);
|
parent->DetachAllChildrenById(link);
|
||||||
model->AttachToParent(parent, link, nullptr, 0);
|
model->AttachToParent(parent, link, nullptr, 0);
|
||||||
|
|
||||||
// Add link point
|
|
||||||
|
|
||||||
if (link == ATTACH_HANDR) {
|
if (link == ATTACH_HANDR) {
|
||||||
// TODO CCharacterComponent::AddLinkpt(parent, 0);
|
CCharacterComponent::ComponentCloseFingers(parent, HAND_RIGHT);
|
||||||
} else if (link == ATTACH_HANDL) {
|
} else if (link == ATTACH_HANDL) {
|
||||||
// TODO CCharacterComponent::AddLinkpt(parent, 1);
|
CCharacterComponent::ComponentCloseFingers(parent, HAND_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Replace item particle color
|
// Replace item particle color
|
||||||
@ -229,6 +227,23 @@ CCharacterComponent* CCharacterComponent::AllocComponent() {
|
|||||||
return component;
|
return component;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CCharacterComponent::ComponentCloseFingers(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->SetBoneSequence(boneId, 15, 0xFFFFFFFF, 0, 1.0f, 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);
|
||||||
|
|||||||
@ -50,6 +50,7 @@ class CCharacterComponent {
|
|||||||
static int32_t AddHandItem(CM2Model* model, const ItemDisplayInfoRec* displayRec, INVENTORY_SLOTS invSlot, SHEATHE_TYPE sheatheType, bool sheathed, bool shield, bool a7, int32_t a8);
|
static int32_t AddHandItem(CM2Model* model, const ItemDisplayInfoRec* displayRec, INVENTORY_SLOTS invSlot, SHEATHE_TYPE sheatheType, bool sheathed, bool shield, bool a7, int32_t a8);
|
||||||
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 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();
|
||||||
|
|||||||
@ -6,6 +6,11 @@
|
|||||||
|
|
||||||
class CM2Model;
|
class CM2Model;
|
||||||
|
|
||||||
|
enum COMP_HAND_SLOT {
|
||||||
|
HAND_RIGHT = 0,
|
||||||
|
HAND_LEFT = 1,
|
||||||
|
};
|
||||||
|
|
||||||
enum COMPONENT_GEOSET {
|
enum COMPONENT_GEOSET {
|
||||||
GEOSET_HEAD = 0,
|
GEOSET_HEAD = 0,
|
||||||
GEOSET_BEARD = 1,
|
GEOSET_BEARD = 1,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user