Player doc: anim wrappers (#1434)

* player cs docs setup

* more docs

* more docs

* missed enums

* more docs, but broken. Need to fix sPlayerCsModeAnimFuncs

* fix

* rm enum

* more minor docs

* PR suggestion

* typo

* csActionFunc

* PR Suggestion

* player animation

* cleanup

* cleanup

* comments

* macro

* fix bss

* another comment

* better macro

* move macro

* fix bss

* adjust names

* simplify enum

* missed flags

* PR Review

* adjust comment

* missed defines
This commit is contained in:
engineer124 2023-11-18 23:55:04 +11:00 committed by GitHub
parent dbb6410ba3
commit faba61d9b8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
14 changed files with 630 additions and 601 deletions

View File

@ -12,6 +12,10 @@ struct Actor;
struct SkelAnime; struct SkelAnime;
struct PlayerAnimationFrame; struct PlayerAnimationFrame;
// for indexing `jointTable[]` and `morphTable[]`
#define LIMB_ROOT_POS 0 // Translation/Offset of the root limb
#define LIMB_ROOT_ROT 1 // Rotation of the root limb
#define LIMB_DONE 0xFF #define LIMB_DONE 0xFF
#define BODYPART_NONE -1 #define BODYPART_NONE -1
@ -186,7 +190,7 @@ typedef struct SkelAnime {
} update; } update;
/* 0x34 */ s8 initFlags; // Flags used when initializing Player's skeleton /* 0x34 */ s8 initFlags; // Flags used when initializing Player's skeleton
/* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace. /* 0x35 */ u8 moveFlags; // Flags used for animations that move the actor in worldspace.
/* 0x36 */ s16 prevRot; // Previous rotation in worldspace. /* 0x36 */ s16 prevYaw; // Previous rotation in worldspace.
/* 0x38 */ Vec3s prevTransl; // Previous modelspace translation. /* 0x38 */ Vec3s prevTransl; // Previous modelspace translation.
/* 0x3E */ Vec3s baseTransl; // Base modelspace translation. /* 0x3E */ Vec3s baseTransl; // Base modelspace translation.
} SkelAnime; // size = 0x44 } SkelAnime; // size = 0x44

View File

@ -317,6 +317,13 @@ typedef enum PlayerDoorType {
/* 5 */ PLAYER_DOORTYPE_PROXIMITY /* 5 */ PLAYER_DOORTYPE_PROXIMITY
} PlayerDoorType; } PlayerDoorType;
// Some player animations are played at this reduced speed, for reasons yet unclear.
// Perhaps to compress animation data?
// This is called "adjusted" for now.
// z_en_horse also has many instances of this adjusted speed
#define PLAYER_ANIM_ADJUSTED_SPEED (2.0f / 3.0f)
#define PLAYER_ANIM_NORMAL_SPEED (3.0f / 3.0f)
typedef enum PlayerAnimType { typedef enum PlayerAnimType {
/* 0 */ PLAYER_ANIMTYPE_DEFAULT, // DEFAULT /* 0 */ PLAYER_ANIMTYPE_DEFAULT, // DEFAULT
/* 1 */ PLAYER_ANIMTYPE_1, /* 1 */ PLAYER_ANIMTYPE_1,

View File

@ -187,8 +187,8 @@ void func_800F0BB4(EnHy* enHy, PlayState* play, EnDoor* door, s16 arg3, s16 arg4
phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f; phi_f0 = (offset.z >= 0.0f) ? 1.0f : -1.0f;
animIndex = ((s8)phi_f0 < 0) ? 0 : 2; animIndex = ((s8)phi_f0 < 0) ? 0 : 2;
EnHy_ChangeObjectAndAnim(enHy, play, (animIndex == 0) ? arg3 : arg4); EnHy_ChangeObjectAndAnim(enHy, play, (animIndex == 0) ? arg3 : arg4);
enHy->skelAnime.baseTransl = *enHy->skelAnime.jointTable; enHy->skelAnime.baseTransl = enHy->skelAnime.jointTable[LIMB_ROOT_POS];
enHy->skelAnime.prevTransl = *enHy->skelAnime.jointTable; enHy->skelAnime.prevTransl = enHy->skelAnime.jointTable[LIMB_ROOT_POS];
enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATE_Y | ANIM_FLAG_1); enHy->skelAnime.moveFlags |= (ANIM_FLAG_UPDATE_Y | ANIM_FLAG_1);
AnimationContext_SetMoveActor(play, &enHy->actor, &enHy->skelAnime, 1.0f); AnimationContext_SetMoveActor(play, &enHy->actor, &enHy->skelAnime, 1.0f);
door->knobDoor.playOpenAnim = true; door->knobDoor.playOpenAnim = true;

View File

@ -100,11 +100,11 @@ void SkelAnime_DrawLod(PlayState* play, void** skeleton, Vec3s* jointTable, Over
Matrix_Push(); Matrix_Push();
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable[0].y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable[0].z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
dList = rootLimb->dLists[lod]; dList = rootLimb->dLists[lod];
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, actor)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, actor)) {
@ -219,11 +219,11 @@ void SkelAnime_DrawFlexLod(PlayState* play, void** skeleton, Vec3s* jointTable,
Matrix_Push(); Matrix_Push();
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable[0].y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable[0].z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
newDList = limbDList = rootLimb->dLists[lod]; newDList = limbDList = rootLimb->dLists[lod];
@ -326,11 +326,11 @@ void SkelAnime_DrawOpa(PlayState* play, void** skeleton, Vec3s* jointTable, Over
Matrix_Push(); Matrix_Push();
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable[0].y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable[0].z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
dList = rootLimb->dList; dList = rootLimb->dList;
if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, actor)) { if ((overrideLimbDraw == NULL) || !overrideLimbDraw(play, 1, &dList, &pos, &rot, actor)) {
@ -439,10 +439,10 @@ void SkelAnime_DrawFlexOpa(PlayState* play, void** skeleton, Vec3s* jointTable,
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable[0].y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable[0].z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
newDList = limbDList = rootLimb->dList; newDList = limbDList = rootLimb->dList;
@ -575,10 +575,10 @@ void SkelAnime_DrawTransformFlexOpa(PlayState* play, void** skeleton, Vec3s* joi
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable[0].y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable[0].z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
newDList = limbDList = rootLimb->dList; newDList = limbDList = rootLimb->dList;
@ -722,11 +722,11 @@ Gfx* SkelAnime_Draw(PlayState* play, void** skeleton, Vec3s* jointTable, Overrid
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable[0].y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable[0].z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
dList = rootLimb->dList; dList = rootLimb->dList;
@ -838,11 +838,11 @@ Gfx* SkelAnime_DrawFlex(PlayState* play, void** skeleton, Vec3s* jointTable, s32
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable[0].x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable[0].y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable[0].z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
newDList = limbDList = rootLimb->dList; newDList = limbDList = rootLimb->dList;
@ -1236,7 +1236,7 @@ void SkelAnime_InitPlayer(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHea
skelAnime->morphTable = (void*)ALIGN16((uintptr_t)morphTableBuffer); skelAnime->morphTable = (void*)ALIGN16((uintptr_t)morphTableBuffer);
} }
PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f); PlayerAnimation_Change(play, skelAnime, animation, PLAYER_ANIM_NORMAL_SPEED, 0.0f, 0.0f, ANIMMODE_LOOP, 0.0f);
} }
/** /**
@ -1386,8 +1386,8 @@ void PlayerAnimation_Change(PlayState* play, SkelAnime* skelAnime, PlayerAnimati
* Immediately changes to a Player animation that plays once at the default speed. * Immediately changes to a Player animation that plays once at the default speed.
*/ */
void PlayerAnimation_PlayOnce(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) { void PlayerAnimation_PlayOnce(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) {
PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(&animation->common), PlayerAnimation_Change(play, skelAnime, animation, PLAYER_ANIM_NORMAL_SPEED, 0.0f,
ANIMMODE_ONCE, 0.0f); Animation_GetLastFrame(&animation->common), ANIMMODE_ONCE, 0.0f);
} }
/** /**
@ -1403,8 +1403,8 @@ void PlayerAnimation_PlayOnceSetSpeed(PlayState* play, SkelAnime* skelAnime, Pla
* Immediately changes to a Player animation that loops at the default speed. * Immediately changes to a Player animation that loops at the default speed.
*/ */
void PlayerAnimation_PlayLoop(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) { void PlayerAnimation_PlayLoop(PlayState* play, SkelAnime* skelAnime, PlayerAnimationHeader* animation) {
PlayerAnimation_Change(play, skelAnime, animation, 1.0f, 0.0f, Animation_GetLastFrame(&animation->common), PlayerAnimation_Change(play, skelAnime, animation, PLAYER_ANIM_NORMAL_SPEED, 0.0f,
ANIMMODE_LOOP, 0.0f); Animation_GetLastFrame(&animation->common), ANIMMODE_LOOP, 0.0f);
} }
/** /**
@ -1564,7 +1564,6 @@ void SkelAnime_InitFlex(PlayState* play, SkelAnime* skelAnime, FlexSkeletonHeade
if (jointTable == NULL) { if (jointTable == NULL) {
skelAnime->jointTable = ZeldaArena_Malloc(sizeof(*skelAnime->jointTable) * skelAnime->limbCount); skelAnime->jointTable = ZeldaArena_Malloc(sizeof(*skelAnime->jointTable) * skelAnime->limbCount);
skelAnime->morphTable = ZeldaArena_Malloc(sizeof(*skelAnime->morphTable) * skelAnime->limbCount); skelAnime->morphTable = ZeldaArena_Malloc(sizeof(*skelAnime->morphTable) * skelAnime->limbCount);
} else { } else {
skelAnime->jointTable = jointTable; skelAnime->jointTable = jointTable;
@ -1932,29 +1931,30 @@ void SkelAnime_UpdateTranslation(SkelAnime* skelAnime, Vec3f* diff, s16 angle) {
diff->x = 0.0f; diff->x = 0.0f;
} else { } else {
// `angle` rotation around y axis. // `angle` rotation around y axis.
x = skelAnime->jointTable->x - skelAnime->prevTransl.x; x = skelAnime->jointTable[LIMB_ROOT_POS].x - skelAnime->prevTransl.x;
z = skelAnime->jointTable->z - skelAnime->prevTransl.z; z = skelAnime->jointTable[LIMB_ROOT_POS].z - skelAnime->prevTransl.z;
sin = Math_SinS(angle); sin = Math_SinS(angle);
cos = Math_CosS(angle); cos = Math_CosS(angle);
diff->x = x * cos + z * sin; diff->x = x * cos + z * sin;
diff->z = z * cos - x * sin; diff->z = z * cos - x * sin;
} }
skelAnime->prevTransl.x = skelAnime->jointTable->x; skelAnime->prevTransl.x = skelAnime->jointTable[LIMB_ROOT_POS].x;
skelAnime->jointTable->x = skelAnime->baseTransl.x; skelAnime->jointTable[LIMB_ROOT_POS].x = skelAnime->baseTransl.x;
skelAnime->prevTransl.z = skelAnime->jointTable->z; skelAnime->prevTransl.z = skelAnime->jointTable[LIMB_ROOT_POS].z;
skelAnime->jointTable->z = skelAnime->baseTransl.z; skelAnime->jointTable[LIMB_ROOT_POS].z = skelAnime->baseTransl.z;
if (skelAnime->moveFlags & ANIM_FLAG_UPDATE_Y) { if (skelAnime->moveFlags & ANIM_FLAG_UPDATE_Y) {
if (skelAnime->moveFlags & ANIM_FLAG_NOMOVE) { if (skelAnime->moveFlags & ANIM_FLAG_NOMOVE) {
diff->y = 0.0f; diff->y = 0.0f;
} else { } else {
diff->y = skelAnime->jointTable->y - skelAnime->prevTransl.y; diff->y = skelAnime->jointTable[LIMB_ROOT_POS].y - skelAnime->prevTransl.y;
} }
skelAnime->prevTransl.y = skelAnime->jointTable->y; skelAnime->prevTransl.y = skelAnime->jointTable[LIMB_ROOT_POS].y;
skelAnime->jointTable->y = skelAnime->baseTransl.y; skelAnime->jointTable[LIMB_ROOT_POS].y = skelAnime->baseTransl.y;
} else { } else {
diff->y = 0.0f; diff->y = 0.0f;
skelAnime->prevTransl.y = skelAnime->jointTable->y; skelAnime->prevTransl.y = skelAnime->jointTable[LIMB_ROOT_POS].y;
} }
skelAnime->moveFlags &= ~ANIM_FLAG_NOMOVE; skelAnime->moveFlags &= ~ANIM_FLAG_NOMOVE;
} }

View File

@ -121,10 +121,10 @@ Gfx* SubS_DrawTransformFlex(PlayState* play, void** skeleton, Vec3s* jointTable,
gSPSegment(gfx++, 0x0D, mtx); gSPSegment(gfx++, 0x0D, mtx);
Matrix_Push(); Matrix_Push();
rootLimb = Lib_SegmentedToVirtual(skeleton[0]); rootLimb = Lib_SegmentedToVirtual(skeleton[0]);
pos.x = jointTable->x; pos.x = jointTable[LIMB_ROOT_POS].x;
pos.y = jointTable->y; pos.y = jointTable[LIMB_ROOT_POS].y;
pos.z = jointTable->z; pos.z = jointTable[LIMB_ROOT_POS].z;
rot = jointTable[1]; rot = jointTable[LIMB_ROOT_ROT];
newDlist = rootLimb->dList; newDlist = rootLimb->dList;
limbDList = rootLimb->dList; limbDList = rootLimb->dList;

View File

@ -285,7 +285,7 @@ s32 DemoEffect_OverrideLimbDrawTimewarp(PlayState* play, SkelCurve* skelCurve, s
CLOSE_DISPS(play->state.gfxCtx); CLOSE_DISPS(play->state.gfxCtx);
if (limbIndex == 0) { if (limbIndex == 0) {
s16* transform = skelCurve->jointTable[0]; s16* transform = skelCurve->jointTable[LIMB_ROOT_POS];
transform[2] = transform[0] = 1024; transform[2] = transform[0] = 1024;
transform[1] = 1024; transform[1] = 1024;

View File

@ -1432,7 +1432,7 @@ void EnHorse_JumpLanding(EnHorse* this, PlayState* play) {
this->animIndex = ENHORSE_ANIM_GALLOP; this->animIndex = ENHORSE_ANIM_GALLOP;
Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]);
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f;
this->postDrawFunc = NULL; this->postDrawFunc = NULL;
} }
@ -1721,7 +1721,7 @@ void EnHorse_StartLowJump(EnHorse* this, PlayState* play) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->riderPos.y -= ((y * 0.01f) * this->unk_528) * 0.01f; this->riderPos.y -= ((y * 0.01f) * this->unk_528) * 0.01f;
if (this->type == HORSE_TYPE_2) { if (this->type == HORSE_TYPE_2) {
@ -1775,7 +1775,7 @@ void EnHorse_LowJump(EnHorse* this, PlayState* play) {
} }
} else { } else {
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
temp_f0 = jointTable->y; temp_f0 = jointTable[LIMB_ROOT_POS].y;
this->actor.world.pos.y = this->jumpStartY + (temp_f0 * 0.01f * this->unk_528 * 0.01f); this->actor.world.pos.y = this->jumpStartY + (temp_f0 * 0.01f * this->unk_528 * 0.01f);
} }
@ -1818,7 +1818,7 @@ void EnHorse_StartHighJump(EnHorse* this, PlayState* play) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->riderPos.y -= ((y * 0.01f) * this->unk_528) * 0.01f; this->riderPos.y -= ((y * 0.01f) * this->unk_528) * 0.01f;
this->stateFlags |= ENHORSE_CALC_RIDER_POS; this->stateFlags |= ENHORSE_CALC_RIDER_POS;
@ -1873,7 +1873,7 @@ void EnHorse_HighJump(EnHorse* this, PlayState* play) {
} }
} else { } else {
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
temp_f0 = jointTable->y; temp_f0 = jointTable[LIMB_ROOT_POS].y;
this->actor.world.pos.y = this->jumpStartY + (temp_f0 * 0.01f * this->unk_528 * 0.01f); this->actor.world.pos.y = this->jumpStartY + (temp_f0 * 0.01f * this->unk_528 * 0.01f);
} }
@ -2334,7 +2334,7 @@ void func_80881398(EnHorse* this, PlayState* play) {
} }
} else { } else {
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->actor.world.pos.y = this->jumpStartY + (y * 0.01f * this->unk_528 * 0.01f); this->actor.world.pos.y = this->jumpStartY + (y * 0.01f * this->unk_528 * 0.01f);
} }
@ -2363,7 +2363,7 @@ void func_8088159C(EnHorse* this, PlayState* play) {
this->animIndex = ENHORSE_ANIM_GALLOP; this->animIndex = ENHORSE_ANIM_GALLOP;
Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]); Animation_PlayOnce(&this->skin.skelAnime, sAnimationHeaders[this->type][this->animIndex]);
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f;
this->postDrawFunc = NULL; this->postDrawFunc = NULL;
} }
@ -2551,7 +2551,7 @@ void EnHorse_CsPlayHighJumpAnim(EnHorse* this, PlayState* play) {
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->riderPos.y -= y * 0.01f * this->unk_528 * 0.01f; this->riderPos.y -= y * 0.01f * this->unk_528 * 0.01f;
this->stateFlags |= ENHORSE_ANIM_HIGH_JUMP; this->stateFlags |= ENHORSE_ANIM_HIGH_JUMP;
@ -2596,7 +2596,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) {
} }
} else { } else {
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->actor.world.pos.y = this->jumpStartY + (y * 0.01f * this->unk_528 * 0.01f); this->actor.world.pos.y = this->jumpStartY + (y * 0.01f * this->unk_528 * 0.01f);
} }
@ -2621,7 +2621,7 @@ void EnHorse_CsJump(EnHorse* this, PlayState* play, CsCmdActorCue* cue) {
sPlaybackSpeeds[6]); sPlaybackSpeeds[6]);
jointTable = this->skin.skelAnime.jointTable; jointTable = this->skin.skelAnime.jointTable;
y = jointTable->y; y = jointTable[LIMB_ROOT_POS].y;
this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f; this->riderPos.y += y * 0.01f * this->unk_528 * 0.01f;
this->postDrawFunc = NULL; this->postDrawFunc = NULL;
@ -4231,7 +4231,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
this->stateFlags &= ~ENHORSE_OBSTACLE; this->stateFlags &= ~ENHORSE_OBSTACLE;
this->unk_3EC = thisx->world.rot.y; this->unk_3EC = thisx->world.rot.y;
if ((this->animIndex == ENHORSE_ANIM_STOPPING) || (this->animIndex == ENHORSE_ANIM_REARING)) { if ((this->animIndex == ENHORSE_ANIM_STOPPING) || (this->animIndex == ENHORSE_ANIM_REARING)) {
this->skin.skelAnime.jointTable[0].y += 0x154; this->skin.skelAnime.jointTable[LIMB_ROOT_POS].y += 0x154;
} }
this->curFrame = this->skin.skelAnime.curFrame; this->curFrame = this->skin.skelAnime.curFrame;
@ -4265,7 +4265,7 @@ void EnHorse_Update(Actor* thisx, PlayState* play2) {
this->rider->actor.shape.rot.y = thisx->shape.rot.y; this->rider->actor.shape.rot.y = thisx->shape.rot.y;
} else if (this->action == ENHORSE_ACTION_6) { } else if (this->action == ENHORSE_ACTION_6) {
EnIn* in = this->rider; EnIn* in = this->rider;
s16 jnt = in->jointTable[0].y; s16 jnt = in->jointTable[LIMB_ROOT_POS].y;
in->actor.world.pos.x = this->riderPos.x; in->actor.world.pos.x = this->riderPos.x;
in->actor.world.pos.y = this->riderPos.y - (jnt * 0.01f * this->unk_528 * 0.01f); in->actor.world.pos.y = this->riderPos.y - (jnt * 0.01f * this->unk_528 * 0.01f);
@ -4712,9 +4712,9 @@ void EnHorse_Draw(Actor* thisx, PlayState* play) {
} }
} else { } else {
if (this->stateFlags & ENHORSE_JUMPING) { if (this->stateFlags & ENHORSE_JUMPING) {
this->skin.skelAnime.jointTable->x = 0; this->skin.skelAnime.jointTable[LIMB_ROOT_POS].x = 0;
this->skin.skelAnime.jointTable->y = 0; this->skin.skelAnime.jointTable[LIMB_ROOT_POS].y = 0;
this->skin.skelAnime.jointTable->z = 0; this->skin.skelAnime.jointTable[LIMB_ROOT_POS].z = 0;
} }
SkelAnime_DrawFlexOpa(play, this->skin.skelAnime.skeleton, this->skin.skelAnime.jointTable, SkelAnime_DrawFlexOpa(play, this->skin.skelAnime.skeleton, this->skin.skelAnime.jointTable,
this->skin.skelAnime.dListCount, func_80888D18, NULL, &this->actor); this->skin.skelAnime.dListCount, func_80888D18, NULL, &this->actor);

View File

@ -223,12 +223,12 @@ void EnRz_ChangeAnim(PlayState* play, EnRz* this, s16 animIndex, u8 animMode, f3
endFrame = Animation_GetLastFrame(sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)]); endFrame = Animation_GetLastFrame(sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)]);
if (animMode == ANIMMODE_LOOP) { if (animMode == ANIMMODE_LOOP) {
PlayerAnimation_Change(play, &this->skelAnime, PlayerAnimation_Change(play, &this->skelAnime,
sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], 2.0f / 3.0f, 0.0f, sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)],
endFrame, ANIMMODE_LOOP, morphFrames); PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames);
} else { } else {
PlayerAnimation_Change(play, &this->skelAnime, PlayerAnimation_Change(play, &this->skelAnime,
sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)], 2.0f / 3.0f, 0.0f, sPlayerAnimations[animIndex - ARRAY_COUNT(sJudoAnimations)],
endFrame, ANIMMODE_LOOP, morphFrames); PLAYER_ANIM_ADJUSTED_SPEED, 0.0f, endFrame, ANIMMODE_LOOP, morphFrames);
} }
} else { } else {
Animation_Change(&this->skelAnime, animationPtr[animIndex], 1.0f, 0.0f, Animation_Change(&this->skelAnime, animationPtr[animIndex], 1.0f, 0.0f,

View File

@ -370,7 +370,7 @@ void EnSyatekiOkuta_UpdateCollision(EnSyatekiOkuta* this, PlayState* play) {
} }
this->collider.dim.pos.x = this->actor.world.pos.x; this->collider.dim.pos.x = this->actor.world.pos.x;
// jointTable->y is the y-translation of the skeleton root // jointTable->y is the y-translation of the skeleton root, see `LIMB_ROOT_POS`
this->collider.dim.pos.y = this->actor.world.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y); this->collider.dim.pos.y = this->actor.world.pos.y + (this->skelAnime.jointTable->y * this->actor.scale.y);
this->collider.dim.pos.z = this->actor.world.pos.z; this->collider.dim.pos.z = this->actor.world.pos.z;
CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->collider.base);

View File

@ -320,7 +320,8 @@ s32 func_80A3E898(EnTest3* this, PlayState* play) {
Message_ContinueTextbox(play, textId); Message_ContinueTextbox(play, textId);
} }
if (textId == 0x296B) { if (textId == 0x296B) {
PlayerAnimation_PlayOnceSetSpeed(play, &this->player.skelAnime, &gPlayerAnim_al_yareyare, 2.0f / 3.0f); PlayerAnimation_PlayOnceSetSpeed(play, &this->player.skelAnime, &gPlayerAnim_al_yareyare,
PLAYER_ANIM_ADJUSTED_SPEED);
} }
return false; return false;
} }

File diff suppressed because it is too large Load Diff

View File

@ -4248,12 +4248,12 @@
0x8082DABC:("Player_StopHorizontalMovement",), 0x8082DABC:("Player_StopHorizontalMovement",),
0x8082DAD4:("func_8082DAD4",), 0x8082DAD4:("func_8082DAD4",),
0x8082DAFC:("func_8082DAFC",), 0x8082DAFC:("func_8082DAFC",),
0x8082DB18:("Player_AnimationPlayOnce",), 0x8082DB18:("Player_Anim_PlayOnce",),
0x8082DB3C:("Player_AnimationPlayLoop",), 0x8082DB3C:("Player_Anim_PlayLoop",),
0x8082DB60:("func_8082DB60",), 0x8082DB60:("Player_Anim_PlayLoopAdjusted",),
0x8082DB90:("func_8082DB90",), 0x8082DB90:("Player_Anim_PlayOnceAdjusted",),
0x8082DBC0:("Player_AnimationPlayOnceReverse",), 0x8082DBC0:("Player_Anim_PlayOnceAdjustedReverse",),
0x8082DC28:("func_8082DC28",), 0x8082DC28:("Player_Anim_ResetModelRotY",),
0x8082DC38:("func_8082DC38",), 0x8082DC38:("func_8082DC38",),
0x8082DC64:("func_8082DC64",), 0x8082DC64:("func_8082DC64",),
0x8082DCA0:("Player_DetachHeldActor",), 0x8082DCA0:("Player_DetachHeldActor",),
@ -4274,30 +4274,30 @@
0x8082E1BC:("Player_AnimSfx_PlayFloorLand",), 0x8082E1BC:("Player_AnimSfx_PlayFloorLand",),
0x8082E1F0:("func_8082E1F0",), 0x8082E1F0:("func_8082E1F0",),
0x8082E224:("Player_PlayAnimSfx",), 0x8082E224:("Player_PlayAnimSfx",),
0x8082E438:("func_8082E438",), 0x8082E438:("Player_Anim_PlayOnceMorph",),
0x8082E4A4:("func_8082E4A4",), 0x8082E4A4:("Player_Anim_PlayOnceMorphAdjusted",),
0x8082E514:("func_8082E514",), 0x8082E514:("Player_Anim_PlayLoopMorph",),
0x8082E55C:("func_8082E55C",), 0x8082E55C:("Player_Anim_PlayLoopMorphAdjusted",),
0x8082E5A8:("func_8082E5A8",), 0x8082E5A8:("Player_Anim_PlayOnceFreeze",),
0x8082E5EC:("func_8082E5EC",), 0x8082E5EC:("Player_Anim_PlayOnceFreezeAdjusted",),
0x8082E634:("func_8082E634",), 0x8082E634:("Player_Anim_PlayLoopSlowMorph",),
0x8082E67C:("func_8082E67C",), 0x8082E67C:("Player_Anim_PlayLoopOnceFinished",),
0x8082E6D0:("func_8082E6D0",), 0x8082E6D0:("Player_Anim_ResetPrevTranslRot",),
0x8082E6F8:("func_8082E6F8",), 0x8082E6F8:("Player_Anim_ResetPrevTranslRotFormScale",),
0x8082E784:("func_8082E784",), 0x8082E784:("Player_Anim_ZeroModelYaw",),
0x8082E794:("func_8082E794",), 0x8082E794:("Player_Anim_ResetMove",),
0x8082E820:("func_8082E820",), 0x8082E820:("Player_AnimReplace_SetupLedgeClimb",),
0x8082E920:("func_8082E920",), 0x8082E920:("Player_AnimReplace_Setup",),
0x8082E9C8:("func_8082E9C8",), 0x8082E9C8:("Player_AnimReplace_PlayOnceSetSpeed",),
0x8082EA10:("func_8082EA10",), 0x8082EA10:("Player_AnimReplace_PlayOnce",),
0x8082EA38:("func_8082EA38",), 0x8082EA38:("Player_AnimReplace_PlayOnceAdjusted",),
0x8082EA60:("func_8082EA60",), 0x8082EA60:("Player_AnimReplace_PlayOnceNormalAdjusted",),
0x8082EA80:("func_8082EA80",), 0x8082EA80:("Player_AnimReplace_PlayLoopSetSpeed",),
0x8082EAC8:("func_8082EAC8",), 0x8082EAC8:("Player_AnimReplace_PlayLoop",),
0x8082EAF0:("func_8082EAF0",), 0x8082EAF0:("Player_AnimReplace_PlayLoopAdjusted",),
0x8082EB18:("func_8082EB18",), 0x8082EB18:("Player_AnimReplace_PlayLoopNormalAdjusted",),
0x8082EB38:("Player_ProcessControlStick",), 0x8082EB38:("Player_ProcessControlStick",),
0x8082EC9C:("func_8082EC9C",), 0x8082EC9C:("Player_Anim_PlayOnceWaterAdjustment",),
0x8082ECCC:("func_8082ECCC",), 0x8082ECCC:("func_8082ECCC",),
0x8082ECE0:("func_8082ECE0",), 0x8082ECE0:("func_8082ECE0",),
0x8082ED20:("func_8082ED20",), 0x8082ED20:("func_8082ED20",),
@ -4793,29 +4793,29 @@
0x80857A44:("func_80857A44",), 0x80857A44:("func_80857A44",),
0x80857AEC:("func_80857AEC",), 0x80857AEC:("func_80857AEC",),
0x80857BE8:("Player_Action_96",), 0x80857BE8:("Player_Action_96",),
0x80858C84:("func_80858C84",), 0x80858C84:("Player_CsAnimHelper_PlayOnceMorphReset",),
0x80858CC8:("func_80858CC8",), 0x80858CC8:("Player_CsAnimHelper_PlayOnceSlowMorphAdjustedReset",),
0x80858D48:("func_80858D48",), 0x80858D48:("Player_CsAnimHelper_PlayLoopSlowMorphAdjustedReset",),
0x80858DB4:("Player_CsAnim_1",), 0x80858DB4:("Player_CsAnim_StopHorizontalMovement",),
0x80858DDC:("Player_CsAnim_2",), 0x80858DDC:("Player_CsAnim_PlayOnceMorphReset",),
0x80858DFC:("Player_CsAnim_14",), 0x80858DFC:("Player_CsAnim_PlayOnceFreezeReset",),
0x80858E40:("Player_CsAnim_3",), 0x80858E40:("Player_CsAnim_PlayOnceSlowMorphAdjustedReset",),
0x80858E60:("Player_CsAnim_4",), 0x80858E60:("Player_CsAnim_PlayLoopSlowMorphAdjustedReset",),
0x80858E80:("Player_CsAnim_5",), 0x80858E80:("Player_CsAnim_ReplacePlayOnceNormalAdjusted",),
0x80858EA0:("Player_CsAnim_6",), 0x80858EA0:("Player_CsAnim_ReplacePlayOnce",),
0x80858EC0:("Player_CsAnim_19",), 0x80858EC0:("Player_CsAnim_ReplacePlayOnceAdjustedReverse",),
0x80858EFC:("Player_CsAnim_7",), 0x80858EFC:("Player_CsAnim_ReplacePlayLoopNormalAdjusted",),
0x80858F1C:("Player_CsAnim_8",), 0x80858F1C:("Player_CsAnim_ReplacePlayLoop",),
0x80858F3C:("Player_CsAnim_9",), 0x80858F3C:("Player_CsAnim_PlayOnce",),
0x80858F5C:("Player_CsAnim_10",), 0x80858F5C:("Player_CsAnim_PlayLoop",),
0x80858F7C:("Player_CsAnim_15",), 0x80858F7C:("Player_CsAnim_PlayOnceAdjusted",),
0x80858F9C:("Player_CsAnim_16",), 0x80858F9C:("Player_CsAnim_PlayLoopAdjusted",),
0x80858FBC:("Player_CsAnim_11",), 0x80858FBC:("Player_CsAnim_Update",),
0x80858FE8:("func_80858FE8",), 0x80858FE8:("Player_CsAnimHelper_PlayAnimSfxLostHorse",),
0x80859028:("Player_CsAnim_12",), 0x80859028:("Player_CsAnim_PlayLoopAdjustedSlowMorphAnimSfxReset",),
0x80859168:("Player_CsAnim_17",), 0x80859168:("Player_CsAnim_PlayLoopAdjustedOnceFinished",),
0x808591BC:("Player_CsAnim_13",), 0x808591BC:("Player_CsAnim_PlayLoopNormalAdjustedOnceFinished",),
0x80859210:("Player_CsAnim_18",), 0x80859210:("Player_CsAnim_PlayAnimSfx",),
0x80859248:("func_80859248",), 0x80859248:("func_80859248",),
0x8085929C:("func_8085929C",), 0x8085929C:("func_8085929C",),
0x80859300:("func_80859300",), 0x80859300:("func_80859300",),

View File

@ -4889,7 +4889,7 @@
0x8085C318:("D_8085C318","UNK_TYPE1","",0x1), 0x8085C318:("D_8085C318","UNK_TYPE1","",0x1),
0x8085C344:("D_8085C344","UNK_TYPE1","",0x1), 0x8085C344:("D_8085C344","UNK_TYPE1","",0x1),
0x8085C394:("D_8085C394","UNK_TYPE1","",0x1), 0x8085C394:("D_8085C394","UNK_TYPE1","",0x1),
0x8085C3E4:("D_8085C3E4","f32","",0x4), 0x8085C3E4:("sPlayerWaterSpeedScale","f32","",0x4),
0x8085C3E8:("D_8085C3E8","f32","",0x4), 0x8085C3E8:("D_8085C3E8","f32","",0x4),
0x8085C3EC:("D_8085C3EC","UNK_TYPE2","",0x2), 0x8085C3EC:("D_8085C3EC","UNK_TYPE2","",0x2),
0x8085C3F4:("sGetItemTable","GetItemEntry","[0xB9]",0x456), 0x8085C3F4:("sGetItemTable","GetItemEntry","[0xB9]",0x456),

View File

@ -987,7 +987,7 @@ wordReplace = {
"skelAnime.transitionStep": "skelAnime.morphRate", "skelAnime.transitionStep": "skelAnime.morphRate",
"skelAnime.animUpdate": "skelAnime.update", "skelAnime.animUpdate": "skelAnime.update",
"skelAnime.flags": "skelAnime.moveFlags", "skelAnime.flags": "skelAnime.moveFlags",
"skelAnime.prevFrameRot": "skelAnime.prevRot", "skelAnime.prevFrameRot": "skelAnime.prevYaw",
"skelAnime.prevFramePos": "skelAnime.prevTransl", "skelAnime.prevFramePos": "skelAnime.prevTransl",
"skelAnime.unk3E": "skelAnime.baseTransl", "skelAnime.unk3E": "skelAnime.baseTransl",
"actor.unk20": "actor.halfDaysBits", "actor.unk20": "actor.halfDaysBits",