diff options
| author | engineer124 <47598039+engineer124@users.noreply.github.com> | 2023-08-15 00:08:45 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-08-14 10:08:45 -0400 |
| commit | affb1eaf0f037858ab020e6b7fd8d105dff262f8 (patch) | |
| tree | 6fe548aeb9e35caa3f9d3f026402c93038657cc3 /include | |
| parent | 05c2221769ffdbbfd774d856bac77b6d7c2413a0 (diff) | |
Body Parts Docs (#1333)
* body parts WIP
* continue WIP
* finish body parts
* cleanup
* missed one
* Missed Enum
* PR Review
* next PR review
* s32 cast
* TRUNCF_BINANG
* rm unnecessary shadow
* PR Review
* missed some
* oops
Diffstat (limited to 'include')
| -rw-r--r-- | include/functions.h | 4 | ||||
| -rw-r--r-- | include/z64animation.h | 1 | ||||
| -rw-r--r-- | include/z_en_hy_code.h | 47 |
3 files changed, 46 insertions, 6 deletions
diff --git a/include/functions.h b/include/functions.h index 680003988..4664fee89 100644 --- a/include/functions.h +++ b/include/functions.h @@ -657,8 +657,8 @@ void func_800BE504(Actor* actor, ColliderCylinder* collider); void func_800BE568(Actor* actor, ColliderSphere* collider); void func_800BE5CC(Actor* actor, ColliderJntSph* collider, s32 colliderIndex); s32 Actor_IsSmallChest(struct EnBox* chest); -void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s16 limbPosCount, f32 effectScale, f32 frozenSteamScale, f32 effectAlpha, u8 type); -void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f limbPos[], s32 limbPosCount, s32 effectsPerLimb, f32 scale, f32 scaleRange); +void Actor_DrawDamageEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[], s16 bodyPartsCount, f32 effectScale, f32 frozenSteamScale, f32 effectAlpha, u8 type); +void Actor_SpawnIceEffects(PlayState* play, Actor* actor, Vec3f bodyPartsPos[], s32 bodyPartsCount, s32 effectsPerBodyPart, f32 scale, f32 scaleRange); void ActorOverlayTable_FaultClient(void* arg0, void* arg1); uintptr_t ActorOverlayTable_FaultAddrConv(uintptr_t address, void* param); diff --git a/include/z64animation.h b/include/z64animation.h index 67c9d7641..25cbea1f2 100644 --- a/include/z64animation.h +++ b/include/z64animation.h @@ -12,6 +12,7 @@ struct SkelAnime; struct PlayerAnimationFrame; #define LIMB_DONE 0xFF +#define BODYPART_NONE -1 #define ANIM_FLAG_1 (1 << 0) #define ANIM_FLAG_UPDATE_Y (1 << 1) diff --git a/include/z_en_hy_code.h b/include/z_en_hy_code.h index 58a34151c..192e9183c 100644 --- a/include/z_en_hy_code.h +++ b/include/z_en_hy_code.h @@ -6,7 +6,27 @@ struct EnHy; -#define ENHY_LIMB_MAX 16 +//! @note: any actor that uses the EnHy system should +//! have a skeleton that aligns with the enum below. +typedef enum EnHyLimb { + /* 0x00 */ ENHY_LIMB_NONE, + /* 0x01 */ ENHY_LIMB_PELVIS, + /* 0x02 */ ENHY_LIMB_LEFT_THIGH, + /* 0x03 */ ENHY_LIMB_LEFT_SHIN, + /* 0x04 */ ENHY_LIMB_LEFT_FOOT, + /* 0x05 */ ENHY_LIMB_RIGHT_THIGH, + /* 0x06 */ ENHY_LIMB_RIGHT_SHIN, + /* 0x07 */ ENHY_LIMB_RIGHT_FOOT, + /* 0x08 */ ENHY_LIMB_TORSO, + /* 0x09 */ ENHY_LIMB_LEFT_UPPER_ARM, + /* 0x0A */ ENHY_LIMB_LEFT_FOREARM, + /* 0x0B */ ENHY_LIMB_LEFT_HAND, + /* 0x0C */ ENHY_LIMB_RIGHT_UPPER_ARM, + /* 0x0D */ ENHY_LIMB_RIGHT_FOREARM, + /* 0x0E */ ENHY_LIMB_RIGHT_HAND, + /* 0x0F */ ENHY_LIMB_HEAD, + /* 0x10 */ ENHY_LIMB_MAX +} EnHyLimb; //! TODO: Better animaion enum names when animations are documented typedef enum { @@ -36,6 +56,25 @@ typedef enum { typedef void (*EnHyActionFunc)(struct EnHy*, PlayState*); +typedef enum EnHyBodyPart { + /* 0 */ ENHY_BODYPART_0, + /* 1 */ ENHY_BODYPART_1, + /* 2 */ ENHY_BODYPART_2, + /* 3 */ ENHY_BODYPART_3, + /* 4 */ ENHY_BODYPART_4, + /* 5 */ ENHY_BODYPART_5, + /* 6 */ ENHY_BODYPART_6, + /* 7 */ ENHY_BODYPART_7, + /* 8 */ ENHY_BODYPART_8, + /* 9 */ ENHY_BODYPART_9, + /* 10 */ ENHY_BODYPART_10, + /* 11 */ ENHY_BODYPART_11, + /* 12 */ ENHY_BODYPART_12, + /* 13 */ ENHY_BODYPART_13, + /* 14 */ ENHY_BODYPART_14, + /* 15 */ ENHY_BODYPART_MAX +} EnHyBodyPart; + typedef struct EnHy { /* 0x000 */ Actor actor; /* 0x144 */ EnHyActionFunc actionFunc; @@ -65,14 +104,14 @@ typedef struct EnHy { /* 0x2E4 */ Vec3s prevTorsoRot; /* 0x2EA */ s16 fidgetTableY[ENHY_LIMB_MAX]; /* 0x30A */ s16 fidgetTableZ[ENHY_LIMB_MAX]; - /* 0x32C */ Vec3f bodyPartsPos[15]; + /* 0x32C */ Vec3f bodyPartsPos[ENHY_BODYPART_MAX]; /* 0x3E0 */ UNK_TYPE1 unk_3E0[0x6]; /* 0x3E6 */ s16 eyeTexIndex; /* 0x3E8 */ s16 blinkTimer; } EnHy; // size = 0x3EC -extern s8 gEnHyBodyParts[]; -extern s8 gEnHyParentBodyParts[]; +extern s8 gEnHyLimbToBodyParts[]; +extern s8 gEnHyParentShadowBodyParts[]; extern u8 gEnHyShadowSizes[]; s32 EnHy_ChangeAnim(SkelAnime* skelAnime, s16 animIndex); |
