diff options
| author | Tyler McGavran <tyler.taggerung@gmail.com> | 2022-05-07 00:56:43 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-05-06 21:56:43 -0700 |
| commit | ecb085b2915cef23b18ddc65a9141b448aedcd4e (patch) | |
| tree | bd98efa55b87293f50b3c58ca79282b0dad9b6b7 /include | |
| parent | d4a0f7ab8f64d74408c4f1df9ae312bb360cc5dd (diff) | |
Add some more actor types, match a function (#191)
* Add some more actor types, match a function
* Identify the boundBox member of the Player struct
Note that while the `flag` members are signed, they should be understood as just a group of bits.
Based on some googling around (see https://stackoverflow.com/a/11644749) the operation `thing.flag |= 0x8000`
is NOT undefined behaviour, even though that is setting the sign bit.
The numerical interpretation of the result as a signed number is implementation defined, while the
actual operation acts on the bit representation of the number.
Signed-off-by: Taggerung <tyler.taggerung@gmail.com>
Diffstat (limited to 'include')
| -rw-r--r-- | include/actor_types.h | 101 | ||||
| -rw-r--r-- | include/common_structs.h | 2 | ||||
| -rw-r--r-- | include/kart_attributes.h | 2 |
3 files changed, 80 insertions, 25 deletions
diff --git a/include/actor_types.h b/include/actor_types.h index 829498b3f..57d81f427 100644 --- a/include/actor_types.h +++ b/include/actor_types.h @@ -6,31 +6,20 @@ // This keeps the other files cleaner. struct piranha_plant { - /* 0x00 */ s16 unk0; // 0xC, 0xD, or 0x2B - #ifdef AVOID_UB - /* 0x02 */ u16 unk2; - #else - s16 unk2; // bitflag - #endif - /* 0x04 */ s16 unk4; // Timer? - /* 0x06 */ s16 unk6; // 1 - /* 0x08 */ s16 unk8; - /* 0x0A */ s16 unkA; - /* 0x0C */ f32 unkC; - /* 0x10 */ Vec3s unk10; // Actor rotation - /* 0x18 */ s32 unk18; - /* 0x1C */ f32 unk1C; - /* 0x20 */ s16 unk20; - /* 0x22 */ s16 unk22; - /* 0x24 */ s16 unk24; - /* 0x26 */ s16 unk26; - /* 0x28 */ s16 unk28; - /* 0x2A */ s16 unk2A; + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ Vec4s visibilityStates; // A per-camera visibilty state tracker + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ Vec4s unk10; + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec4s timers; // A per-camera timer. Might be more appropriate to call this state + /* 0x2C */ f32 unk_02C; + /* 0x30 */ UnkActorInner unk30; }; struct triple_shell_parent { /* 0x00 */ s16 type; - /* 0x02 */ s16 unk_02; + /* 0x02 */ s16 flags; /* 0x04 */ s16 shellsAvailable; /* 0x06 */ s16 state; /* 0x08 */ f32 unk_08; @@ -46,13 +35,13 @@ struct triple_shell_parent { struct shell_actor { /* 0x00 */ s16 type; - /* 0x02 */ s16 unk_02; + /* 0x02 */ s16 flags; // Index in D_8015F9B8 for the parent actor of this shell // Seems to pull double duty as a timer /* 0x04 */ s16 parentIndex; /* 0x06 */ s16 state; /* 0x08 */ f32 unk_08; - /* 0x0C */ f32 unk_0C; + /* 0x0C */ f32 boundingBoxSize; /* 0x10 */ s16 rotVelocity; // Change in rotAngle on a per-update basis /* 0x12 */ s16 rotAngle; // Angle of rotation around player (or parent?), not the rotation of the shell itself /* 0x14 */ s16 playerId; // Id of the player that "owns" the shell @@ -62,6 +51,72 @@ struct shell_actor { /* 0x30 */ UnkActorInner unk30; }; // size = 0x70 +struct item_box { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 someTimer; + /* 0x06 */ s16 state; + /* 0x08 */ f32 resetDistance; // Value added to the Y position when box is touched. Expected to be negative + // Distance at which a player can activate the item box + // Named "bounding box" to match the name used for the "size" of a kart + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ Vec3s rot; + /* 0x16 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + /* 0x24 */ f32 origY; // Original Y position. Basically the Y position the box will reset to after being touched + /* 0x28 */ f32 unk_028; + /* 0x2C */ f32 unk_02C; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct fake_item_box { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 someTimer; + /* 0x06 */ s16 state; + /* 0x08 */ f32 sizeScaling; // Controls the size of the box + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ Vec3s rot; + /* 0x16 */ s16 unk_16; + /* 0x18 */ Vec3f pos; + /* 0x24 */ f32 playerId; + /* 0x28 */ f32 targetY; + /* 0x2C */ f32 unk_02C; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct banana_bunch_parent { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 state; + /* 0x08 */ f32 unk_08; + /* 0x0C */ f32 unk_0C; + /* 0x10 */ s16 playerId; // Player that own the bananas + /* 0x12 */ s16 bananaIndices[5]; // Indices in D_8015F9B8 for the bananas owned by this parent + /* 0x1C */ s16 bananasAvailable; + /* 0x1E */ s16 unk_1E; + /* 0x20 */ f32 unk_20[4]; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + +struct banana_actor { + /* 0x00 */ s16 type; + /* 0x02 */ s16 flags; + /* 0x04 */ s16 unk_04; + /* 0x06 */ s16 state; + /* 0x08 */ s16 parentIndex; + /* 0x0A */ s16 bananaId; // ? Appears to indiciate which banana of the bunch this one is + /* 0x0C */ f32 boundingBoxSize; + /* 0x10 */ s16 playerId; // Player that owns this particular banana + /* 0x12 */ s16 elderIndex; // Index of the next-oldest banana in the bunch + /* 0x14 */ s16 youngerIndex; // Index of the next-youngest banana in the bunch. -1 if this banana is the youngest + /* 0x16 */ s16 unk_16; // Index of the next-youngest banana in the bunch. -1 if this banana is the youngest + /* 0x18 */ Vec3f pos; + /* 0x24 */ Vec3f velocity; + /* 0x30 */ UnkActorInner unk30; +}; // size = 0x70 + struct Actor { /* 0x00 */ s16 unk0; // 0xC, 0xD, or 0x2B #ifdef AVOID_UB diff --git a/include/common_structs.h b/include/common_structs.h index 1429e36ba..3e849b654 100644 --- a/include/common_structs.h +++ b/include/common_structs.h @@ -297,7 +297,7 @@ typedef struct { /* 0x0064 */ f32 unk_064; /* 0x0068 */ f32 unk_068; /* 0x006C */ f32 unk_06C; - /* 0x0070 */ f32 unk_070; + /* 0x0070 */ f32 boundingBoxSize; /* 0x0074 */ f32 unk_074; /* 0x0078 */ s16 unk_078; /* 0x007A */ s16 unk_07A; diff --git a/include/kart_attributes.h b/include/kart_attributes.h index 20364a0f9..f32cd79b4 100644 --- a/include/kart_attributes.h +++ b/include/kart_attributes.h @@ -35,7 +35,7 @@ extern f32 gKartFrictionTable[8]; extern f32 gKartGravityTable[8]; extern f32 D_800E2670[8]; extern f32 gKartTopSpeedTable[8]; -extern f32 gKartBoundingBoxTable[8]; +extern f32 gKartBoundingBoxSizeTable[8]; extern f32 D_800E26D0[15]; extern f32 D_800E270C[15]; |
