1
0
Fork 0
mirror of https://github.com/zeldaret/oot.git synced 2025-07-04 06:54:33 +00:00

Cleanup colliders 4 (#2470)

* cleanup around `ColliderJntSphElement` usage

* cleanup around `ColliderCylinder` usage

* cleanup around `ColliderCylinderInit` usage

* cleanup around `ColliderTrisElement`, `ColliderTris` usage

* cleanup around `ColliderTrisElementInit`, `ColliderTrisInit` usage

* cleanup around `ColliderQuadInit` usage

* sColliderInit -> sCollider<Type>Init

* format

* triElemInit -> triElementInit
This commit is contained in:
Dragorn421 2025-05-26 19:15:33 +02:00 committed by GitHub
parent c854743d84
commit b3a16a61d4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
31 changed files with 198 additions and 194 deletions

View file

@ -50,7 +50,7 @@ ActorProfile Bg_Dodoago_Profile = {
/**/ BgDodoago_Draw, /**/ BgDodoago_Draw,
}; };
static ColliderCylinderInit sColCylinderInitMain = { static ColliderCylinderInit sMainColliderCylinderInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_NONE, AT_NONE,
@ -70,7 +70,7 @@ static ColliderCylinderInit sColCylinderInitMain = {
{ 80, 30, 80, { 0, 0, 0 } }, { 80, 30, 80, { 0, 0, 0 } },
}; };
static ColliderCylinderInit sColCylinderInitLeftRight = { static ColliderCylinderInit sLeftRightColliderCylinderInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_NONE, AT_NONE,
@ -146,9 +146,9 @@ void BgDodoago_Init(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->mainCollider); Collider_InitCylinder(play, &this->mainCollider);
Collider_InitCylinder(play, &this->leftCollider); Collider_InitCylinder(play, &this->leftCollider);
Collider_InitCylinder(play, &this->rightCollider); Collider_InitCylinder(play, &this->rightCollider);
Collider_SetCylinder(play, &this->mainCollider, &this->dyna.actor, &sColCylinderInitMain); Collider_SetCylinder(play, &this->mainCollider, &this->dyna.actor, &sMainColliderCylinderInit);
Collider_SetCylinder(play, &this->leftCollider, &this->dyna.actor, &sColCylinderInitLeftRight); Collider_SetCylinder(play, &this->leftCollider, &this->dyna.actor, &sLeftRightColliderCylinderInit);
Collider_SetCylinder(play, &this->rightCollider, &this->dyna.actor, &sColCylinderInitLeftRight); Collider_SetCylinder(play, &this->rightCollider, &this->dyna.actor, &sLeftRightColliderCylinderInit);
BgDodoago_SetupAction(this, BgDodoago_WaitExplosives); BgDodoago_SetupAction(this, BgDodoago_WaitExplosives);
sDisableBombCatcher = false; sDisableBombCatcher = false;

View file

@ -142,7 +142,7 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) {
BgHakaSgami* this = (BgHakaSgami*)thisx; BgHakaSgami* this = (BgHakaSgami*)thisx;
EffectBlureInit1 blureInit; EffectBlureInit1 blureInit;
s32 i; s32 i;
ColliderTris* colliderScythe = &this->colliderScythe; ColliderTris* scytheCollider = &this->scytheCollider;
Actor_ProcessInitChain(thisx, sInitChain); Actor_ProcessInitChain(thisx, sInitChain);
@ -153,8 +153,8 @@ void BgHakaSgami_Init(Actor* thisx, PlayState* play) {
thisx->flags |= ACTOR_FLAG_REACT_TO_LENS; thisx->flags |= ACTOR_FLAG_REACT_TO_LENS;
} }
Collider_InitTris(play, colliderScythe); Collider_InitTris(play, scytheCollider);
Collider_SetTris(play, colliderScythe, thisx, &sTrisInit, this->colliderScytheItems); Collider_SetTris(play, scytheCollider, thisx, &sTrisInit, this->scytheColliderElements);
Collider_InitCylinder(play, &this->scytheCenterCollider); Collider_InitCylinder(play, &this->scytheCenterCollider);
Collider_SetCylinder(play, &this->scytheCenterCollider, thisx, &sCylinderInit); Collider_SetCylinder(play, &this->scytheCenterCollider, thisx, &sCylinderInit);
@ -199,7 +199,7 @@ void BgHakaSgami_Destroy(Actor* thisx, PlayState* play) {
Effect_Delete(play, this->blureEffectIndex[0]); Effect_Delete(play, this->blureEffectIndex[0]);
Effect_Delete(play, this->blureEffectIndex[1]); Effect_Delete(play, this->blureEffectIndex[1]);
Collider_DestroyTris(play, &this->colliderScythe); Collider_DestroyTris(play, &this->scytheCollider);
Collider_DestroyCylinder(play, &this->scytheCenterCollider); Collider_DestroyCylinder(play, &this->scytheCenterCollider);
} }
@ -256,14 +256,14 @@ void BgHakaSgami_Spin(BgHakaSgami* this, PlayState* play) {
elementInit->dim.vtx[j].x * actorRotYSin; elementInit->dim.vtx[j].x * actorRotYSin;
} }
Collider_SetTrisVertices(&this->colliderScythe, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]); Collider_SetTrisVertices(&this->scytheCollider, i, &scytheVertices[0], &scytheVertices[1], &scytheVertices[2]);
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x; scytheVertices[j].x = (2 * this->actor.world.pos.x) - scytheVertices[j].x;
scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z; scytheVertices[j].z = (2 * this->actor.world.pos.z) - scytheVertices[j].z;
} }
Collider_SetTrisVertices(&this->colliderScythe, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1], Collider_SetTrisVertices(&this->scytheCollider, (i + 2) % 4, &scytheVertices[0], &scytheVertices[1],
&scytheVertices[2]); &scytheVertices[2]);
} }
@ -288,7 +288,7 @@ void BgHakaSgami_Spin(BgHakaSgami* this, PlayState* play) {
EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[1]), &scytheVertices[0], &scytheVertices[1]); EffectBlure_AddVertex(Effect_GetByIndex(this->blureEffectIndex[1]), &scytheVertices[0], &scytheVertices[1]);
} }
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderScythe.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->scytheCollider.base);
CollisionCheck_SetOC(play, &play->colChkCtx, &this->scytheCenterCollider.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->scytheCenterCollider.base);
Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_ROLLCUTTER_MOTOR - SFX_FLAG); Actor_PlaySfx_Flagged(&this->actor, NA_SE_EV_ROLLCUTTER_MOTOR - SFX_FLAG);
} }

View file

@ -16,8 +16,8 @@ typedef struct BgHakaSgami {
/* 0x0152 */ s16 timer; /* 0x0152 */ s16 timer;
/* 0x0154 */ s32 blureEffectIndex[2]; /* 0x0154 */ s32 blureEffectIndex[2];
/* 0x015C */ ColliderCylinder scytheCenterCollider; /* 0x015C */ ColliderCylinder scytheCenterCollider;
/* 0x01A8 */ ColliderTris colliderScythe; /* 0x01A8 */ ColliderTris scytheCollider;
/* 0x01C8 */ ColliderTrisElement colliderScytheItems[4]; /* 0x01C8 */ ColliderTrisElement scytheColliderElements[4];
} BgHakaSgami; // size = 0x0338 } BgHakaSgami; // size = 0x0338
#endif #endif

View file

@ -171,8 +171,8 @@ void BgHakaTrap_Init(Actor* thisx, PlayState* play) {
CollisionHeader_GetVirtual(&object_haka_objects_Col_008D10, &colHeader); CollisionHeader_GetVirtual(&object_haka_objects_Col_008D10, &colHeader);
} }
Collider_InitTris(play, &this->colliderSpikes); Collider_InitTris(play, &this->spikesCollider);
Collider_SetTris(play, &this->colliderSpikes, thisx, &sTrisInit, this->colliderSpikesItem); Collider_SetTris(play, &this->spikesCollider, thisx, &sTrisInit, this->spikesColliderElements);
this->colliderCylinder.dim.radius = 18; this->colliderCylinder.dim.radius = 18;
this->colliderCylinder.dim.height = 115; this->colliderCylinder.dim.height = 115;
@ -202,7 +202,7 @@ void BgHakaTrap_Destroy(Actor* thisx, PlayState* play) {
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
if ((this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) || if ((this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL) ||
(this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL_2)) { (this->dyna.actor.params == HAKA_TRAP_SPIKED_WALL_2)) {
Collider_DestroyTris(play, &this->colliderSpikes); Collider_DestroyTris(play, &this->spikesCollider);
} }
} }
@ -253,7 +253,7 @@ void func_808801B8(BgHakaTrap* this, PlayState* play) {
func_8087FFC0(this, play); func_8087FFC0(this, play);
if (this->colliderSpikes.base.acFlags & AC_HIT) { if (this->spikesCollider.base.acFlags & AC_HIT) {
this->timer = 20; this->timer = 20;
D_80880F30 = 1; D_80880F30 = 1;
this->actionFunc = func_808802D8; this->actionFunc = func_808802D8;
@ -502,7 +502,7 @@ void BgHakaTrap_Update(Actor* thisx, PlayState* play) {
CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base); CollisionCheck_SetOC(play, &play->colChkCtx, &this->colliderCylinder.base);
} else { } else {
if (this->actionFunc == func_808801B8) { if (this->actionFunc == func_808801B8) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderSpikes.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->spikesCollider.base);
} }
CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->colliderCylinder.base);
@ -518,10 +518,10 @@ void func_80880D68(BgHakaTrap* this) {
Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[0], &vec1); Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[0], &vec1);
Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[1], &vec2); Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[1], &vec2);
Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[2], &vec3); Matrix_MultVec3f(&sTrisElementsInit[0].dim.vtx[2], &vec3);
Collider_SetTrisVertices(&this->colliderSpikes, 0, &vec1, &vec2, &vec3); Collider_SetTrisVertices(&this->spikesCollider, 0, &vec1, &vec2, &vec3);
Matrix_MultVec3f(&sTrisElementsInit[1].dim.vtx[2], &vec2); Matrix_MultVec3f(&sTrisElementsInit[1].dim.vtx[2], &vec2);
Collider_SetTrisVertices(&this->colliderSpikes, 1, &vec1, &vec3, &vec2); Collider_SetTrisVertices(&this->spikesCollider, 1, &vec1, &vec3, &vec2);
} }
void BgHakaTrap_Draw(Actor* thisx, PlayState* play) { void BgHakaTrap_Draw(Actor* thisx, PlayState* play) {

View file

@ -25,8 +25,8 @@ typedef struct BgHakaTrap {
/* 0x016A */ s16 unk_16A; // used as boolean for HAKA_TRAP_GUILLOTINE_SLOW/FAST, s16 for HAKA_TRAP_SPIKED_BOX /* 0x016A */ s16 unk_16A; // used as boolean for HAKA_TRAP_GUILLOTINE_SLOW/FAST, s16 for HAKA_TRAP_SPIKED_BOX
/* 0x016C */ Vec3f unk_16C; /* 0x016C */ Vec3f unk_16C;
/* 0x0178 */ ColliderCylinder colliderCylinder; /* 0x0178 */ ColliderCylinder colliderCylinder;
/* 0x01C4 */ ColliderTris colliderSpikes; /* 0x01C4 */ ColliderTris spikesCollider;
/* 0x01E4 */ ColliderTrisElement colliderSpikesItem[2]; /* 0x01E4 */ ColliderTrisElement spikesColliderElements[2];
} BgHakaTrap; // size = 0x029C } BgHakaTrap; // size = 0x029C
#endif #endif

View file

@ -160,7 +160,7 @@ void BgHidanRsekizou_Destroy(Actor* thisx, PlayState* play) {
void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) { void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) {
BgHidanRsekizou* this = (BgHidanRsekizou*)thisx; BgHidanRsekizou* this = (BgHidanRsekizou*)thisx;
s32 i; s32 i;
ColliderJntSphElement* sphere; ColliderJntSphElement* element;
s32 pad; s32 pad;
f32 yawSine; f32 yawSine;
f32 yawCosine; f32 yawCosine;
@ -180,12 +180,14 @@ void BgHidanRsekizou_Update(Actor* thisx, PlayState* play) {
yawCosine = Math_CosS(this->dyna.actor.shape.rot.y); yawCosine = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) { for (i = 0; i < ARRAY_COUNT(this->colliderElements); i++) {
sphere = &this->collider.elements[i]; element = &this->collider.elements[i];
sphere->dim.worldSphere.center.x = this->dyna.actor.home.pos.x + yawCosine * sphere->dim.modelSphere.center.x + element->dim.worldSphere.center.x = this->dyna.actor.home.pos.x +
yawSine * sphere->dim.modelSphere.center.z; (yawCosine * element->dim.modelSphere.center.x) +
sphere->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + sphere->dim.modelSphere.center.y; (yawSine * element->dim.modelSphere.center.z);
sphere->dim.worldSphere.center.z = (this->dyna.actor.home.pos.z - yawSine * sphere->dim.modelSphere.center.x) + element->dim.worldSphere.center.y = (s16)this->dyna.actor.home.pos.y + element->dim.modelSphere.center.y;
yawCosine * sphere->dim.modelSphere.center.z; element->dim.worldSphere.center.z = this->dyna.actor.home.pos.z -
(yawSine * element->dim.modelSphere.center.x) +
(yawCosine * element->dim.modelSphere.center.z);
} }
CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->collider.base);

View file

@ -91,15 +91,15 @@ static InitChainEntry sInitChain[] = {
static CollisionHeader* sCollisionHeaders[] = { &gPillarCol, &gThroneCol }; static CollisionHeader* sCollisionHeaders[] = { &gPillarCol, &gThroneCol };
void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) { void BgJyaIronobj_InitCylinder(BgJyaIronobj* this, PlayState* play) {
ColliderCylinder* colCylinder = &this->colliderCylinder; s32 pad;
Collider_InitCylinder(play, colCylinder); Collider_InitCylinder(play, &this->colliderCylinder);
Collider_SetCylinder(play, colCylinder, &this->dyna.actor, &sCylinderInit); Collider_SetCylinder(play, &this->colliderCylinder, &this->dyna.actor, &sCylinderInit);
if (PARAMS_GET_U(this->dyna.actor.params, 0, 1) == 1) { if (PARAMS_GET_U(this->dyna.actor.params, 0, 1) == 1) {
this->colliderCylinder.dim.radius = 40; this->colliderCylinder.dim.radius = 40;
this->colliderCylinder.dim.height = 100; this->colliderCylinder.dim.height = 100;
} }
Collider_UpdateCylinder(&this->dyna.actor, colCylinder); Collider_UpdateCylinder(&this->dyna.actor, &this->colliderCylinder);
} }
/* /*

View file

@ -70,7 +70,7 @@ static InitChainEntry sInitChain[] = {
void BgMenkuriEye_Init(Actor* thisx, PlayState* play) { void BgMenkuriEye_Init(Actor* thisx, PlayState* play) {
BgMenkuriEye* this = (BgMenkuriEye*)thisx; BgMenkuriEye* this = (BgMenkuriEye*)thisx;
ColliderJntSphElement* colliderList; s32 pad;
Actor_ProcessInitChain(&this->actor, sInitChain); Actor_ProcessInitChain(&this->actor, sInitChain);
Collider_InitJntSph(play, &this->collider); Collider_InitJntSph(play, &this->collider);
@ -78,8 +78,7 @@ void BgMenkuriEye_Init(Actor* thisx, PlayState* play) {
this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x; this->collider.elements[0].dim.worldSphere.center.x = this->actor.world.pos.x;
this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y; this->collider.elements[0].dim.worldSphere.center.y = this->actor.world.pos.y;
this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z; this->collider.elements[0].dim.worldSphere.center.z = this->actor.world.pos.z;
colliderList = this->collider.elements; this->collider.elements[0].dim.worldSphere.radius = this->collider.elements[0].dim.modelSphere.radius;
colliderList->dim.worldSphere.radius = colliderList->dim.modelSphere.radius;
if (!Flags_GetSwitch(play, this->actor.params)) { if (!Flags_GetSwitch(play, this->actor.params)) {
sNumEyesShot = 0; sNumEyesShot = 0;
} }

View file

@ -44,7 +44,7 @@ ActorProfile Bg_Mizu_Bwall_Profile = {
/**/ BgMizuBwall_Draw, /**/ BgMizuBwall_Draw,
}; };
static ColliderTrisElementInit sTrisElementInitFloor[2] = { static ColliderTrisElementInit sTrisElementsInitFloor[2] = {
{ {
{ {
ELEM_MATERIAL_UNK0, ELEM_MATERIAL_UNK0,
@ -79,10 +79,10 @@ static ColliderTrisInit sTrisInitFloor = {
COLSHAPE_TRIS, COLSHAPE_TRIS,
}, },
2, 2,
sTrisElementInitFloor, sTrisElementsInitFloor,
}; };
static ColliderTrisElementInit sTrisElementInitRutoWall[1] = { static ColliderTrisElementInit sTrisElementsInitRutoWall[1] = {
{ {
{ {
ELEM_MATERIAL_UNK0, ELEM_MATERIAL_UNK0,
@ -106,10 +106,10 @@ static ColliderTrisInit sTrisInitRutoWall = {
COLSHAPE_TRIS, COLSHAPE_TRIS,
}, },
1, 1,
sTrisElementInitRutoWall, sTrisElementsInitRutoWall,
}; };
static ColliderTrisElementInit sTrisElementInitWall[2] = { static ColliderTrisElementInit sTrisElementsInitWall[2] = {
{ {
{ {
ELEM_MATERIAL_UNK0, ELEM_MATERIAL_UNK0,
@ -144,7 +144,7 @@ static ColliderTrisInit sTrisInitUnusedWall = {
COLSHAPE_TRIS, COLSHAPE_TRIS,
}, },
2, 2,
sTrisElementInitWall, sTrisElementsInitWall,
}; };
static ColliderTrisInit sTrisInitStingerWall = { static ColliderTrisInit sTrisInitStingerWall = {
@ -157,7 +157,7 @@ static ColliderTrisInit sTrisInitStingerWall = {
COLSHAPE_TRIS, COLSHAPE_TRIS,
}, },
2, 2,
sTrisElementInitWall, sTrisElementsInitWall,
}; };
static Gfx* sDLists[] = { static Gfx* sDLists[] = {
@ -219,7 +219,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
sin = Math_SinS(this->dyna.actor.shape.rot.y); sin = Math_SinS(this->dyna.actor.shape.rot.y);
cos = Math_CosS(this->dyna.actor.shape.rot.y); cos = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x; offset.x = sTrisInitFloor.elements[i].dim.vtx[j].x;
offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y; offset.y = sTrisInitFloor.elements[i].dim.vtx[j].y;
@ -260,7 +260,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
sin = Math_SinS(this->dyna.actor.shape.rot.y); sin = Math_SinS(this->dyna.actor.shape.rot.y);
cos = Math_CosS(this->dyna.actor.shape.rot.y); cos = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < ARRAY_COUNT(sTrisElementInitRutoWall); i++) { for (i = 0; i < ARRAY_COUNT(sTrisElementsInitRutoWall); i++) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
offset.x = sTrisInitRutoWall.elements[i].dim.vtx[j].x; offset.x = sTrisInitRutoWall.elements[i].dim.vtx[j].x;
offset.y = sTrisInitRutoWall.elements[i].dim.vtx[j].y; offset.y = sTrisInitRutoWall.elements[i].dim.vtx[j].y;
@ -301,7 +301,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
sin = Math_SinS(this->dyna.actor.shape.rot.y); sin = Math_SinS(this->dyna.actor.shape.rot.y);
cos = Math_CosS(this->dyna.actor.shape.rot.y); cos = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
//! @bug This uses the wrong set of collision triangles, causing the collider to be //! @bug This uses the wrong set of collision triangles, causing the collider to be
//! flat to the ground instead of vertical. It should use sTrisInitUnusedWall. //! flat to the ground instead of vertical. It should use sTrisInitUnusedWall.
@ -344,7 +344,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
sin = Math_SinS(this->dyna.actor.shape.rot.y); sin = Math_SinS(this->dyna.actor.shape.rot.y);
cos = Math_CosS(this->dyna.actor.shape.rot.y); cos = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
//! @bug This uses the wrong set of collision triangles, causing the collider to be //! @bug This uses the wrong set of collision triangles, causing the collider to be
//! flat to the ground instead of vertical. It should use sTrisInitStingerWall. //! flat to the ground instead of vertical. It should use sTrisInitStingerWall.
@ -387,7 +387,7 @@ void BgMizuBwall_Init(Actor* thisx, PlayState* play) {
sin = Math_SinS(this->dyna.actor.shape.rot.y); sin = Math_SinS(this->dyna.actor.shape.rot.y);
cos = Math_CosS(this->dyna.actor.shape.rot.y); cos = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < ARRAY_COUNT(sTrisElementInitFloor); i++) { for (i = 0; i < ARRAY_COUNT(sTrisElementsInitFloor); i++) {
for (j = 0; j < 3; j++) { for (j = 0; j < 3; j++) {
//! @bug This uses the wrong set of collision triangles, causing the collider to be //! @bug This uses the wrong set of collision triangles, causing the collider to be
//! flat to the ground instead of vertical. It should use sTrisInitStingerWall. //! flat to the ground instead of vertical. It should use sTrisInitStingerWall.

View file

@ -103,7 +103,7 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, PlayState* play) {
static s16 paintingPosX[] = { -1302, -866, 1421, 985 }; static s16 paintingPosX[] = { -1302, -866, 1421, 985 };
static s16 paintingPosY[] = { 1107, 1091 }; static s16 paintingPosY[] = { 1107, 1091 };
static s16 paintingPosZ[] = { -3384, -3252 }; static s16 paintingPosZ[] = { -3384, -3252 };
ColliderTrisElementInit* item; ColliderTrisElementInit* elementInit;
Vec3f* vtxVec; Vec3f* vtxVec;
s32 i1; s32 i1;
s32 i2; s32 i2;
@ -124,10 +124,10 @@ void BgPoEvent_InitPaintings(BgPoEvent* this, PlayState* play) {
scaleY = 1.0f; scaleY = 1.0f;
} }
for (i1 = 0; i1 < sTrisInit.count; i1++) { for (i1 = 0; i1 < sTrisInit.count; i1++) {
item = &sTrisInit.elements[i1]; elementInit = &sTrisInit.elements[i1];
if (1) {} // This section looks like a macro of some sort. if (1) {} // This section looks like a macro of some sort.
for (i2 = 0; i2 < 3; i2++) { for (i2 = 0; i2 < 3; i2++) {
vtxVec = &item->dim.vtx[i2]; vtxVec = &elementInit->dim.vtx[i2];
sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.home.pos.x + (sins * vtxVec->z)); sp9C[i2].x = (vtxVec->x * coss) + (this->dyna.actor.home.pos.x + (sins * vtxVec->z));
sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.home.pos.y; sp9C[i2].y = (vtxVec->y * scaleY) + this->dyna.actor.home.pos.y;
sp9C[i2].z = this->dyna.actor.home.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins); sp9C[i2].z = this->dyna.actor.home.pos.z + (coss * vtxVec->z) - (vtxVec->x * sins);

View file

@ -89,7 +89,7 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) {
f32 sinRotY; f32 sinRotY;
f32 cosRotY; f32 cosRotY;
CollisionHeader* colHeader = NULL; CollisionHeader* colHeader = NULL;
ColliderTrisElementInit* triInit; ColliderTrisElementInit* triElementInit;
Actor_ProcessInitChain(&this->dyna.actor, sInitChain); Actor_ProcessInitChain(&this->dyna.actor, sInitChain);
Collider_InitTris(play, &this->collider); Collider_InitTris(play, &this->collider);
@ -99,10 +99,10 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) {
thisx->params = PARAMS_GET_U(thisx->params, 8, 8); // thisx is required to match here thisx->params = PARAMS_GET_U(thisx->params, 8, 8); // thisx is required to match here
if (this->dyna.actor.params == 0) { if (this->dyna.actor.params == 0) {
triInit = &sTrisElementsInit[0]; triElementInit = &sTrisElementsInit[0];
this->actionFunc = func_808BEFF4; this->actionFunc = func_808BEFF4;
} else { } else {
triInit = &sTrisElementsInit[1]; triElementInit = &sTrisElementsInit[1];
DynaPolyActor_Init(&this->dyna, 0); DynaPolyActor_Init(&this->dyna, 0);
CollisionHeader_GetVirtual(&gDTFallingLadderCol, &colHeader); CollisionHeader_GetVirtual(&gDTFallingLadderCol, &colHeader);
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, thisx, colHeader);
@ -119,16 +119,16 @@ void BgYdanMaruta_Init(Actor* thisx, PlayState* play) {
cosRotY = Math_CosS(this->dyna.actor.shape.rot.y); cosRotY = Math_CosS(this->dyna.actor.shape.rot.y);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
sp4C[i].x = (triInit->dim.vtx[i].x * cosRotY) + this->dyna.actor.world.pos.x; sp4C[i].x = (triElementInit->dim.vtx[i].x * cosRotY) + this->dyna.actor.world.pos.x;
sp4C[i].y = triInit->dim.vtx[i].y + this->dyna.actor.world.pos.y; sp4C[i].y = triElementInit->dim.vtx[i].y + this->dyna.actor.world.pos.y;
sp4C[i].z = this->dyna.actor.world.pos.z - (triInit->dim.vtx[i].x * sinRotY); sp4C[i].z = this->dyna.actor.world.pos.z - (triElementInit->dim.vtx[i].x * sinRotY);
} }
Collider_SetTrisVertices(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]); Collider_SetTrisVertices(&this->collider, 0, &sp4C[0], &sp4C[1], &sp4C[2]);
sp4C[1].x = (triInit->dim.vtx[2].x * cosRotY) + this->dyna.actor.world.pos.x; sp4C[1].x = (triElementInit->dim.vtx[2].x * cosRotY) + this->dyna.actor.world.pos.x;
sp4C[1].y = triInit->dim.vtx[0].y + this->dyna.actor.world.pos.y; sp4C[1].y = triElementInit->dim.vtx[0].y + this->dyna.actor.world.pos.y;
sp4C[1].z = this->dyna.actor.world.pos.z - (triInit->dim.vtx[2].x * sinRotY); sp4C[1].z = this->dyna.actor.world.pos.z - (triElementInit->dim.vtx[2].x * sinRotY);
Collider_SetTrisVertices(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]); Collider_SetTrisVertices(&this->collider, 1, &sp4C[0], &sp4C[2], &sp4C[1]);
} }

View file

@ -51,7 +51,7 @@ ActorProfile Bg_Ydan_Sp_Profile = {
/**/ BgYdanSp_Draw, /**/ BgYdanSp_Draw,
}; };
static ColliderTrisElementInit sTrisItemsInit[2] = { static ColliderTrisElementInit sTrisElementsInit[2] = {
{ {
{ {
ELEM_MATERIAL_UNK0, ELEM_MATERIAL_UNK0,
@ -86,7 +86,7 @@ static ColliderTrisInit sTrisInit = {
COLSHAPE_TRIS, COLSHAPE_TRIS,
}, },
2, 2,
sTrisItemsInit, sTrisElementsInit,
}; };
static InitChainEntry sInitChain[] = { static InitChainEntry sInitChain[] = {
@ -95,11 +95,11 @@ static InitChainEntry sInitChain[] = {
void BgYdanSp_Init(Actor* thisx, PlayState* play) { void BgYdanSp_Init(Actor* thisx, PlayState* play) {
BgYdanSp* this = (BgYdanSp*)thisx; BgYdanSp* this = (BgYdanSp*)thisx;
ColliderTrisElementInit* ti0 = &sTrisItemsInit[0]; ColliderTrisElementInit* triElementInit0 = &sTrisElementsInit[0];
Vec3f tri[3]; Vec3f tri[3];
s32 i; s32 i;
CollisionHeader* colHeader = NULL; CollisionHeader* colHeader = NULL;
ColliderTrisElementInit* ti1 = &sTrisItemsInit[1]; ColliderTrisElementInit* triElementInit1 = &sTrisElementsInit[1];
f32 cossY; f32 cossY;
f32 sinsY; f32 sinsY;
f32 cossX; f32 cossX;
@ -110,22 +110,22 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) {
this->burnSwitchFlag = PARAMS_GET_U(thisx->params, 6, 6); this->burnSwitchFlag = PARAMS_GET_U(thisx->params, 6, 6);
this->dyna.actor.params = PARAMS_GET_U(thisx->params, 12, 4); this->dyna.actor.params = PARAMS_GET_U(thisx->params, 12, 4);
DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS); DynaPolyActor_Init(&this->dyna, DYNA_TRANSFORM_POS);
Collider_InitTris(play, &this->trisCollider); Collider_InitTris(play, &this->colliderTris);
Collider_SetTris(play, &this->trisCollider, &this->dyna.actor, &sTrisInit, this->trisColliderItems); Collider_SetTris(play, &this->colliderTris, &this->dyna.actor, &sTrisInit, this->colliderTrisElements);
if (this->dyna.actor.params == WEB_FLOOR) { if (this->dyna.actor.params == WEB_FLOOR) {
CollisionHeader_GetVirtual(&gDTWebFloorCol, &colHeader); CollisionHeader_GetVirtual(&gDTWebFloorCol, &colHeader);
this->actionFunc = BgYdanSp_FloorWebIdle; this->actionFunc = BgYdanSp_FloorWebIdle;
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
tri[i].x = ti0->dim.vtx[i].x + this->dyna.actor.world.pos.x; tri[i].x = triElementInit0->dim.vtx[i].x + this->dyna.actor.world.pos.x;
tri[i].y = ti0->dim.vtx[i].y + this->dyna.actor.world.pos.y; tri[i].y = triElementInit0->dim.vtx[i].y + this->dyna.actor.world.pos.y;
tri[i].z = ti0->dim.vtx[i].z + this->dyna.actor.world.pos.z; tri[i].z = triElementInit0->dim.vtx[i].z + this->dyna.actor.world.pos.z;
} }
Collider_SetTrisVertices(&this->trisCollider, 0, &tri[0], &tri[1], &tri[2]); Collider_SetTrisVertices(&this->colliderTris, 0, &tri[0], &tri[1], &tri[2]);
tri[1].x = tri[0].x; tri[1].x = tri[0].x;
tri[1].z = tri[2].z; tri[1].z = tri[2].z;
Collider_SetTrisVertices(&this->trisCollider, 1, &tri[0], &tri[2], &tri[1]); Collider_SetTrisVertices(&this->colliderTris, 1, &tri[0], &tri[2], &tri[1]);
this->unk_16C = 0.0f; this->unk_16C = 0.0f;
} else { } else {
CollisionHeader_GetVirtual(&gDTWebWallCol, &colHeader); CollisionHeader_GetVirtual(&gDTWebWallCol, &colHeader);
@ -137,19 +137,21 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) {
cossX = Math_CosS(this->dyna.actor.shape.rot.x); cossX = Math_CosS(this->dyna.actor.shape.rot.x);
for (i = 0; i < 3; i++) { for (i = 0; i < 3; i++) {
tri[i].x = tri[i].x = this->dyna.actor.world.pos.x + (cossY * triElementInit1->dim.vtx[i].x) -
this->dyna.actor.world.pos.x + (cossY * ti1->dim.vtx[i].x) - (sinsY * ti1->dim.vtx[i].y * nSinsX); (sinsY * triElementInit1->dim.vtx[i].y * nSinsX);
tri[i].y = this->dyna.actor.world.pos.y + (ti1->dim.vtx[i].y * cossX); tri[i].y = this->dyna.actor.world.pos.y + (triElementInit1->dim.vtx[i].y * cossX);
tri[i].z = tri[i].z = this->dyna.actor.world.pos.z - (sinsY * triElementInit1->dim.vtx[i].x) +
this->dyna.actor.world.pos.z - (sinsY * ti1->dim.vtx[i].x) + (ti1->dim.vtx[i].y * cossY * nSinsX); (triElementInit1->dim.vtx[i].y * cossY * nSinsX);
} }
Collider_SetTrisVertices(&this->trisCollider, 0, &tri[0], &tri[1], &tri[2]); Collider_SetTrisVertices(&this->colliderTris, 0, &tri[0], &tri[1], &tri[2]);
tri[1].x = this->dyna.actor.world.pos.x + (cossY * ti1->dim.vtx[0].x) - (ti1->dim.vtx[2].y * sinsY * nSinsX); tri[1].x = this->dyna.actor.world.pos.x + (cossY * triElementInit1->dim.vtx[0].x) -
tri[1].y = this->dyna.actor.world.pos.y + (ti1->dim.vtx[2].y * cossX); (triElementInit1->dim.vtx[2].y * sinsY * nSinsX);
tri[1].z = this->dyna.actor.world.pos.z - (sinsY * ti1->dim.vtx[0].x) + (ti1->dim.vtx[2].y * cossY * nSinsX); tri[1].y = this->dyna.actor.world.pos.y + (triElementInit1->dim.vtx[2].y * cossX);
Collider_SetTrisVertices(&this->trisCollider, 1, &tri[0], &tri[2], &tri[1]); tri[1].z = this->dyna.actor.world.pos.z - (sinsY * triElementInit1->dim.vtx[0].x) +
(triElementInit1->dim.vtx[2].y * cossY * nSinsX);
Collider_SetTrisVertices(&this->colliderTris, 1, &tri[0], &tri[2], &tri[1]);
} }
this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader); this->dyna.bgId = DynaPoly_SetBgActor(play, &play->colCtx.dyna, &this->dyna.actor, colHeader);
this->timer = 0; this->timer = 0;
@ -161,7 +163,7 @@ void BgYdanSp_Init(Actor* thisx, PlayState* play) {
void BgYdanSp_Destroy(Actor* thisx, PlayState* play) { void BgYdanSp_Destroy(Actor* thisx, PlayState* play) {
BgYdanSp* this = (BgYdanSp*)thisx; BgYdanSp* this = (BgYdanSp*)thisx;
DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId); DynaPoly_DeleteBgActor(play, &play->colCtx.dyna, this->dyna.bgId);
Collider_DestroyTris(play, &this->trisCollider); Collider_DestroyTris(play, &this->colliderTris);
} }
void BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) { void BgYdanSp_UpdateFloorWebCollision(BgYdanSp* this) {
@ -298,7 +300,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) {
BgYdanSp_BurnWeb(this, play); BgYdanSp_BurnWeb(this, play);
return; return;
} }
if (this->trisCollider.base.acFlags & AC_HIT) { if (this->colliderTris.base.acFlags & AC_HIT) {
BgYdanSp_BurnWeb(this, play); BgYdanSp_BurnWeb(this, play);
return; return;
} }
@ -345,7 +347,7 @@ void BgYdanSp_FloorWebIdle(BgYdanSp* this, PlayState* play) {
} }
} }
BgYdanSp_UpdateFloorWebCollision(this); BgYdanSp_UpdateFloorWebCollision(this);
CollisionCheck_SetAC(play, &play->colChkCtx, &this->trisCollider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderTris.base);
} }
void BgYdanSp_BurnWallWeb(BgYdanSp* this, PlayState* play) { void BgYdanSp_BurnWallWeb(BgYdanSp* this, PlayState* play) {
@ -406,7 +408,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) {
Vec3f sp30; Vec3f sp30;
player = GET_PLAYER(play); player = GET_PLAYER(play);
if (Flags_GetSwitch(play, this->burnSwitchFlag) || (this->trisCollider.base.acFlags & AC_HIT)) { if (Flags_GetSwitch(play, this->burnSwitchFlag) || (this->colliderTris.base.acFlags & AC_HIT)) {
this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f; this->dyna.actor.home.pos.y = this->dyna.actor.world.pos.y + 80.0f;
BgYdanSp_BurnWeb(this, play); BgYdanSp_BurnWeb(this, play);
} else if (player->heldItemAction == PLAYER_IA_DEKU_STICK && player->unk_860 != 0) { } else if (player->heldItemAction == PLAYER_IA_DEKU_STICK && player->unk_860 != 0) {
@ -417,7 +419,7 @@ void BgYdanSp_WallWebIdle(BgYdanSp* this, PlayState* play) {
BgYdanSp_BurnWeb(this, play); BgYdanSp_BurnWeb(this, play);
} }
} }
CollisionCheck_SetAC(play, &play->colChkCtx, &this->trisCollider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->colliderTris.base);
} }
void BgYdanSp_Update(Actor* thisx, PlayState* play) { void BgYdanSp_Update(Actor* thisx, PlayState* play) {

View file

@ -15,8 +15,8 @@ typedef struct BgYdanSp {
/* 0x0169 */ u8 burnSwitchFlag; /* 0x0169 */ u8 burnSwitchFlag;
/* 0x016A */ s16 timer; /* 0x016A */ s16 timer;
/* 0x016C */ f32 unk_16C; /* 0x016C */ f32 unk_16C;
/* 0x0170 */ ColliderTris trisCollider; /* 0x0170 */ ColliderTris colliderTris;
/* 0x0190 */ ColliderTrisElement trisColliderItems[2]; /* 0x0190 */ ColliderTrisElement colliderTrisElements[2];
} BgYdanSp; // size = 0x0248 } BgYdanSp; // size = 0x0248
#endif #endif

View file

@ -1307,12 +1307,12 @@ void BossFd_Effects(BossFd* this, PlayState* play) {
} }
void BossFd_CollisionCheck(BossFd* this, PlayState* play) { void BossFd_CollisionCheck(BossFd* this, PlayState* play) {
ColliderJntSphElement* headCollider = &this->collider.elements[0]; ColliderJntSphElement* headColliderElem = &this->collider.elements[0];
ColliderElement* acHitElem; ColliderElement* acHitElem;
if (headCollider->base.acElemFlags & ACELEM_HIT) { if (headColliderElem->base.acElemFlags & ACELEM_HIT) {
headCollider->base.acElemFlags &= ~ACELEM_HIT; headColliderElem->base.acElemFlags &= ~ACELEM_HIT;
acHitElem = headCollider->base.acHitElem; acHitElem = headColliderElem->base.acHitElem;
this->actor.colChkInfo.health -= 2; this->actor.colChkInfo.health -= 2;
if (acHitElem->atDmgInfo.dmgFlags & DMG_ARROW_ICE) { if (acHitElem->atDmgInfo.dmgFlags & DMG_ARROW_ICE) {
this->actor.colChkInfo.health -= 2; this->actor.colChkInfo.health -= 2;

View file

@ -116,14 +116,14 @@ s32 DemoGj_GetType(DemoGj* this) {
return type; return type;
} }
void DemoGj_InitCylinder(DemoGj* this, PlayState* play, ColliderCylinder* cylinder, void DemoGj_InitCylinder(DemoGj* this, PlayState* play, ColliderCylinder* collider,
ColliderCylinderInitType1* cylinderInit) { ColliderCylinderInitType1* colliderInit) {
Collider_InitCylinder(play, cylinder); Collider_InitCylinder(play, collider);
Collider_SetCylinderType1(play, cylinder, &this->dyna.actor, cylinderInit); Collider_SetCylinderType1(play, collider, &this->dyna.actor, colliderInit);
} }
s32 DemoGj_HitByExplosion(DemoGj* this, PlayState* play, ColliderCylinder* cylinder) { s32 DemoGj_HitByExplosion(DemoGj* this, PlayState* play, ColliderCylinder* collider) {
if (Actor_GetCollidedExplosive(play, &cylinder->base) != NULL) { if (Actor_GetCollidedExplosive(play, &collider->base) != NULL) {
return true; return true;
} }
return false; return false;
@ -1008,38 +1008,38 @@ void DemoGj_DoNothing1(DemoGj* this, PlayState* play) {
* Used by DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_1 * Used by DEMOGJ_TYPE_DESTRUCTABLE_RUBBLE_1
*/ */
void func_8097AEE8(DemoGj* this, PlayState* play) { void func_8097AEE8(DemoGj* this, PlayState* play) {
ColliderCylinder* cylinder0 = &this->colliderCylinders[0]; ColliderCylinder* collider0 = &this->colliderCylinders[0];
ColliderCylinder* cylinder1 = &this->colliderCylinders[1]; ColliderCylinder* collider1 = &this->colliderCylinders[1];
ColliderCylinder* cylinder2 = &this->colliderCylinders[2]; ColliderCylinder* collider2 = &this->colliderCylinders[2];
Vec3f* actorPos = &this->dyna.actor.world.pos; Vec3f* actorPos = &this->dyna.actor.world.pos;
s32 pad; s32 pad;
s16 theta = this->dyna.actor.world.rot.y; s16 yaw = this->dyna.actor.world.rot.y;
f32 cos_theta = Math_CosS(theta); f32 cos = Math_CosS(yaw);
f32 sin_theta = Math_SinS(theta); f32 sin = Math_SinS(yaw);
cylinder0->dim.pos.z = actorPos->z + (20.0f * cos_theta) - (-20.0f * sin_theta); collider0->dim.pos.z = actorPos->z + (20.0f * cos) - (-20.0f * sin);
cylinder0->dim.pos.x = actorPos->x + (20.0f * sin_theta) + (-20.0f * cos_theta); collider0->dim.pos.x = actorPos->x + (20.0f * sin) + (-20.0f * cos);
cylinder0->dim.pos.y = actorPos->y; collider0->dim.pos.y = actorPos->y;
cylinder1->dim.pos.z = actorPos->z + (-20.0f * cos_theta) - (20.0f * sin_theta); collider1->dim.pos.z = actorPos->z + (-20.0f * cos) - (20.0f * sin);
cylinder1->dim.pos.x = actorPos->x + (-20.0f * sin_theta) + (20.0f * cos_theta); collider1->dim.pos.x = actorPos->x + (-20.0f * sin) + (20.0f * cos);
cylinder1->dim.pos.y = actorPos->y; collider1->dim.pos.y = actorPos->y;
cylinder2->dim.pos.z = actorPos->z + (-60.0f * cos_theta) - (60.0f * sin_theta); collider2->dim.pos.z = actorPos->z + (-60.0f * cos) - (60.0f * sin);
cylinder2->dim.pos.x = actorPos->x + (-60.0f * sin_theta) + (60.0f * cos_theta); collider2->dim.pos.x = actorPos->x + (-60.0f * sin) + (60.0f * cos);
cylinder2->dim.pos.y = actorPos->y; collider2->dim.pos.y = actorPos->y;
} }
void DemoGj_SetCylindersAsAC(DemoGj* this, PlayState* play) { void DemoGj_SetCylindersAsAC(DemoGj* this, PlayState* play) {
s32 pad[2]; s32 pad[2];
Collider* cylinder0 = &this->colliderCylinders[0].base; Collider* collider0 = &this->colliderCylinders[0].base;
Collider* cylinder1 = &this->colliderCylinders[1].base; Collider* collider1 = &this->colliderCylinders[1].base;
Collider* cylinder2 = &this->colliderCylinders[2].base; Collider* collider2 = &this->colliderCylinders[2].base;
s32 pad2[3]; s32 pad2[3];
CollisionCheck_SetAC(play, &play->colChkCtx, cylinder0); CollisionCheck_SetAC(play, &play->colChkCtx, collider0);
CollisionCheck_SetAC(play, &play->colChkCtx, cylinder1); CollisionCheck_SetAC(play, &play->colChkCtx, collider1);
CollisionCheck_SetAC(play, &play->colChkCtx, cylinder2); CollisionCheck_SetAC(play, &play->colChkCtx, collider2);
} }
void DemoGj_DirectedExplosion(DemoGj* this, PlayState* play, Vec3f* direction) { void DemoGj_DirectedExplosion(DemoGj* this, PlayState* play, Vec3f* direction) {
@ -1142,26 +1142,26 @@ void DemoGj_DoNothing2(DemoGj* this, PlayState* play) {
// Moves the ColliderCylinder's relative to the actor's position. // Moves the ColliderCylinder's relative to the actor's position.
void func_8097B450(DemoGj* this, PlayState* play) { void func_8097B450(DemoGj* this, PlayState* play) {
ColliderCylinder* cylinder0 = &this->colliderCylinders[0]; ColliderCylinder* collider0 = &this->colliderCylinders[0];
ColliderCylinder* cylinder1 = &this->colliderCylinders[1]; ColliderCylinder* collider1 = &this->colliderCylinders[1];
ColliderCylinder* cylinder2 = &this->colliderCylinders[2]; ColliderCylinder* collider2 = &this->colliderCylinders[2];
Vec3f* actorPos = &this->dyna.actor.world.pos; Vec3f* actorPos = &this->dyna.actor.world.pos;
s32 pad; s32 pad;
s16 theta = this->dyna.actor.world.rot.y; s16 yaw = this->dyna.actor.world.rot.y;
f32 cos_theta = Math_CosS(theta); f32 cos = Math_CosS(yaw);
f32 sin_theta = Math_SinS(theta); f32 sin = Math_SinS(yaw);
cylinder0->dim.pos.z = actorPos->z - (35.0f * sin_theta); collider0->dim.pos.z = actorPos->z - (35.0f * sin);
cylinder0->dim.pos.x = actorPos->x + (35.0f * cos_theta); collider0->dim.pos.x = actorPos->x + (35.0f * cos);
cylinder0->dim.pos.y = actorPos->y; collider0->dim.pos.y = actorPos->y;
cylinder1->dim.pos.z = actorPos->z - (-10.0f * sin_theta); collider1->dim.pos.z = actorPos->z - (-10.0f * sin);
cylinder1->dim.pos.x = actorPos->x + (-10.0f * cos_theta); collider1->dim.pos.x = actorPos->x + (-10.0f * cos);
cylinder1->dim.pos.y = actorPos->y; collider1->dim.pos.y = actorPos->y;
cylinder2->dim.pos.z = actorPos->z - (-55.0f * sin_theta); collider2->dim.pos.z = actorPos->z - (-55.0f * sin);
cylinder2->dim.pos.x = actorPos->x + (-55.0f * cos_theta); collider2->dim.pos.x = actorPos->x + (-55.0f * cos);
cylinder2->dim.pos.y = actorPos->y; collider2->dim.pos.y = actorPos->y;
} }
void DemoGj_SetCylindersAsAC2(DemoGj* this, PlayState* play) { void DemoGj_SetCylindersAsAC2(DemoGj* this, PlayState* play) {
@ -1307,12 +1307,12 @@ void func_8097B9BC(DemoGj* this, PlayState* play) {
*/ */
void func_8097BA48(DemoGj* this, PlayState* play) { void func_8097BA48(DemoGj* this, PlayState* play) {
Actor* thisx = &this->dyna.actor; Actor* thisx = &this->dyna.actor;
ColliderCylinder* cylinder = &this->colliderCylinders[0]; ColliderCylinder* collider = &this->colliderCylinders[0];
s32 pad[2]; s32 pad[2];
if (func_809797E4(this, 4)) { if (func_809797E4(this, 4)) {
Actor_Kill(thisx); Actor_Kill(thisx);
} else if (DemoGj_HitByExplosion(this, play, cylinder)) { } else if (DemoGj_HitByExplosion(this, play, collider)) {
Vec3f vec1 = { 0.0f, 0.0f, 0.0f }; Vec3f vec1 = { 0.0f, 0.0f, 0.0f };
DemoGj_DropCollectible(this, play); DemoGj_DropCollectible(this, play);
@ -1329,8 +1329,8 @@ void func_8097BA48(DemoGj* this, PlayState* play) {
Actor_Kill(thisx); Actor_Kill(thisx);
} }
Collider_UpdateCylinder(thisx, cylinder); Collider_UpdateCylinder(thisx, collider);
CollisionCheck_SetAC(play, &play->colChkCtx, &cylinder->base); CollisionCheck_SetAC(play, &play->colChkCtx, &collider->base);
} }
// func_8097BB78 // func_8097BB78

View file

@ -46,7 +46,7 @@ ActorProfile En_Arrow_Profile = {
/**/ EnArrow_Draw, /**/ EnArrow_Draw,
}; };
static ColliderQuadInit sColliderInit = { static ColliderQuadInit sColliderQuadInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_ON | AT_TYPE_PLAYER, AT_ON | AT_TYPE_PLAYER,
@ -133,7 +133,7 @@ void EnArrow_Init(Actor* thisx, PlayState* play) {
} }
Collider_InitQuad(play, &this->collider); Collider_InitQuad(play, &this->collider);
Collider_SetQuad(play, &this->collider, &this->actor, &sColliderInit); Collider_SetQuad(play, &this->collider, &this->actor, &sColliderQuadInit);
if (this->actor.params <= ARROW_NORMAL) { if (this->actor.params <= ARROW_NORMAL) {
this->collider.elem.atElemFlags &= ~ATELEM_SFX_MASK; this->collider.elem.atElemFlags &= ~ATELEM_SFX_MASK;

View file

@ -51,7 +51,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[] = {
}, },
{ 0, { { 0, 0, 0 }, 5 }, 100 } }, { 0, { { 0, 0, 0 }, 5 }, 100 } },
}; };
static ColliderJntSphInit sColliderInit = { static ColliderJntSphInit sColliderJntSphInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_NONE, AT_NONE,
@ -174,7 +174,7 @@ void EnButte_Init(Actor* thisx, PlayState* play) {
SkelAnime_Init(play, &this->skelAnime, &gButterflySkel, &gButterflyAnim, this->jointTable, this->morphTable, 8); SkelAnime_Init(play, &this->skelAnime, &gButterflySkel, &gButterflyAnim, this->jointTable, this->morphTable, 8);
Collider_InitJntSph(play, &this->collider); Collider_InitJntSph(play, &this->collider);
Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->colliderElements); Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements);
this->actor.colChkInfo.mass = 0; this->actor.colChkInfo.mass = 0;
this->unk_25C = Rand_ZeroOne() * 0xFFFF; this->unk_25C = Rand_ZeroOne() * 0xFFFF;
this->unk_25E = Rand_ZeroOne() * 0xFFFF; this->unk_25E = Rand_ZeroOne() * 0xFFFF;

View file

@ -59,7 +59,7 @@ ActorProfile En_Eiyer_Profile = {
/**/ EnEiyer_Draw, /**/ EnEiyer_Draw,
}; };
static ColliderCylinderInit sColCylInit = { static ColliderCylinderInit sColliderCylinderInit = {
{ {
COL_MATERIAL_HIT0, COL_MATERIAL_HIT0,
AT_ON | AT_TYPE_ENEMY, AT_ON | AT_TYPE_ENEMY,
@ -135,7 +135,7 @@ void EnEiyer_Init(Actor* thisx, PlayState* play) {
ActorShape_Init(&this->actor.shape, 600.0f, ActorShadow_DrawCircle, 65.0f); ActorShape_Init(&this->actor.shape, 600.0f, ActorShadow_DrawCircle, 65.0f);
SkelAnime_Init(play, &this->skelanime, &gStingerSkel, &gStingerIdleAnim, this->jointTable, this->morphTable, 19); SkelAnime_Init(play, &this->skelanime, &gStingerSkel, &gStingerIdleAnim, this->jointTable, this->morphTable, 19);
Collider_InitCylinder(play, &this->collider); Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit); Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit);
CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit); CollisionCheck_SetInfo(&this->actor.colChkInfo, &sDamageTable, &sColChkInfoInit);
if (this->actor.params < 3) { if (this->actor.params < 3) {
@ -282,7 +282,7 @@ void EnEiyer_SetupLand(EnEiyer* this) {
// Update BgCheck info, play sound, and spawn effect on the first frame of the land action // Update BgCheck info, play sound, and spawn effect on the first frame of the land action
this->timer = -1; this->timer = -1;
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->collider.dim.height = sColCylInit.dim.height; this->collider.dim.height = sColliderCylinderInit.dim.height;
this->actionFunc = EnEiyer_Land; this->actionFunc = EnEiyer_Land;
} }
@ -328,7 +328,7 @@ void EnEiyer_SetupStunned(EnEiyer* this) {
this->actor.speed = 0.0f; this->actor.speed = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->actor.gravity = -1.0f; this->actor.gravity = -1.0f;
this->collider.dim.height = sColCylInit.dim.height + 8; this->collider.dim.height = sColliderCylinderInit.dim.height + 8;
Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80); Actor_SetColorFilter(&this->actor, COLORFILTER_COLORFLAG_BLUE, 200, COLORFILTER_BUFFLAG_OPA, 80);
this->collider.base.atFlags &= ~AT_ON; this->collider.base.atFlags &= ~AT_ON;
Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE); Actor_PlaySfx(&this->actor, NA_SE_EN_GOMA_JR_FREEZE);
@ -606,7 +606,7 @@ void EnEiyer_Stunned(EnEiyer* this, PlayState* play) {
if (this->timer == 0) { if (this->timer == 0) {
this->actor.gravity = 0.0f; this->actor.gravity = 0.0f;
this->actor.velocity.y = 0.0f; this->actor.velocity.y = 0.0f;
this->collider.dim.height = sColCylInit.dim.height; this->collider.dim.height = sColliderCylinderInit.dim.height;
EnEiyer_SetupGlide(this); EnEiyer_SetupGlide(this);
} }
} }
@ -638,7 +638,7 @@ void EnEiyer_UpdateDamage(EnEiyer* this, PlayState* play) {
Actor_PlaySfx(&this->actor, NA_SE_EN_EIER_DAMAGE); Actor_PlaySfx(&this->actor, NA_SE_EN_EIER_DAMAGE);
EnEiyer_SetupHurt(this); EnEiyer_SetupHurt(this);
} else { } else {
this->collider.dim.height = sColCylInit.dim.height; this->collider.dim.height = sColliderCylinderInit.dim.height;
EnEiyer_SetupDie(this); EnEiyer_SetupDie(this);
} }
} }

View file

@ -189,8 +189,8 @@ void EnFloormas_Init(Actor* thisx, PlayState* play2) {
void EnFloormas_Destroy(Actor* thisx, PlayState* play) { void EnFloormas_Destroy(Actor* thisx, PlayState* play) {
EnFloormas* this = (EnFloormas*)thisx; EnFloormas* this = (EnFloormas*)thisx;
ColliderCylinder* col = &this->collider;
Collider_DestroyCylinder(play, col); Collider_DestroyCylinder(play, &this->collider);
} }
void EnFloormas_MakeInvulnerable(EnFloormas* this) { void EnFloormas_MakeInvulnerable(EnFloormas* this) {

View file

@ -99,7 +99,7 @@ ActorProfile En_GeldB_Profile = {
/**/ EnGeldB_Draw, /**/ EnGeldB_Draw,
}; };
static ColliderCylinderInit sBodyCylInit = { static ColliderCylinderInit sBodyCylinderInit = {
{ {
COL_MATERIAL_HIT5, COL_MATERIAL_HIT5,
AT_NONE, AT_NONE,
@ -253,7 +253,7 @@ void EnGeldB_Init(Actor* thisx, PlayState* play) {
SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoRedSkel, &gGerudoRedNeutralAnim, this->jointTable, SkelAnime_InitFlex(play, &this->skelAnime, &gGerudoRedSkel, &gGerudoRedNeutralAnim, this->jointTable,
this->morphTable, GELDB_LIMB_MAX); this->morphTable, GELDB_LIMB_MAX);
Collider_InitCylinder(play, &this->bodyCollider); Collider_InitCylinder(play, &this->bodyCollider);
Collider_SetCylinder(play, &this->bodyCollider, thisx, &sBodyCylInit); Collider_SetCylinder(play, &this->bodyCollider, thisx, &sBodyCylinderInit);
Collider_InitTris(play, &this->blockCollider); Collider_InitTris(play, &this->blockCollider);
Collider_SetTris(play, &this->blockCollider, thisx, &sBlockTrisInit, this->blockElements); Collider_SetTris(play, &this->blockCollider, thisx, &sBlockTrisInit, this->blockElements);
Collider_InitQuad(play, &this->swordCollider); Collider_InitQuad(play, &this->swordCollider);

View file

@ -60,7 +60,7 @@ ActorProfile En_Hy_Profile = {
/**/ EnHy_Draw, /**/ EnHy_Draw,
}; };
static ColliderCylinderInit sColCylInit = { static ColliderCylinderInit sColliderCylinderInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_NONE, AT_NONE,
@ -1169,7 +1169,7 @@ void EnHy_WaitForObjects(EnHy* this, PlayState* play) {
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 0.0f);
gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment); gSegments[6] = OS_K0_TO_PHYSICAL(play->objectCtx.slots[this->objectSlotOsAnime].segment);
Collider_InitCylinder(play, &this->collider); Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sColCylInit); Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit);
EnHy_InitCollider(this); EnHy_InitCollider(this);
CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit); CollisionCheck_SetInfo2(&this->actor.colChkInfo, NULL, &sColChkInfoInit);
Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[ENHY_GET_TYPE(&this->actor)].animInfoIndex); Animation_ChangeByInfo(&this->skelAnime, sAnimationInfo, sModelInfo[ENHY_GET_TYPE(&this->actor)].animInfoIndex);

View file

@ -228,7 +228,7 @@ void EnIk_InitImpl(Actor* thisx, PlayState* play) {
Collider_InitCylinder(play, &this->bodyCollider); Collider_InitCylinder(play, &this->bodyCollider);
Collider_SetCylinder(play, &this->bodyCollider, thisx, &sCylinderInit); Collider_SetCylinder(play, &this->bodyCollider, thisx, &sCylinderInit);
Collider_InitTris(play, &this->shieldCollider); Collider_InitTris(play, &this->shieldCollider);
Collider_SetTris(play, &this->shieldCollider, thisx, &sTrisInit, this->shieldColliderItems); Collider_SetTris(play, &this->shieldCollider, thisx, &sTrisInit, this->shieldColliderElements);
Collider_InitQuad(play, &this->axeCollider); Collider_InitQuad(play, &this->axeCollider);
Collider_SetQuad(play, &this->axeCollider, thisx, &sQuadInit); Collider_SetQuad(play, &this->axeCollider, thisx, &sQuadInit);

View file

@ -109,7 +109,7 @@ typedef struct EnIk {
/* 0x0320 */ ColliderCylinder bodyCollider; /* 0x0320 */ ColliderCylinder bodyCollider;
/* 0x036C */ ColliderQuad axeCollider; /* 0x036C */ ColliderQuad axeCollider;
/* 0x03EC */ ColliderTris shieldCollider; /* 0x03EC */ ColliderTris shieldCollider;
/* 0x040C */ ColliderTrisElement shieldColliderItems[2]; /* 0x040C */ ColliderTrisElement shieldColliderElements[2];
/* 0x04C4 */ s32 blureIdx; /* 0x04C4 */ s32 blureIdx;
/* 0x04C8 */ s32 csAction; /* 0x04C8 */ s32 csAction;
/* 0x04CC */ s32 csDrawMode; /* 0x04CC */ s32 csDrawMode;

View file

@ -83,7 +83,7 @@ static ColliderJntSphElementInit sColliderElementsInit[1] = {
}, },
}; };
static ColliderJntSphInit sColliderInit = { static ColliderJntSphInit sColliderJntSphInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_NONE, AT_NONE,
@ -206,7 +206,7 @@ void EnInsect_Init(Actor* thisx, PlayState* play2) {
SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24); SkelAnime_Init(play, &this->skelAnime, &gBugSkel, &gBugCrawlAnim, this->jointTable, this->morphTable, 24);
Collider_InitJntSph(play, &this->collider); Collider_InitJntSph(play, &this->collider);
Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->colliderElements); Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements);
this->actor.colChkInfo.mass = 30; this->actor.colChkInfo.mass = 30;

View file

@ -126,7 +126,7 @@ static ColliderCylinderInit sBodyColliderInit = {
{ 20, 70, 0, { 0, 0, 0 } }, { 20, 70, 0, { 0, 0, 0 } },
}; };
static ColliderTrisElementInit sFrontShieldingTrisInit[2] = { static ColliderTrisElementInit sFrontShieldingTrisElementsInit[2] = {
{ {
{ {
ELEM_MATERIAL_UNK2, ELEM_MATERIAL_UNK2,
@ -151,7 +151,7 @@ static ColliderTrisElementInit sFrontShieldingTrisInit[2] = {
}, },
}; };
static ColliderTrisInit sFrontShieldingInit = { static ColliderTrisInit sFrontShieldingTrisInit = {
{ {
COL_MATERIAL_METAL, COL_MATERIAL_METAL,
AT_NONE, AT_NONE,
@ -161,10 +161,10 @@ static ColliderTrisInit sFrontShieldingInit = {
COLSHAPE_TRIS, COLSHAPE_TRIS,
}, },
2, 2,
sFrontShieldingTrisInit, sFrontShieldingTrisElementsInit,
}; };
static ColliderQuadInit sAttackColliderInit = { static ColliderQuadInit sAttackColliderQuadInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_ON | AT_TYPE_ENEMY, AT_ON | AT_TYPE_ENEMY,
@ -284,10 +284,11 @@ void EnMb_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.damageTable = &sSpearMoblinDamageTable; this->actor.colChkInfo.damageTable = &sSpearMoblinDamageTable;
Collider_InitCylinder(play, &this->bodyCollider); Collider_InitCylinder(play, &this->bodyCollider);
Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sBodyColliderInit); Collider_SetCylinder(play, &this->bodyCollider, &this->actor, &sBodyColliderInit);
Collider_InitTris(play, &this->frontShielding); Collider_InitTris(play, &this->frontShieldingCollider);
Collider_SetTris(play, &this->frontShielding, &this->actor, &sFrontShieldingInit, this->frontShieldingTris); Collider_SetTris(play, &this->frontShieldingCollider, &this->actor, &sFrontShieldingTrisInit,
this->frontShieldingColliderElements);
Collider_InitQuad(play, &this->attackCollider); Collider_InitQuad(play, &this->attackCollider);
Collider_SetQuad(play, &this->attackCollider, &this->actor, &sAttackColliderInit); Collider_SetQuad(play, &this->attackCollider, &this->actor, &sAttackColliderQuadInit);
switch (this->actor.params) { switch (this->actor.params) {
case ENMB_TYPE_SPEAR_GUARD: case ENMB_TYPE_SPEAR_GUARD:
@ -349,7 +350,7 @@ void EnMb_Init(Actor* thisx, PlayState* play) {
void EnMb_Destroy(Actor* thisx, PlayState* play) { void EnMb_Destroy(Actor* thisx, PlayState* play) {
EnMb* this = (EnMb*)thisx; EnMb* this = (EnMb*)thisx;
Collider_DestroyTris(play, &this->frontShielding); Collider_DestroyTris(play, &this->frontShieldingCollider);
Collider_DestroyCylinder(play, &this->bodyCollider); Collider_DestroyCylinder(play, &this->bodyCollider);
Collider_DestroyQuad(play, &this->attackCollider); Collider_DestroyQuad(play, &this->attackCollider);
} }
@ -1434,8 +1435,8 @@ void EnMb_ClubUpdateAttackCollider(Actor* thisx, PlayState* play) {
void EnMb_CheckColliding(EnMb* this, PlayState* play) { void EnMb_CheckColliding(EnMb* this, PlayState* play) {
Player* player = GET_PLAYER(play); Player* player = GET_PLAYER(play);
if (this->frontShielding.base.acFlags & AC_HIT) { if (this->frontShieldingCollider.base.acFlags & AC_HIT) {
this->frontShielding.base.acFlags &= ~(AC_HIT | AC_BOUNCED); this->frontShieldingCollider.base.acFlags &= ~(AC_HIT | AC_BOUNCED);
this->bodyCollider.base.acFlags &= ~AC_HIT; this->bodyCollider.base.acFlags &= ~AC_HIT;
} else if ((this->bodyCollider.base.acFlags & AC_HIT) && this->state >= ENMB_STATE_STUNNED) { } else if ((this->bodyCollider.base.acFlags & AC_HIT) && this->state >= ENMB_STATE_STUNNED) {
this->bodyCollider.base.acFlags &= ~AC_HIT; this->bodyCollider.base.acFlags &= ~AC_HIT;
@ -1502,7 +1503,7 @@ void EnMb_Update(Actor* thisx, PlayState* play) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->bodyCollider.base);
} }
if (this->state >= ENMB_STATE_IDLE) { if (this->state >= ENMB_STATE_IDLE) {
CollisionCheck_SetAC(play, &play->colChkCtx, &this->frontShielding.base); CollisionCheck_SetAC(play, &play->colChkCtx, &this->frontShieldingCollider.base);
} }
if (this->attack > ENMB_ATTACK_NONE) { if (this->attack > ENMB_ATTACK_NONE) {
CollisionCheck_SetAT(play, &play->colChkCtx, &this->attackCollider.base); CollisionCheck_SetAT(play, &play->colChkCtx, &this->attackCollider.base);
@ -1601,9 +1602,9 @@ void EnMb_Draw(Actor* thisx, PlayState* play) {
Matrix_MultVec3f(&frontShieldingTriModel0[i], &frontShieldingTri0[i]); Matrix_MultVec3f(&frontShieldingTriModel0[i], &frontShieldingTri0[i]);
Matrix_MultVec3f(&frontShieldingTriModel1[i], &frontShieldingTri1[i]); Matrix_MultVec3f(&frontShieldingTriModel1[i], &frontShieldingTri1[i]);
} }
Collider_SetTrisVertices(&this->frontShielding, 0, &frontShieldingTri0[0], &frontShieldingTri0[1], Collider_SetTrisVertices(&this->frontShieldingCollider, 0, &frontShieldingTri0[0], &frontShieldingTri0[1],
&frontShieldingTri0[2]); &frontShieldingTri0[2]);
Collider_SetTrisVertices(&this->frontShielding, 1, &frontShieldingTri1[0], &frontShieldingTri1[1], Collider_SetTrisVertices(&this->frontShieldingCollider, 1, &frontShieldingTri1[0], &frontShieldingTri1[1],
&frontShieldingTri1[2]); &frontShieldingTri1[2]);
} }

View file

@ -46,8 +46,8 @@ typedef struct EnMb {
/* 0x0364 */ f32 playerDetectionRange; /* 0x0364 */ f32 playerDetectionRange;
/* 0x0368 */ ColliderCylinder bodyCollider; /* 0x0368 */ ColliderCylinder bodyCollider;
/* 0x03B4 */ ColliderQuad attackCollider; // for attacking the player /* 0x03B4 */ ColliderQuad attackCollider; // for attacking the player
/* 0x0434 */ ColliderTris frontShielding; // Moblins don't have shields, but this acts as one /* 0x0434 */ ColliderTris frontShieldingCollider; // Moblins don't have shields, but this acts as one
/* 0x0454 */ ColliderTrisElement frontShieldingTris[2]; /* 0x0454 */ ColliderTrisElement frontShieldingColliderElements[2];
} EnMb; // size = 0x050C } EnMb; // size = 0x050C
#endif #endif

View file

@ -64,7 +64,7 @@ static ColliderJntSphElementInit sJntSphElementsInit[1] = {
}, },
}; };
static ColliderJntSphInit sColliderInit = { static ColliderJntSphInit sColliderJntSphInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_ON | AT_TYPE_ENEMY, AT_ON | AT_TYPE_ENEMY,
@ -125,7 +125,7 @@ void EnNy_Init(Actor* thisx, PlayState* play) {
this->actor.colChkInfo.damageTable = &sDamageTable; this->actor.colChkInfo.damageTable = &sDamageTable;
this->actor.colChkInfo.health = 2; this->actor.colChkInfo.health = 2;
Collider_InitJntSph(play, &this->collider); Collider_InitJntSph(play, &this->collider);
Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderInit, this->colliderElements); Collider_SetJntSph(play, &this->collider, &this->actor, &sColliderJntSphInit, this->colliderElements);
ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f); ActorShape_Init(&this->actor.shape, 0.0f, ActorShadow_DrawCircle, 20.0f);
this->unk_1CA = 0; this->unk_1CA = 0;
this->unk_1D0 = 0; this->unk_1D0 = 0;

View file

@ -43,7 +43,7 @@ ActorProfile En_Po_Desert_Profile = {
/**/ EnPoDesert_Draw, /**/ EnPoDesert_Draw,
}; };
static ColliderCylinderInit sColliderInit = { static ColliderCylinderInit sColliderCylinderInit = {
{ {
COL_MATERIAL_HIT3, COL_MATERIAL_HIT3,
AT_NONE, AT_NONE,
@ -76,7 +76,7 @@ void EnPoDesert_Init(Actor* thisx, PlayState* play) {
Actor_ProcessInitChain(&this->actor, sInitChain); Actor_ProcessInitChain(&this->actor, sInitChain);
SkelAnime_Init(play, &this->skelAnime, &gPoeFieldSkel, &gPoeFieldFloatAnim, this->jointTable, this->morphTable, 10); SkelAnime_Init(play, &this->skelAnime, &gPoeFieldSkel, &gPoeFieldFloatAnim, this->jointTable, this->morphTable, 10);
Collider_InitCylinder(play, &this->collider); Collider_InitCylinder(play, &this->collider);
Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderInit); Collider_SetCylinder(play, &this->collider, &this->actor, &sColliderCylinderInit);
this->lightColor.r = 255; this->lightColor.r = 255;
this->lightColor.g = 255; this->lightColor.g = 255;
this->lightColor.b = 210; this->lightColor.b = 210;

View file

@ -510,16 +510,16 @@ s32 EnSsh_CheckHitFront(EnSsh* this) {
} }
s32 EnSsh_CheckHitBack(EnSsh* this, PlayState* play) { s32 EnSsh_CheckHitBack(EnSsh* this, PlayState* play) {
ColliderCylinder* cyl = &this->colliderCylinders[0]; ColliderCylinder* collider = &this->colliderCylinders[0];
s32 hit = false; s32 hit = false;
if (cyl->base.acFlags & AC_HIT) { if (collider->base.acFlags & AC_HIT) {
cyl->base.acFlags &= ~AC_HIT; collider->base.acFlags &= ~AC_HIT;
hit = true; hit = true;
} }
cyl = &this->colliderCylinders[1]; collider = &this->colliderCylinders[1];
if (cyl->base.acFlags & AC_HIT) { if (collider->base.acFlags & AC_HIT) {
cyl->base.acFlags &= ~AC_HIT; collider->base.acFlags &= ~AC_HIT;
hit = true; hit = true;
} }
if (!hit) { if (!hit) {

View file

@ -439,21 +439,21 @@ s32 EnSt_CheckHitFrontside(EnSt* this) {
} }
s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) { s32 EnSt_CheckHitBackside(EnSt* this, PlayState* play) {
ColliderCylinder* cyl = &this->colliderCylinders[0]; ColliderCylinder* collider = &this->colliderCylinders[0];
s32 flags = 0; // damage flags from colliders 0 and 1 s32 flags = 0; // damage flags from colliders 0 and 1
s32 hit = false; s32 hit = false;
if (cyl->base.acFlags & AC_HIT) { if (collider->base.acFlags & AC_HIT) {
cyl->base.acFlags &= ~AC_HIT; collider->base.acFlags &= ~AC_HIT;
hit = true; hit = true;
flags |= cyl->elem.acHitElem->atDmgInfo.dmgFlags; flags |= collider->elem.acHitElem->atDmgInfo.dmgFlags;
} }
cyl = &this->colliderCylinders[1]; collider = &this->colliderCylinders[1];
if (cyl->base.acFlags & AC_HIT) { if (collider->base.acFlags & AC_HIT) {
cyl->base.acFlags &= ~AC_HIT; collider->base.acFlags &= ~AC_HIT;
hit = true; hit = true;
flags |= cyl->elem.acHitElem->atDmgInfo.dmgFlags; flags |= collider->elem.acHitElem->atDmgInfo.dmgFlags;
} }
if (!hit) { if (!hit) {

View file

@ -192,7 +192,7 @@ static ColliderCylinderInit sShieldColliderInit = {
{ 20, 70, -50, { 0, 0, 0 } }, { 20, 70, -50, { 0, 0, 0 } },
}; };
static ColliderQuadInit sSwordColliderInit = { static ColliderQuadInit sSwordColliderQuadInit = {
{ {
COL_MATERIAL_NONE, COL_MATERIAL_NONE,
AT_ON | AT_TYPE_ENEMY, AT_ON | AT_TYPE_ENEMY,
@ -294,7 +294,7 @@ void EnTest_Init(Actor* thisx, PlayState* play) {
Collider_SetCylinder(play, &this->shieldCollider, &this->actor, &sShieldColliderInit); Collider_SetCylinder(play, &this->shieldCollider, &this->actor, &sShieldColliderInit);
Collider_InitQuad(play, &this->swordCollider); Collider_InitQuad(play, &this->swordCollider);
Collider_SetQuad(play, &this->swordCollider, &this->actor, &sSwordColliderInit); Collider_SetQuad(play, &this->swordCollider, &this->actor, &sSwordColliderQuadInit);
this->actor.colChkInfo.mass = MASS_HEAVY; this->actor.colChkInfo.mass = MASS_HEAVY;
this->actor.colChkInfo.health = 10; this->actor.colChkInfo.health = 10;