mirror of
https://github.com/zeldaret/mm.git
synced 2026-06-17 23:01:00 -04:00
Fidget Tables Docs (#1316)
* Docs for SubS_FillLimbRotTables and Actor_FillLimbRotTables * Fidget * Format * /// * UpdateFidgetTables * Clarify comment * Adjust comments slightly * Update src/code/z_actor.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> * Update src/code/z_sub_s.c Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com> --------- Co-authored-by: engineer124 <47598039+engineer124@users.noreply.github.com>
This commit is contained in:
+17
-5
@@ -4464,14 +4464,26 @@ void Actor_ChangeAnimationByInfo(SkelAnime* skelAnime, AnimationInfo* animationI
|
||||
frameCount, animationInfo->mode, animationInfo->morphFrames);
|
||||
}
|
||||
|
||||
// Unused
|
||||
void func_800BDCF4(PlayState* play, s16* arg1, s16* arg2, s32 size) {
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
* Note: This function goes unused in favor of `SubS_UpdateFidgetTables`.
|
||||
*/
|
||||
void Actor_UpdateFidgetTables(PlayState* play, s16* fidgetTableY, s16* fidgetTableZ, s32 tableLen) {
|
||||
s32 frames = play->gameplayFrames;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < size; i++) {
|
||||
arg1[i] = (0x814 + 50 * i) * frames;
|
||||
arg2[i] = (0x940 + 50 * i) * frames;
|
||||
for (i = 0; i < tableLen; i++) {
|
||||
fidgetTableY[i] = (i * 50 + 0x814) * frames;
|
||||
fidgetTableZ[i] = (i * 50 + 0x940) * frames;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+16
-5
@@ -1186,13 +1186,24 @@ Actor* SubS_FindActor(PlayState* play, Actor* actorListStart, u8 actorCategory,
|
||||
return actor;
|
||||
}
|
||||
|
||||
s32 SubS_FillLimbRotTables(PlayState* play, s16* limbRotTableY, s16* limbRotTableZ, s32 numLimbs) {
|
||||
s32 i;
|
||||
/**
|
||||
* 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.
|
||||
*/
|
||||
s32 SubS_UpdateFidgetTables(PlayState* play, s16* fidgetTableY, s16* fidgetTableZ, s32 tableLen) {
|
||||
u32 frames = play->gameplayFrames;
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < numLimbs; i++) {
|
||||
limbRotTableY[i] = (i * 50 + 0x814) * frames;
|
||||
limbRotTableZ[i] = (i * 50 + 0x940) * frames;
|
||||
for (i = 0; i < tableLen; i++) {
|
||||
fidgetTableY[i] = (i * 50 + 0x814) * frames;
|
||||
fidgetTableZ[i] = (i * 50 + 0x940) * frames;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user