1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-07 14:50:15 +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

@ -30,20 +30,34 @@ const ActorInit En_Fw_InitVars = {
(ActorFunc)EnFw_Draw,
};
static ColliderJntSphItemInit sJntSphItemsInit[1] = {
static ColliderJntSphElementInit sJntSphElementsInit[1] = {
{
{ 0x00, { 0x00000000, 0x00, 0x04 }, { 0xFFCFFFFE, 0x00, 0x00 }, 0x00, 0x05, 0x01 },
{
ELEMTYPE_UNK0,
{ 0x00000000, 0x00, 0x04 },
{ 0xFFCFFFFE, 0x00, 0x00 },
TOUCH_NONE,
BUMP_ON | BUMP_HOOKABLE,
OCELEM_ON,
},
{ 2, { { 1200, 0, 0 }, 16 }, 100 },
},
};
static ColliderJntSphInit sJntSphInit = {
{ COLTYPE_UNK6, 0x11, 0x09, 0x39, 0x10, COLSHAPE_JNTSPH },
{
COLTYPE_HIT6,
AT_ON | AT_TYPE_ENEMY,
AC_ON | AC_TYPE_PLAYER,
OC1_ON | OC1_TYPE_ALL,
OC2_TYPE_1,
COLSHAPE_JNTSPH,
},
1,
sJntSphItemsInit,
sJntSphElementsInit,
};
static CollisionCheckInfoInit2 D_80A1FB94 = { 8, 2, 25, 25, 0xFF };
static CollisionCheckInfoInit2 D_80A1FB94 = { 8, 2, 25, 25, MASS_IMMOVABLE };
static struct_80034EC0_Entry D_80A1FBA0[] = {
{ 0x06006CF8, 0.0f, 0.0f, -1.0f, 0x03, 0.0f },
@ -116,17 +130,17 @@ Vec3f* EnFw_GetPosAdjAroundCircle(Vec3f* dst, EnFw* this, f32 radius, s16 dir) {
}
s32 EnFw_CheckCollider(EnFw* this, GlobalContext* globalCtx) {
ColliderBody* body;
ColliderInfo* info;
s32 phi_return;
if (this->collider.base.acFlags & 2) {
body = &this->collider.list[0].body;
if (body->acHitItem->toucher.flags & 0x80) {
if (this->collider.base.acFlags & AC_HIT) {
info = &this->collider.elements[0].info;
if (info->acHitInfo->toucher.dmgFlags & 0x80) {
this->lastDmgHook = true;
} else {
this->lastDmgHook = false;
}
this->collider.base.acFlags &= ~2;
this->collider.base.acFlags &= ~AC_HIT;
if (Actor_ApplyDamage(&this->actor) <= 0) {
if (this->actor.parent->colChkInfo.health <= 8) {
func_80032C7C(globalCtx, &this->actor);
@ -174,7 +188,7 @@ void EnFw_Init(Actor* thisx, GlobalContext* globalCtx) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawFunc_Circle, 20.0f);
Collider_InitJntSph(globalCtx, &this->collider);
Collider_SetJntSph(globalCtx, &this->collider, &this->actor, &sJntSphInit, this->sphs);
func_80061EFC(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, DamageTable_Get(0x10), &D_80A1FB94);
Actor_SetScale(&this->actor, 0.01f);
this->runDirection = -this->actor.params;
this->actionFunc = EnFw_Bounce;
@ -369,7 +383,7 @@ void EnFw_PostLimbDraw(GlobalContext* globalCtx, s32 limbIndex, Gfx** dList, Vec
Matrix_MultVec3f(&zeroVec, &this->actor.posRot2.pos);
}
func_800628A4(limbIndex, &this->collider);
Collider_UpdateSpheres(limbIndex, &this->collider);
}
void EnFw_Draw(Actor* thisx, GlobalContext* globalCtx) {

View file

@ -26,7 +26,7 @@ typedef struct EnFw {
/* 0x014C */ SkelAnime skelAnime;
/* 0x0190 */ EnFwActionFunc actionFunc;
/* 0x0194 */ ColliderJntSph collider;
/* 0x01B4 */ ColliderJntSphItem sphs[1];
/* 0x01B4 */ ColliderJntSphElement sphs[1];
/* 0x01F4 */ Vec3f bompPos;
/* 0x0200 */ u8 lastDmgHook;
/* 0x0202 */ s16 runDirection;