Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleanup z_collision_check 1 #1427

Merged
merged 27 commits into from
Jan 11, 2024
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
9062812
Cleanup `z_collision_check.c` and structs
Dragorn421 Nov 10, 2022
04123d2
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Nov 14, 2022
353194c
Revert `other*` names to master, split to other pr
Dragorn421 Nov 16, 2022
fa8bf58
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Nov 17, 2022
cfc8c32
WIP/experimental: `ColliderCylinderElement`
Dragorn421 Nov 17, 2022
44fc7be
Revert "WIP/experimental: `ColliderCylinderElement`"
Dragorn421 Dec 2, 2022
007786e
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Dec 2, 2022
d1a47b6
ac/atHitInfo -> HitElem
Dragorn421 Dec 4, 2022
af4b465
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Dec 8, 2022
551e8b2
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Dec 11, 2022
80afa65
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Dec 13, 2022
5065923
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Dec 19, 2022
d367214
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Dec 26, 2022
1d3dd9d
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Dec 30, 2022
a7c4ac6
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Jan 13, 2023
8d32d9f
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Aug 15, 2023
cd5528a
rename some collider elements to "elem" (instead of item, info, hurtb…
Dragorn421 Aug 15, 2023
2528f33
cut down on more "hitbox" usage
Dragorn421 Aug 15, 2023
03c1698
Merge branch 'master' into cleanup_colchk_1
Dragorn421 Sep 20, 2023
4217212
name all `ColliderElement*` temps properly
Dragorn421 Sep 20, 2023
a533b6e
Merge branch 'main' into cleanup_colchk_1
Dragorn421 Oct 15, 2023
0c86eab
rearrange colcheck structs
fig02 Jan 7, 2024
72dd3b6
add collider shape name descriptions
fig02 Jan 7, 2024
d5d60bf
reword collider shape descriptions
fig02 Jan 7, 2024
e2e2446
jntsph first again
fig02 Jan 7, 2024
9123617
Merge pull request #3 from fig02/colcheck_header
Dragorn421 Jan 7, 2024
284162b
merge main
fig02 Jan 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
69 changes: 34 additions & 35 deletions include/functions.h
Original file line number Diff line number Diff line change
Expand Up @@ -504,7 +504,7 @@ void func_8003555C(PlayState* play, Vec3f* pos, Vec3f* velocity, Vec3f* accel);
void func_800355B8(PlayState* play, Vec3f* pos);
u8 func_800355E4(PlayState* play, Collider* collider);
u8 Actor_ApplyDamage(Actor* actor);
void Actor_SetDropFlag(Actor* actor, ColliderInfo* colInfo, s32 freezeFlag);
void Actor_SetDropFlag(Actor* actor, ColliderElement* elem, s32 freezeFlag);
void Actor_SetDropFlagJntSph(Actor* actor, ColliderJntSph* jntSph, s32 freezeFlag);
void func_80035844(Vec3f* arg0, Vec3f* arg1, Vec3s* arg2, s32 arg3);
Actor* func_800358DC(Actor* actor, Vec3f* spawnPos, Vec3s* spawnRot, f32* arg3, s32 timer, s16* unused,
Expand Down Expand Up @@ -672,44 +672,43 @@ DamageTable* DamageTable_Get(s32 index);
void DamageTable_Clear(DamageTable* table);
void Collider_DrawRedPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC);
void Collider_DrawPoly(GraphicsContext* gfxCtx, Vec3f* vA, Vec3f* vB, Vec3f* vC, u8 r, u8 g, u8 b);
s32 Collider_InitJntSph(PlayState* play, ColliderJntSph* collider);
s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* collider);
s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* collider);
s32 Collider_InitJntSph(PlayState* play, ColliderJntSph* jntSph);
s32 Collider_FreeJntSph(PlayState* play, ColliderJntSph* jntSph);
s32 Collider_DestroyJntSph(PlayState* play, ColliderJntSph* jntSph);
s32 Collider_SetJntSphToActor(PlayState* play, ColliderJntSph* dest, ColliderJntSphInitToActor* src);
s32 Collider_SetJntSphAllocType1(PlayState* play, ColliderJntSph* dest, Actor* actor,
ColliderJntSphInitType1* src);
s32 Collider_SetJntSphAlloc(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src);
s32 Collider_SetJntSph(PlayState* play, ColliderJntSph* dest, Actor* actor, ColliderJntSphInit* src,
ColliderJntSphElement* elements);
s32 Collider_ResetJntSphAT(PlayState* play, Collider* collider);
s32 Collider_ResetJntSphAC(PlayState* play, Collider* collider);
s32 Collider_ResetJntSphOC(PlayState* play, Collider* collider);
s32 Collider_InitCylinder(PlayState* play, ColliderCylinder* collider);
s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* collider);
s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* collider, ColliderCylinderInitToActor* src);
s32 Collider_SetCylinderType1(PlayState* play, ColliderCylinder* collider, Actor* actor,
ColliderCylinderInitType1* src);
s32 Collider_SetCylinder(PlayState* play, ColliderCylinder* collider, Actor* actor, ColliderCylinderInit* src);
s32 Collider_ResetCylinderAT(PlayState* play, Collider* collider);
s32 Collider_ResetCylinderAC(PlayState* play, Collider* collider);
s32 Collider_ResetCylinderOC(PlayState* play, Collider* collider);
ColliderJntSphElement* jntSphElements);
s32 Collider_ResetJntSphAT(PlayState* play, Collider* col);
s32 Collider_ResetJntSphAC(PlayState* play, Collider* col);
s32 Collider_ResetJntSphOC(PlayState* play, Collider* col);
s32 Collider_InitCylinder(PlayState* play, ColliderCylinder* cyl);
s32 Collider_DestroyCylinder(PlayState* play, ColliderCylinder* cyl);
s32 Collider_SetCylinderToActor(PlayState* play, ColliderCylinder* dest, ColliderCylinderInitToActor* src);
s32 Collider_SetCylinderType1(PlayState* play, ColliderCylinder* dest, Actor* actor, ColliderCylinderInitType1* src);
s32 Collider_SetCylinder(PlayState* play, ColliderCylinder* dest, Actor* actor, ColliderCylinderInit* src);
s32 Collider_ResetCylinderAT(PlayState* play, Collider* col);
s32 Collider_ResetCylinderAC(PlayState* play, Collider* col);
s32 Collider_ResetCylinderOC(PlayState* play, Collider* col);
s32 Collider_InitTris(PlayState* play, ColliderTris* tris);
s32 Collider_FreeTris(PlayState* play, ColliderTris* tris);
s32 Collider_DestroyTris(PlayState* play, ColliderTris* tris);
s32 Collider_SetTrisAllocType1(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInitType1* src);
s32 Collider_SetTrisAlloc(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src);
s32 Collider_SetTris(PlayState* play, ColliderTris* dest, Actor* actor, ColliderTrisInit* src,
ColliderTrisElement* elements);
s32 Collider_ResetTrisAT(PlayState* play, Collider* collider);
s32 Collider_ResetTrisAC(PlayState* play, Collider* collider);
s32 Collider_ResetTrisOC(PlayState* play, Collider* collider);
s32 Collider_InitQuad(PlayState* play, ColliderQuad* collider);
s32 Collider_DestroyQuad(PlayState* play, ColliderQuad* collider);
s32 Collider_SetQuadType1(PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInitType1* src);
s32 Collider_SetQuad(PlayState* play, ColliderQuad* collider, Actor* actor, ColliderQuadInit* src);
s32 Collider_ResetQuadAT(PlayState* play, Collider* collider);
s32 Collider_ResetQuadAC(PlayState* play, Collider* collider);
s32 Collider_ResetQuadOC(PlayState* play, Collider* collider);
ColliderTrisElement* trisElements);
s32 Collider_ResetTrisAT(PlayState* play, Collider* col);
s32 Collider_ResetTrisAC(PlayState* play, Collider* col);
s32 Collider_ResetTrisOC(PlayState* play, Collider* col);
s32 Collider_InitQuad(PlayState* play, ColliderQuad* quad);
s32 Collider_DestroyQuad(PlayState* play, ColliderQuad* quad);
s32 Collider_SetQuadType1(PlayState* play, ColliderQuad* dest, Actor* actor, ColliderQuadInitType1* src);
s32 Collider_SetQuad(PlayState* play, ColliderQuad* dest, Actor* actor, ColliderQuadInit* src);
s32 Collider_ResetQuadAT(PlayState* play, Collider* col);
s32 Collider_ResetQuadAC(PlayState* play, Collider* col);
s32 Collider_ResetQuadOC(PlayState* play, Collider* col);
s32 Collider_InitLine(PlayState* play, OcLine* line);
s32 Collider_DestroyLine(PlayState* play, OcLine* line);
s32 Collider_SetLinePoints(PlayState* play, OcLine* ocLine, Vec3f* a, Vec3f* b);
Expand All @@ -720,7 +719,7 @@ void CollisionCheck_DestroyContext(PlayState* play, CollisionCheckContext* colCh
void CollisionCheck_ClearContext(PlayState* play, CollisionCheckContext* colChkCtx);
void CollisionCheck_EnableSAC(PlayState* play, CollisionCheckContext* colChkCtx);
void CollisionCheck_DisableSAC(PlayState* play, CollisionCheckContext* colChkCtx);
void Collider_Draw(PlayState* play, Collider* collider);
void Collider_Draw(PlayState* play, Collider* col);
void CollisionCheck_DrawCollision(PlayState* play, CollisionCheckContext* colChkCtx);
s32 CollisionCheck_SetAT(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider);
s32 CollisionCheck_SetAT_SAC(PlayState* play, CollisionCheckContext* colChkCtx, Collider* collider, s32 index);
Expand All @@ -742,12 +741,12 @@ void CollisionCheck_Damage(PlayState* play, CollisionCheckContext* colChkCtx);
s32 CollisionCheck_LineOCCheckAll(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b);
s32 CollisionCheck_LineOCCheck(PlayState* play, CollisionCheckContext* colChkCtx, Vec3f* a, Vec3f* b,
Actor** exclusions, s32 numExclusions);
void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* collider);
void Collider_SetCylinderPosition(ColliderCylinder* collider, Vec3s* pos);
void Collider_SetQuadVertices(ColliderQuad* collider, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d);
void Collider_SetTrisVertices(ColliderTris* collider, s32 index, Vec3f* a, Vec3f* b, Vec3f* c);
void Collider_SetTrisDim(PlayState* play, ColliderTris* collider, s32 index, ColliderTrisElementDimInit* src);
void Collider_UpdateSpheres(s32 limb, ColliderJntSph* collider);
void Collider_UpdateCylinder(Actor* actor, ColliderCylinder* cyl);
void Collider_SetCylinderPosition(ColliderCylinder* cyl, Vec3s* pos);
void Collider_SetQuadVertices(ColliderQuad* quad, Vec3f* a, Vec3f* b, Vec3f* c, Vec3f* d);
void Collider_SetTrisVertices(ColliderTris* tris, s32 elemIndex, Vec3f* a, Vec3f* b, Vec3f* c);
void Collider_SetTrisDim(PlayState* play, ColliderTris* tris, s32 elemIndex, ColliderTrisElementDimInit* src);
void Collider_UpdateSpheres(s32 limb, ColliderJntSph* jntSph);
void CollisionCheck_SpawnRedBlood(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnWaterDroplets(PlayState* play, Vec3f* v);
void CollisionCheck_SpawnShieldParticles(PlayState* play, Vec3f* v);
Expand Down
2 changes: 2 additions & 0 deletions include/z64.h
Original file line number Diff line number Diff line change
Expand Up @@ -848,6 +848,8 @@ typedef struct {
/* 0x74 */ s16 unk_74[2]; // context-specific data used by the current scene draw config
} RoomContext; // size = 0x78

#define SAC_ENABLE (1 << 0)
Dragorn421 marked this conversation as resolved.
Show resolved Hide resolved

typedef struct {
/* 0x000 */ s16 colATCount;
/* 0x002 */ u16 sacFlags;
Expand Down
Loading