diff options
Diffstat (limited to 'src/code')
| -rw-r--r-- | src/code/z_actor.c | 19 |
1 files changed, 15 insertions, 4 deletions
diff --git a/src/code/z_actor.c b/src/code/z_actor.c index b5e96201d..b96801fc4 100644 --- a/src/code/z_actor.c +++ b/src/code/z_actor.c @@ -4441,13 +4441,24 @@ void Animation_ChangeByInfo(SkelAnime* skelAnime, AnimationInfo* animationInfo, frameCount, animationInfo->mode, animationInfo->morphFrames); } -void func_80034F54(PlayState* play, s16* arg1, s16* arg2, s32 arg3) { +/** + * Fills two tables with rotation angles that can be used to simulate idle animations. + * + * The rotation angles are dependent on the current frame, so should be updated regularly, generally every frame. + * + * This is done for the desired limb by taking either the `sin` of the yTable value or the `cos` of the zTable value, + * multiplying by some scale factor (generally 200), and adding that to the already existing rotation. + * + * Note: With the common scale factor of 200, this effect is practically unnoticeable if the current animation already + * has motion involved. + */ +void Actor_UpdateFidgetTables(PlayState* play, s16* fidgetTableY, s16* fidgetTableZ, s32 tableLen) { u32 frames = play->gameplayFrames; s32 i; - for (i = 0; i < arg3; i++) { - arg1[i] = (0x814 + 50 * i) * frames; - arg2[i] = (0x940 + 50 * i) * frames; + for (i = 0; i < tableLen; i++) { + fidgetTableY[i] = (FIDGET_FREQ_Y + FIDGET_FREQ_LIMB * i) * frames; + fidgetTableZ[i] = (FIDGET_FREQ_Z + FIDGET_FREQ_LIMB * i) * frames; } } |
