From 53962a2cd8ffccfd72f84b84a875c8372e3f8534 Mon Sep 17 00:00:00 2001 From: Leonid Kapitonov Date: Wed, 27 Nov 2024 19:50:44 +0100 Subject: Document Actor "Fidget Tables" (#2287) * Document `func_80034F54` and related data new name: `UpdateLimbOverrides` reason: - `0x814` and `0x940` constants - `*_OverrideLimbDraw` functions additionally: - move constants into `z64animation.h` - use these constant for existing formulas - properly name corresponding actors' fields - add occasional explicit limbs limit constants * port over the MM "fidget" naming * remove redundant comments * move and rename `FIDGET_*` constants * introduce a `FIDGET_SCALE` constant, as no other value is applied * remove generally unrelated changes * apply PR suggestion Co-authored-by: mzxrules * fix (?) fidgetTable size following the https://github.com/zeldaret/oot/pull/2287#discussion_r1832371833 suggestion * remove an unused `struct EnMu` field @ `0x024A` a continuation to the 211263295cd8768d63c1426025cf913ba6bedc18 automatic padding commpensates its absence * remove MM mention as "it would get unruly fast" https://github.com/zeldaret/oot/pull/2287#discussion_r1833470468 * rename `overridePerLimb` -> `fidgetFrequency` https://github.com/zeldaret/oot/pull/2287#discussion_r1837211873 * give better names to the constants https://github.com/zeldaret/oot/pull/2287#discussion_r1837211873 * remove unnecesasry braces from a comment https://github.com/zeldaret/oot/pull/2287#discussion_r1842642196 * make the comment multiline "officially" * restore `limbIndex` naming for this PR https://github.com/zeldaret/oot/pull/2287/commits/43afb7b7cb54aa7b086d8cb7fca4cffaa7d145bf#r1842644602 * apply a PR suggestion https://github.com/zeldaret/oot/pull/2287#discussion_r1842787653 --------- Co-authored-by: mzxrules --- include/z64actor.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'include') diff --git a/include/z64actor.h b/include/z64actor.h index 3d63248c0..deac35481 100644 --- a/include/z64actor.h +++ b/include/z64actor.h @@ -14,6 +14,13 @@ #define MASS_IMMOVABLE 0xFF // Cannot be pushed by OC colliders #define MASS_HEAVY 0xFE // Can only be pushed by OC colliders from actors with IMMOVABLE or HEAVY mass. +// These are default parameters used for "animation fidgeting", which procedurally generate actor idle animations. +// These calculations may be performed within individual actors, or by using fidget tables with `Actor_UpdateFidgetTables`. +#define FIDGET_FREQ_Y 0x814 +#define FIDGET_FREQ_Z 0x940 +#define FIDGET_FREQ_LIMB 0x32 +#define FIDGET_AMPLITUDE 200.0f + struct Actor; struct ActorEntry; struct CollisionPoly; @@ -926,7 +933,7 @@ void func_80034BA0(struct PlayState* play, SkelAnime* skelAnime, OverrideLimbDra void func_80034CC4(struct PlayState* play, SkelAnime* skelAnime, OverrideLimbDraw overrideLimbDraw, PostLimbDraw postLimbDraw, Actor* actor, s16 alpha); s16 func_80034DD4(Actor* actor, struct PlayState* play, s16 arg2, f32 arg3); -void func_80034F54(struct PlayState* play, s16* arg1, s16* arg2, s32 arg3); +void Actor_UpdateFidgetTables(struct PlayState* play, s16* fidgetTableY, s16* fidgetTableZ, s32 tableLen); void Actor_Noop(Actor* actor, struct PlayState* play); void Gfx_DrawDListOpa(struct PlayState* play, Gfx* dlist); -- cgit v1.2.3