DynaPoly Docs Pass (#1194)

* dyna docs

* init flags

* more docs

* cleanup

* partial PR review

* another bracket

* hold to press

* PR cleanup
This commit is contained in:
engineer124
2023-04-19 08:36:53 +10:00
committed by GitHub
parent 38d21bbe97
commit b8af819165
101 changed files with 515 additions and 459 deletions
+18 -18
View File
@@ -776,25 +776,25 @@ void* ActorOverlayTable_FaultAddrConv(void* address, void* param);
void ActorOverlayTable_Init(void);
void ActorOverlayTable_Cleanup(void);
void BgCheck2_UpdateActorPosition(CollisionContext* colCtx, s32 bgId, Actor* actor);
void BgCheck2_UpdateActorYRotation(CollisionContext* colCtx, s32 bgId, Actor* actor);
void BgCheck2_AttachToMesh(CollisionContext* colCtx, Actor* actor, s32 bgId);
u32 BgCheck2_UpdateActorAttachedToMesh(CollisionContext* colCtx, s32 bgId, Actor* actor);
void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 flags);
void DynaPolyActor_UpdateCarriedActorPos(CollisionContext* colCtx, s32 bgId, Actor* carriedActor);
void DynaPolyActor_UpdateCarriedActorRotY(CollisionContext* colCtx, s32 bgId, Actor* carriedActor);
void DynaPolyActor_AttachCarriedActor(CollisionContext* colCtx, Actor* carriedActor, s32 bgId);
u32 DynaPolyActor_TransformCarriedActor(CollisionContext* colCtx, s32 bgId, Actor* carriedActor);
void DynaPolyActor_Init(DynaPolyActor* dynaActor, s32 transformFlags);
void DynaPolyActor_LoadMesh(PlayState* play, DynaPolyActor* dynaActor, CollisionHeader* meshHeader);
void DynaPolyActor_ResetState(DynaPolyActor* dynaActor);
void DynaPolyActor_SetRidingFallingState(DynaPolyActor* dynaActor);
void DynaPolyActor_SetRidingMovingState(DynaPolyActor* dynaActor);
void DynaPolyActor_SetRidingMovingStateByIndex(CollisionContext* colCtx, s32 bgId);
void DynaPolyActor_SetRidingRotatingState(DynaPolyActor* dynaActor);
void DynaPolyActor_SetRidingRotatingStateByIndex(CollisionContext* colCtx, s32 bgId);
void DynaPolyActor_SetSwitchPressedState(DynaPolyActor* dynaActor);
void DynaPolyActor_SetHeavySwitchPressedState(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsInRidingFallingState(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsInRidingMovingState(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsInRidingRotatingState(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsInSwitchPressedState(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsInHeavySwitchPressedState(DynaPolyActor* dynaActor);
void DynaPolyActor_UnsetAllInteractFlags(DynaPolyActor* dynaActor);
void DynaPolyActor_SetActorOnTop(DynaPolyActor* dynaActor);
void DynaPolyActor_SetPlayerOnTop(DynaPolyActor* dynaActor);
void DynaPoly_SetPlayerOnTop(CollisionContext* colCtx, s32 bgId);
void DynaPolyActor_SetPlayerAbove(DynaPolyActor* dynaActor);
void DynaPoly_SetPlayerAbove(CollisionContext* colCtx, s32 bgId);
void DynaPolyActor_SetActorOnSwitch(DynaPolyActor* dynaActor);
void DynaPolyActor_SetActorOnHeavySwitch(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsActorOnTop(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsPlayerOnTop(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsPlayerAbove(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsSwitchPressed(DynaPolyActor* dynaActor);
s32 DynaPolyActor_IsHeavySwitchPressed(DynaPolyActor* dynaActor);
s32 DynaPolyActor_ValidateMove(PlayState* play, DynaPolyActor* dynaActor, s16 startRadius, s16 endRadius, s16 startHeight);
Camera* Camera_Alloc(View* view, CollisionContext* bg, PlayState* play);
+15 -7
View File
@@ -229,15 +229,23 @@ typedef enum {
/* 1 */ FOOT_RIGHT
} ActorFootIndex;
#define DYNA_TRANSFORM_POS (1 << 0) // Position of the actors on top follows the dynapoly actor's movement.
#define DYNA_TRANSFORM_ROT_Y (1 << 1) // The Y rotation of the actors on top follows the dynapoly actor's Y rotation.
#define DYNA_INTERACT_ACTOR_ON_TOP (1 << 0) // There is an actor standing on the collision of the dynapoly actor
#define DYNA_INTERACT_PLAYER_ON_TOP (1 << 1) // The player actor is standing on the collision of the dynapoly actor
#define DYNA_INTERACT_PLAYER_ABOVE (1 << 2) // The player is directly above the collision of the dynapoly actor (any distance above)
#define DYNA_INTERACT_ACTOR_ON_SWITCH (1 << 3) // Like the ACTOR_ON_TOP flag but only actors with ACTOR_FLAG_CAN_PRESS_SWITCH
#define DYNA_INTERACT_ACTOR_ON_HEAVY_SWITCH (1 << 4) // Like the ACTOR_ON_TOP flag but only actors with ACTOR_FLAG_CAN_PRESS_HEAVY_SWITCH
typedef struct {
/* 0x000 */ Actor actor;
/* 0x144 */ s32 bgId;
/* 0x148 */ f32 pushForce;
/* 0x14C */ f32 unk14C;
/* 0x150 */ s16 yRotation;
/* 0x154 */ u32 flags;
/* 0x158 */ u8 stateFlags;
/* 0x15A */ s16 pad15A;
/* 0x154 */ u32 transformFlags;
/* 0x158 */ u8 interactFlags;
} DynaPolyActor; // size = 0x15C
@@ -528,8 +536,8 @@ typedef enum {
#define ACTOR_FLAG_8000 (1 << 15)
//
#define ACTOR_FLAG_10000 (1 << 16)
//
#define ACTOR_FLAG_20000 (1 << 17)
// actor can press and hold down heavy switches
#define ACTOR_FLAG_CAN_PRESS_HEAVY_SWITCH (1 << 17)
//
#define ACTOR_FLAG_40000 (1 << 18)
//
@@ -546,8 +554,8 @@ typedef enum {
#define ACTOR_FLAG_1000000 (1 << 24)
//
#define ACTOR_FLAG_2000000 (1 << 25)
//
#define ACTOR_FLAG_4000000 (1 << 26)
// actor can press and hold down switches
#define ACTOR_FLAG_CAN_PRESS_SWITCH (1 << 26)
// Prevents locking on with Z targeting an actor even if Tatl is floating over it
#define ACTOR_FLAG_CANT_LOCK_ON (1 << 27)
//
+17 -11
View File
@@ -314,10 +314,16 @@ typedef struct {
/* 0x60 */ f32 maxY;
} BgActor; // size = 0x64
#define BGACTOR_IN_USE (1 << 0) // The bgActor entry is in use
#define BGACTOR_1 (1 << 1)
#define BGACTOR_COLLISION_DISABLED (1 << 2) // The collision of the bgActor is disabled
#define BGACTOR_CEILING_COLLISION_DISABLED (1 << 3) // The ceiling collision of the bgActor is ignored
#define BGACTOR_FLOOR_COLLISION_DISABLED (1 << 5) // The floor collision of the bgActor is ignored
typedef struct {
/* 0x0000 */ u8 bitFlag;
/* 0x0004 */ BgActor bgActors[BG_ACTOR_MAX];
/* 0x138C */ u16 bgActorFlags[BG_ACTOR_MAX]; // bit 0 - Is mesh active
/* 0x138C */ u16 bgActorFlags[BG_ACTOR_MAX];
/* 0x13F0 */ CollisionPoly* polyList;
/* 0x13F4 */ Vec3s* vtxList;
/* 0x13F8 */ DynaWaterBoxList waterBoxList;
@@ -521,18 +527,18 @@ void DynaPoly_Init(struct PlayState* play, DynaCollisionContext* dyna);
void DynaPoly_Alloc(struct PlayState* play, DynaCollisionContext* dyna);
s32 DynaPoly_SetBgActor(struct PlayState* play, DynaCollisionContext* dyna, Actor* actor, CollisionHeader* colHeader);
DynaPolyActor* DynaPoly_GetActor(CollisionContext* colCtx, s32 bgId);
void func_800C62BC(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void func_800C6314(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void func_800C636C(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void func_800C63C4(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void func_800C641C(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void func_800C6474(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void func_800C6554(struct PlayState* play, DynaCollisionContext* dyna);
void DynaPoly_DisableCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void DynaPoly_EnableCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void DynaPoly_DisableCeilingCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void DynaPoly_EnableCeilingCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void DynaPoly_DisableFloorCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void DynaPoly_EnableFloorCollision(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void DynaPoly_InvalidateLookup(struct PlayState* play, DynaCollisionContext* dyna);
void DynaPoly_DeleteBgActor(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId);
void BgCheck_CalcWaterboxDimensions(Vec3f* minPos, Vec3f* maxXPos, Vec3f* maxZPos, Vec3s* minPosOut, s16* xLength, s16* zLength);
void DynaPoly_ExpandSRT(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId, s32* vtxStartIndex, s32* polyStartIndex, s32* waterBoxStartIndex);
void BgCheck_ResetFlagsIfLoadedActor(struct PlayState* play, DynaCollisionContext* dyna, Actor* actor);
void DynaPoly_Setup(struct PlayState* play, DynaCollisionContext* dyna);
void DynaPoly_AddBgActorToLookup(struct PlayState* play, DynaCollisionContext* dyna, s32 bgId, s32* vtxStartIndex, s32* polyStartIndex, s32* waterBoxStartIndex);
void DynaPoly_UnsetAllInteractFlags(struct PlayState* play, DynaCollisionContext* dyna, Actor* actor);
void DynaPoly_UpdateContext(struct PlayState* play, DynaCollisionContext* dyna);
void func_800C756C(DynaCollisionContext* dyna, s32* numPolygons, s32* numVertices, s32* numWaterBoxes);
void DynaPoly_UpdateBgActorTransforms(struct PlayState* play, DynaCollisionContext* dyna);
void CollisionHeader_SegmentedToVirtual(CollisionHeader* colHeader);