1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-10 08:50:23 +00:00

Document Collision_Check (#468)

* Darkmeiro decompilation

Bg_Gnd_Darkmeiro decompiled, matched, and documented.

* give this a shot

* fix conflict

* one more try

* could be useful

* whoops

* some decomp

* still playing around with this

* rename functions

* ZAP again

* ZAP again

* the renaming begins

* more renaming. hopefully didn't break anything

* change all the things

* this and then merge

* and done

* one little thing

* small docs, small rename

* changed mind on cylinder and quad elements

* something

* more stuff

* more docs

* more adjustments

* Fixed some types

* more fixes

* all sorts of cleanup

* now with flags

* match!

* names and such

* update tools

* damage tables

* ColChkInfo

* one more thing

* formatting

* more formatting

* anime merge

* some stuff

* damage table

* again

* changes

* .s

* changes

* oc2 type

* a couple things

* format

* un-name magic arrows, not enough proof yet

* fix damage table script and remove old one

* EnAObj

* changes

Co-authored-by: petrie911 <pmontag@DESKTOP-LG8A167.localdomain>
Co-authored-by: Fig02 <fig02srl@gmail.com>
This commit is contained in:
petrie911 2021-01-17 20:13:36 -06:00 committed by GitHub
parent f786f958bb
commit 02994f5339
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
487 changed files with 14371 additions and 4713 deletions

View file

@ -33,17 +33,31 @@ const ActorInit Obj_Comb_InitVars = {
(ActorFunc)ObjComb_Draw,
};
static ColliderJntSphItemInit sJntSphItemsInit[1] = {
static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{ 0x00, { 0x00000000, 0x00, 0x00 }, { 0x4001FFFE, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
{ 0x00, { { 0, 0, 0 }, 15 }, 100 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x00 },
{ 0x4001FFFE, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON,
OCELEM_ON,
},
{ 0, { { 0, 0, 0 }, 15 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK10, 0x00, 0x09, 0x09, 0x20, COLSHAPE_JNTSPH },
{
COLTYPE_NONE,
AT_NONE,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_PLAYER,
OC2_TYPE_2,
COLSHAPE_JNTSPH,
},
1,
&sJntSphItemsInit,
sJntSphElementsInit,
};
static InitChainEntry sInitChain[] = {
@ -60,7 +74,7 @@ void ObjComb_Break(ObjComb* this, GlobalContext* globalCtx) {
Vec3f pos1;
Vec3f pos;
Vec3f velocity;
Gfx** dlist = D_05009940;
Gfx* dlist = D_05009940;
s16 scale;
s16 angle = 0;
s16 gravity;
@ -131,7 +145,7 @@ void ObjComb_ChooseItemDrop(ObjComb* this, GlobalContext* globalCtx) {
params = -1;
}
if (params >= 0) {
Item_DropCollectible(globalCtx, &this->actor.posRot, params);
Item_DropCollectible(globalCtx, &this->actor.posRot.pos, params);
}
}
}
@ -141,7 +155,7 @@ void ObjComb_Init(Actor* thisx, GlobalContext* globalCtx) {
Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, this, &sJntSphInit, &this->colliderItems);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->colliderItems);
ObjComb_SetupWait(this);
}
@ -157,17 +171,17 @@ void ObjComb_SetupWait(ObjComb* this) {
}
void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) {
s32 toucherFlags;
s32 dmgFlags;
this->unk_1B0 -= 50;
if (this->unk_1B0 < 0) {
this->unk_1B0 = 0;
}
if ((this->collider.base.acFlags & 0x2) != 0) {
this->collider.base.acFlags &= ~0x2;
toucherFlags = this->collider.list->body.acHitItem->toucher.flags;
if (toucherFlags & 0x4001F866) {
if ((this->collider.base.acFlags & AC_HIT) != 0) {
this->collider.base.acFlags &= ~AC_HIT;
dmgFlags = this->collider.elements[0].info.acHitInfo->toucher.dmgFlags;
if (dmgFlags & 0x4001F866) {
this->unk_1B0 = 1500;
} else {
ObjComb_Break(this, globalCtx);
@ -175,11 +189,11 @@ void ObjComb_Wait(ObjComb* this, GlobalContext* globalCtx) {
Actor_Kill(&this->actor);
}
} else {
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
if (this->actor.update != NULL) {
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider);
CollisionCheck_SetOC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
}
}
@ -211,7 +225,7 @@ void ObjComb_Draw(Actor* thisx, GlobalContext* globalCtx) {
gSPDisplayList(POLY_OPA_DISP++, D_050095B0);
func_800628A4(0, &this->collider);
Collider_UpdateSpheres(0, &this->collider);
CLOSE_DISPS(globalCtx->state.gfxCtx, "../z_obj_comb.c", 402);
}

View file

@ -12,7 +12,7 @@ typedef struct ObjComb {
/* 0x0000 */ Actor actor;
/* 0x014C */ ObjCombActionFunc actionFunc;
/* 0x0150 */ ColliderJntSph collider;
/* 0x0170 */ ColliderJntSphItem colliderItems[1];
/* 0x0170 */ ColliderJntSphElement colliderItems[1];
/* 0x01B0 */ s16 unk_1B0;
/* 0x01B2 */ s16 unk_1B2;
} ObjComb; // size = 0x01B4