1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-08-06 22:30: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,14 +30,42 @@ const ActorInit En_Bx_InitVars = {
};
static ColliderCylinderInit sCylinderInit = {
{ COLTYPE_UNK6, 0x11, 0x09, 0x00, 0x00, COLSHAPE_CYLINDER },
{ 0x01, { 0xFFCFFFFF, 0x03, 0x04 }, { 0xFFCFFFFF, 0x01, 0x00 }, 0x01, 0x01, 0x00 },
{
COLTYPE_HIT6,
AT_ON | AT_TYPE_ENEMY,
AC_ON | AC_TYPE_PLAYER,
OC1_NONE,
OC2_NONE,
COLSHAPE_CYLINDER,
},
{
ELEMTYPE_UNK1,
{ 0xFFCFFFFF, 0x03, 0x04 },
{ 0xFFCFFFFF, 0x01, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_ON,
OCELEM_NONE,
},
{ 60, 100, 100, { 0, 0, 0 } },
};
static ColliderQuadInit sQuadInit = {
{ COLTYPE_UNK10, 0x11, 0x00, 0x00, 0x00, COLSHAPE_QUAD },
{ 0x00, { 0xFFCFFFFF, 0x03, 0x04 }, { 0x00000000, 0x00, 0x00 }, 0x01, 0x00, 0x00 },
{
COLTYPE_NONE,
AT_ON | AT_TYPE_ENEMY,
AC_NONE,
OC1_NONE,
OC2_NONE,
COLSHAPE_QUAD,
},
{
ELEMTYPE_UNK0,
{ 0xFFCFFFFF, 0x03, 0x04 },
{ 0x00000000, 0x00, 0x00 },
TOUCH_ON | TOUCH_SFX_NORMAL,
BUMP_NONE,
OCELEM_NONE,
},
{ { { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f }, { 0.0f, 0.0f, 0.0f } } },
};
@ -70,7 +98,7 @@ void EnBx_Init(Actor* thisx, GlobalContext* globalCtx) {
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &sCylinderInit);
Collider_InitQuad(globalCtx, &this->colliderQuad);
Collider_SetQuad(globalCtx, &this->colliderQuad, &this->actor, &sQuadInit);
thisx->colChkInfo.mass = 0xFF;
thisx->colChkInfo.mass = MASS_IMMOVABLE;
this->unk_14C = 0;
thisx->uncullZoneDownward = 2000.0f;
if (Flags_GetSwitch(globalCtx, (thisx->params >> 8) & 0xFF)) {
@ -98,7 +126,8 @@ void func_809D1D0C(Actor* thisx, GlobalContext* globalCtx) {
Matrix_MultVec3f(&D_809D254C, &sp38);
Matrix_MultVec3f(&sp5C, &this->colliderQuad.dim.quad[1]);
Matrix_MultVec3f(&sp50, &this->colliderQuad.dim.quad[0]);
func_80062734(&this->colliderQuad, &sp38, &sp44, &this->colliderQuad.dim.quad[0], &this->colliderQuad.dim.quad[1]);
Collider_SetQuadVertices(&this->colliderQuad, &sp38, &sp44, &this->colliderQuad.dim.quad[0],
&this->colliderQuad.dim.quad[1]);
}
void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) {
@ -108,8 +137,8 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) {
s16 tmp32;
s32 tmp33;
if ((thisx->xzDistToLink <= 70.0f) || (this->collider.base.atFlags & 2) || (this->collider.base.acFlags & 2) ||
(this->colliderQuad.base.atFlags & 2)) {
if ((thisx->xzDistToLink <= 70.0f) || (this->collider.base.atFlags & AT_HIT) ||
(this->collider.base.acFlags & AC_HIT) || (this->colliderQuad.base.atFlags & AT_HIT)) {
if ((thisx->xzDistToLink <= 70.0f) || (&player->actor == this->collider.base.at) ||
(&player->actor == this->collider.base.ac) || (&player->actor == this->colliderQuad.base.at)) {
tmp33 = player->invincibilityTimer & 0xFF;
@ -130,9 +159,9 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) {
player->invincibilityTimer = tmp33;
}
this->collider.base.atFlags &= ~2;
this->collider.base.acFlags &= ~2;
this->colliderQuad.base.atFlags &= ~2;
this->collider.base.atFlags &= ~AT_HIT;
this->collider.base.acFlags &= ~AC_HIT;
this->colliderQuad.base.atFlags &= ~AT_HIT;
this->colliderQuad.base.at = NULL;
this->collider.base.ac = NULL;
this->collider.base.at = NULL;
@ -160,7 +189,7 @@ void EnBx_Update(Actor* thisx, GlobalContext* globalCtx) {
Audio_PlayActorSound2(thisx, NA_SE_EN_BIRI_SPARK - SFX_FLAG);
}
thisx->posRot2.pos = thisx->posRot.pos;
Collider_CylinderUpdate(thisx, &this->collider);
Collider_UpdateCylinder(thisx, &this->collider);
CollisionCheck_SetAC(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
CollisionCheck_SetAT(globalCtx, &globalCtx->colChkCtx, &this->collider.base);
if (thisx->params & 0x80) {