Obj_Mine matched (#1225)

* Obj_Mine

* Obj_Mine

* Fixups

* Nonmatchings + cleanup

* Small cleanup

* externs

* structs complete

* wew

* some docs. still baffling

* documented physics stuff

* docs. physics be wack

* forgot some things

* format

* more cleanup

* merge and such

* format

* more format and cleanup

* asm stuff

* Update src/overlays/actors/ovl_Obj_Mine/z_obj_mine.c

Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>

* now with decomp.me

* removed some extraneous macros I didn't end up using

* fixes and formats

* merge

* my god, it matches

* format

* removed macros

* more fixes

* format

* format

---------

Co-authored-by: Maide <eeeedddccc@hotmail.co.uk>
Co-authored-by: Derek Hensley <hensley.derek58@gmail.com>
Co-authored-by: petrie911 <petrie911@users.noreply.github.com>
Co-authored-by: petrie911 <pmontag@Monday.localdomain>
Co-authored-by: Anghelo Carvajal <angheloalf95@gmail.com>
This commit is contained in:
petrie911
2024-04-06 12:40:41 -05:00
committed by GitHub
parent e3ce14c932
commit 45ae63ccc5
5 changed files with 1276 additions and 119 deletions
File diff suppressed because it is too large Load Diff
+80 -2
View File
@@ -7,11 +7,89 @@ struct ObjMine;
typedef void (*ObjMineActionFunc)(struct ObjMine*, PlayState*);
#define OBJMINE_GET_LINK_COUNT(thisx) ((thisx)->params & 0x3F)
#define OBJMINE_GET_PATH_INDEX(thisx) ((thisx)->params & 0xFF)
#define OBJMINE_GET_PATH_SPEED(thisx) (((thisx)->params >> 8) & 7)
#define OBJMINE_GET_TYPE(thisx) (((thisx)->params >> 12) & 3)
#define OBJMINE_PARAM(type, linkCount, pathIndex, pathSpeed) (((type) << 0xC) | ((type == OBJMINE_TYPE_PATH) ? ((pathIndex) | ((pathSpeed) << 8)) : (linkCount)))
#define OBJMINE_PATH_PARAM(pathIndex, pathSpeed) OBJMINE_PARAM(OBJMINE_TYPE_PATH, 0, pathIndex, pathSpeed)
#define OBJMINE_AIR_PARAM(linkCount) OBJMINE_PARAM(OBJMINE_TYPE_AIR, linkCount, 0, 0)
#define OBJMINE_WATER_PARAM(linkCount) OBJMINE_PARAM(OBJMINE_TYPE_WATER, linkCount, 0, 0)
#define OBJMINE_CHAIN_MAX 63
typedef enum {
/* 0 */ OBJMINE_TYPE_PATH,
/* 1 */ OBJMINE_TYPE_AIR,
/* 2 */ OBJMINE_TYPE_WATER
} ObjMineType;
typedef struct {
/* 0x00 */ Vec3f x;
/* 0x0C */ Vec3f y;
/* 0x18 */ Vec3f z;
} ObjMineMtxF3; // size = 0x24
typedef struct {
/* 0x0 */ s16 twist;
/* 0x2 */ s16 spin;
} ObjMineAirLink; // size = 0x4
typedef struct {
/* 0x00 */ ObjMineMtxF3 basis;
/* 0x24 */ Vec3f translation; // unused
/* 0x30 */ Vec2f displacement;
/* 0x38 */ Vec2f velocity;
/* 0x40 */ f32 restore;
/* 0x44 */ f32 drag;
/* 0x48 */ f32 knockback;
/* 0x4C */ s16 knockbackAngle;
/* 0x50 */ f32 swaySize;
/* 0x54 */ s16 swayPhase;
/* 0x58 */ f32 swayMax;
/* 0x5C */ f32 wallCheckDistSq;
/* 0x60 */ ObjMineAirLink links[OBJMINE_CHAIN_MAX];
} ObjMineAirChain; // size = 0x15C
typedef struct {
/* 0x00 */ ObjMineMtxF3 basis;
/* 0x24 */ Vec3f pos;
/* 0x30 */ Vec3f velocity;
/* 0x3C */ Vec3f accel;
} ObjMineWaterLink; // size = 0x48
typedef struct {
/* 0x00 */ f32 drag;
/* 0x04 */ Vec3f knockbackDir;
/* 0x10 */ f32 knockback;
/* 0x14 */ f32 swayXZ;
/* 0x18 */ f32 swayY;
/* 0x1C */ f32 swayMax;
/* 0x20 */ s16 swayPhaseVel;
/* 0x24 */ f32 restoreXZ;
/* 0x28 */ f32 maxY;
/* 0x2C */ f32 restY;
/* 0x30 */ f32 restoreY;
/* 0x34 */ f32 wallCheckDistSq;
/* 0x38 */ Vec2f wallEject;
/* 0x40 */ s8 touchWall;
/* 0x44 */ ObjMineWaterLink links[OBJMINE_CHAIN_MAX];
} ObjMineWaterChain; // size = 0x11FC
typedef struct ObjMine {
/* 0x0000 */ Actor actor;
/* 0x0144 */ char unk_144[0x60];
/* 0x0144 */ ColliderJntSph collider;
/* 0x0164 */ ColliderJntSphElement colliderElements[1];
/* 0x01A4 */ ObjMineActionFunc actionFunc;
/* 0x01A8 */ char unk_1A8[0x120C];
/* 0x01A8 */ f32 pathSpeed;
/* 0x01AC */ s32 waypointCount;
/* 0x01B0 */ s32 waypointIndex;
/* 0x01B4 */ Vec3s* waypoints;
/* 0x01B8 */ union {
ObjMineAirChain air;
ObjMineWaterChain water;
} chain;
} ObjMine; // size = 0x13B4
#endif // Z_OBJ_MINE_H