mirror of
https://github.com/zeldaret/mm.git
synced 2026-07-30 23:54:48 -04:00
z_collision_check.c (#58)
* setup * Progress on z_collision_check.c * Further progress on z_collision_check.c * renamed code_0x800E03A0 to z_collision_btltbls, z_collision_check.c decompiled besides bss * Structs changes * Document functions * overlayhelpers folder, colliderinit.py and ichaindis.py * Flags, format existing ColliderInits * Fix merge * Few more small improvements * Review suggestions
This commit is contained in:
@@ -8,16 +8,18 @@ void EnAObj_Init(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
s0->base.textId = ((s0->base.params >> 8) & 0xFF) | 0x300;
|
||||
s0->base.params = (s0->base.params & 0xFF) - 9;
|
||||
Actor_ProcessInitChain((Actor*)s0, &enAObjInitVar);
|
||||
|
||||
Actor_SetDrawParams(&s0->base.shape, 0, (ActorShadowFunc)func_800B3FC0, 12);
|
||||
Collision_InitCylinder(ctxt, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
|
||||
Collision_CylinderMoveToActor((Actor*)s0, &s0->collision);
|
||||
Collider_InitAndSetCylinder(ctxt, &s0->collision, (Actor*)s0, &enAObjCylinderInit);
|
||||
Collider_UpdateCylinder((Actor*)s0, &s0->collision);
|
||||
|
||||
s0->base.colChkInfo.mass = 255;
|
||||
s0->update = (ActorFunc)EnAObj_Update1;
|
||||
}
|
||||
|
||||
void EnAObj_Destroy(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
ColCylinder* a2 = &this->collision;
|
||||
Collision_FiniCylinder(ctxt, a2);
|
||||
ColliderCylinder* a2 = &this->collision;
|
||||
Collider_DestroyCylinder(ctxt, a2);
|
||||
}
|
||||
|
||||
void EnAObj_Update1(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
@@ -43,7 +45,7 @@ void EnAObj_Update2(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
void EnAObj_Update(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
(this->update)((Actor*)this, (GlobalContext*)ctxt);
|
||||
Actor_SetHeight((Actor*)this, 45.0f);
|
||||
Collision_AddOT(ctxt, &ctxt->colCheckCtx, (ColCommon*)&this->collision);
|
||||
CollisionCheck_SetOC(ctxt, &ctxt->colCheckCtx, (Collider*)&this->collision);
|
||||
}
|
||||
|
||||
void EnAObj_Draw(ActorEnAObj* this, GlobalContext* ctxt) {
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
s800E03A0* func_800E03A0(s32 a0) {
|
||||
if ((a0 < 0) || (a0 > 22)) return 0;
|
||||
return &(D_801B9F20[a0]);
|
||||
}
|
||||
|
||||
// Probably zeroes out a s800E03A0?
|
||||
void func_800E03CC(u8* a0) {
|
||||
s32 i;
|
||||
u8* v1;
|
||||
|
||||
for (i = 0, v1 = a0; i < 32; i++) {
|
||||
*v1++ = 0;
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -230,7 +230,7 @@ void Actor_InitToDefaultValues(Actor* actor, GlobalContext* ctxt) {
|
||||
actor->meshAttachedTo = 0x32;
|
||||
|
||||
actor->sqrdDistToLink = D_801DCA54;
|
||||
func_800E7494(&actor->colChkInfo);
|
||||
CollisionCheck_InitInfo(&actor->colChkInfo);
|
||||
actor->uncullZoneForward = 1000.0f;
|
||||
actor->uncullZoneScale = 350.0f;
|
||||
actor->uncullZoneDownward = 700.0f;
|
||||
|
||||
@@ -76,7 +76,7 @@ void BgCheck_CreateVertexFromVec3f(BgVertex* vertex, Vec3f* vector) {
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C01B8.asm")
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/BgCheck_CreateColTriParamsFromPolygon.asm")
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/BgCheck_CreateTriNormFromPolygon.asm")
|
||||
|
||||
#pragma GLOBAL_ASM("./asm/non_matchings/code/z_bgcheck/func_800C02C0.asm")
|
||||
|
||||
|
||||
@@ -0,0 +1,74 @@
|
||||
#include <ultra64.h>
|
||||
#include <global.h>
|
||||
|
||||
DamageTable sDamageTablePresets[] = {
|
||||
{ { 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00,
|
||||
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x01, 0x02, 0xE0, 0x01, 0xF2, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x01, 0x01, 0x00, 0x00,
|
||||
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x02, 0x01, 0x02, 0x10, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
||||
0x00, 0x04, 0x03, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x01, 0x02, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x02, 0x02, 0x02, 0x02, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x01, 0x00, 0x10, 0x01, 0x01, 0x10, 0x01, 0x01, 0x01, 0x01, 0x31, 0x01, 0x00, 0x00,
|
||||
0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x03, 0x00, 0x06, 0x00, 0x04, 0x04, 0x00, 0x02, 0x06, 0x00, 0x06, 0x06, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x02, 0x00, 0x00, 0x01, 0x00, 0x02, 0x02, 0x01, 0x02, 0x04, 0x00, 0x04, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x00, 0xE2, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00,
|
||||
0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x01, 0x00, 0x00, 0x00, 0x04, 0x04, 0x00, 0x02, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x01, 0x02, 0x10, 0x01, 0x02, 0x10, 0x01, 0x02, 0x02, 0x22, 0x01, 0x01, 0x00, 0x00,
|
||||
0x00, 0x22, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x00, 0x02, 0x01, 0x02, 0x01, 0x02, 0x02, 0x02, 0x01, 0x02, 0x04, 0x04, 0x04, 0x04, 0x00, 0x00,
|
||||
0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x01, 0x02, 0x04, 0x02, 0x04, 0x08, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x00, 0x02, 0x10, 0x01, 0x02, 0x10, 0xF1, 0xF2, 0xF2, 0x22, 0x32, 0x01, 0x00, 0x00,
|
||||
0x00, 0x22, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x01, 0xF2, 0xE0, 0x01, 0xD2, 0x10, 0x01, 0x02, 0x02, 0x00, 0x32, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x32, 0x00, 0x00, 0x00, 0x01, 0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x10, 0x01, 0x00, 0xF0, 0x10, 0x01, 0xF0, 0x10, 0x01, 0x02, 0x02, 0x00, 0x12, 0x00, 0x00, 0x00,
|
||||
0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 } },
|
||||
{ { 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
|
||||
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01 } },
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns a pointer to one of the 23 damage table presets, or NULL if the index
|
||||
* is out of range.
|
||||
*/
|
||||
DamageTable* DamageTable_Get(s32 index) {
|
||||
if (index < 0 || index > ARRAY_COUNT(sDamageTablePresets)-1) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return &sDamageTablePresets[index];
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets all entries in a damage table to 0
|
||||
*/
|
||||
void DamageTable_Clear(DamageTable* damageTable) {
|
||||
s32 i;
|
||||
|
||||
for (i = 0; i < ARRAY_COUNT(damageTable->attack); i++) {
|
||||
damageTable->attack[i] = 0;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
+1
-1
@@ -146,7 +146,7 @@ s32 func_8013A530(GlobalContext* globalCtx, Actor* actor, s32 flag, Vec3f* pos,
|
||||
|
||||
actors[0] = actor;
|
||||
actors[1] = globalCtx->actorCtx.actorList[2].first; // TODO PLAYER macro
|
||||
if (func_800E7DCC(globalCtx, &globalCtx->colCheckCtx, pos, &camera->eye, actors, 2) != 0) {
|
||||
if (CollisionCheck_LineOCCheck(globalCtx, &globalCtx->colCheckCtx, pos, &camera->eye, actors, 2) != 0) {
|
||||
func_8013A41C(0x3b);
|
||||
ret |= 0x3b;
|
||||
}
|
||||
|
||||
@@ -24,10 +24,24 @@ const ActorInit Arms_Hook_InitVars = {
|
||||
(ActorFunc)ArmsHook_Draw
|
||||
};
|
||||
|
||||
ColQuadInit D_808C1BC0 = {
|
||||
{ 10, 0x09, 0x00, 0x00, 0x08, 3 },
|
||||
{ 0x02, { 0x00000080, 0x00, 0x02 }, { 0xF7CFFFFF, 0x00, 0x00 }, 0x05, 0x00, 0x00 },
|
||||
{ 0 },
|
||||
ColliderQuadInit D_808C1BC0 = {
|
||||
{
|
||||
COLTYPE_NONE,
|
||||
AT_ON | AT_TYPE_PLAYER,
|
||||
AC_NONE,
|
||||
OC1_NONE,
|
||||
OC2_TYPE_PLAYER,
|
||||
COLSHAPE_QUAD,
|
||||
},
|
||||
{
|
||||
ELEMTYPE_UNK2,
|
||||
{ 0x00000080, 0x00, 0x02 },
|
||||
{ 0xF7CFFFFF, 0x00, 0x00 },
|
||||
TOUCH_ON | TOUCH_NEAREST | 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 } } },
|
||||
};
|
||||
|
||||
Vec3f D_808C1C10 = { 0.0f, 0.0f, 0.0f };
|
||||
@@ -47,8 +61,8 @@ void ArmsHook_SetupAction(ArmsHook* this, ArmsHookActionFunc actionFunc) {
|
||||
void ArmsHook_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ArmsHook* this = THIS;
|
||||
|
||||
Collision_InitQuadDefault(globalCtx, &this->collider);
|
||||
Collision_InitQuadWithData(globalCtx, &this->collider, &this->actor, &D_808C1BC0);
|
||||
Collider_InitQuad(globalCtx, &this->collider);
|
||||
Collider_SetQuad(globalCtx, &this->collider, &this->actor, &D_808C1BC0);
|
||||
ArmsHook_SetupAction(this, ArmsHook_Wait);
|
||||
this->unk1E0 = this->actor.world.pos;
|
||||
}
|
||||
@@ -59,7 +73,7 @@ void ArmsHook_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
if (this->grabbed != NULL) {
|
||||
this->grabbed->flags &= ~0x2000;
|
||||
}
|
||||
Collision_FiniQuad(globalCtx, &this->collider);
|
||||
Collider_DestroyQuad(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
void ArmsHook_Wait(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
@@ -125,10 +139,11 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
func_800B8F98(&player->base, 0x100B);
|
||||
ArmsHook_CheckForCancel(this);
|
||||
|
||||
if (this->timer != 0 && (this->collider.base.flagsAT & 2) && (this->collider.body.unk20->unk14 != 4)) {
|
||||
Actor* touchedActor = this->collider.base.collisionAT;
|
||||
if (this->timer != 0 && (this->collider.base.atFlags & AT_HIT) &&
|
||||
(this->collider.info.atHitInfo->elemType != ELEMTYPE_UNK4)) {
|
||||
Actor* touchedActor = this->collider.base.at;
|
||||
if ((touchedActor->update != NULL) && (touchedActor->flags & 0x600)) {
|
||||
if (this->collider.body.unk20->unk16 & 4) {
|
||||
if (this->collider.info.atHitInfo->bumperFlags & BUMP_HOOKABLE) {
|
||||
ArmsHook_AttachHookToActor(this, touchedActor);
|
||||
if ((touchedActor->flags & 0x400) == 0x400) {
|
||||
func_808C1154(this);
|
||||
@@ -170,8 +185,7 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
{
|
||||
f32 velocity;
|
||||
|
||||
bodyDistDiff =
|
||||
Math_Vec3f_DistXYZAndStoreDiff(&player->unk368, &this->actor.world.pos, &bodyDistDiffVec);
|
||||
bodyDistDiff = Math_Vec3f_DistXYZAndStoreDiff(&player->unk368, &this->actor.world.pos, &bodyDistDiffVec);
|
||||
if (bodyDistDiff < 30.0f) {
|
||||
velocity = 0.0f;
|
||||
phi_f16 = 0.0f;
|
||||
@@ -244,15 +258,14 @@ void ArmsHook_Shoot(ArmsHook* this, GlobalContext* globalCtx) {
|
||||
if (func_800C9CEC(&globalCtx->colCtx, poly, bgId)) {
|
||||
{
|
||||
DynaPolyActor* dynaPolyActor;
|
||||
if (bgId != 0x32 &&
|
||||
(dynaPolyActor = BgCheck_GetActorOfMesh(&globalCtx->colCtx, bgId)) != NULL) {
|
||||
if (bgId != 0x32 && (dynaPolyActor = BgCheck_GetActorOfMesh(&globalCtx->colCtx, bgId)) != NULL) {
|
||||
ArmsHook_AttachHookToActor(this, &dynaPolyActor->actor);
|
||||
}
|
||||
}
|
||||
func_808C1154(this);
|
||||
func_8019F1C0(&this->actor.projectedPos, 0x1829);
|
||||
} else {
|
||||
func_800E8668(globalCtx, &this->actor.world.pos);
|
||||
CollisionCheck_SpawnShieldParticlesMetal(globalCtx, &this->actor.world.pos);
|
||||
func_8019F1C0(&this->actor.projectedPos, 0x1813);
|
||||
}
|
||||
} else {
|
||||
@@ -305,8 +318,8 @@ void ArmsHook_Draw(Actor* thisx, GlobalContext* globalCtx) {
|
||||
gSPMatrix(sp44->polyOpa.p++, SysMatrix_AppendStateToPolyOpaDisp(globalCtx->state.gfxCtx),
|
||||
G_MTX_NOPUSH | G_MTX_LOAD | G_MTX_MODELVIEW);
|
||||
gSPDisplayList(sp44->polyOpa.p++, D_0601D960);
|
||||
SysMatrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y,
|
||||
this->actor.world.pos.z, MTXMODE_NEW);
|
||||
SysMatrix_InsertTranslation(this->actor.world.pos.x, this->actor.world.pos.y, this->actor.world.pos.z,
|
||||
MTXMODE_NEW);
|
||||
Math_Vec3f_Diff(&player->unk368, &this->actor.world.pos, &sp68);
|
||||
sp48 = SQ(sp68.x) + SQ(sp68.z);
|
||||
sp4C = sqrtf(sp48);
|
||||
|
||||
@@ -9,7 +9,7 @@ typedef void (*ArmsHookActionFunc)(struct ArmsHook*, GlobalContext*);
|
||||
|
||||
typedef struct ArmsHook {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ ColQuad collider;
|
||||
/* 0x144 */ ColliderQuad collider;
|
||||
/* 0x1C4 */ s32 unk1C4;
|
||||
/* 0x1C8 */ char unk1C8[0x18];
|
||||
/* 0x1E0 */ Vec3f unk1E0;
|
||||
|
||||
@@ -26,30 +26,28 @@ const ActorInit Bg_Ikana_Ray_InitVars = {
|
||||
(ActorFunc)BgIkanaRay_Draw
|
||||
};
|
||||
|
||||
// TODO better formatting
|
||||
ColCylinderInit bgIkanaRayCylinderInit = {
|
||||
{ 10, 33, 0, 0, 0, 1 },
|
||||
{ 0, { 0x00200000, 0, 0 }, { 0, 0, 0 }, 25, 0, 1 },
|
||||
{ 90, 420, 65116}
|
||||
ColliderCylinderInit bgIkanaRayCylinderInit = {
|
||||
{ COLTYPE_NONE, AT_ON | AT_TYPE_OTHER, AC_NONE, OC1_NONE, OC2_NONE, COLSHAPE_CYLINDER, },
|
||||
{ ELEMTYPE_UNK0, { 0x00200000, 0x00, 0x00 }, { 0x00000000, 0x00, 0x00 }, TOUCH_ON | TOUCH_SFX_NONE, BUMP_NONE, OCELEM_ON, },
|
||||
{ 90, 420, -420, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
// TODO macro
|
||||
InitChainEntry bgIkanaRayCompInit[] = {
|
||||
{1, 6, 0x0FC, 4000},
|
||||
{1, 6, 0x100, 1000},
|
||||
{1, 6, 0x104, 1000},
|
||||
{0, 9, 0x058, 100}
|
||||
InitChainEntry bgIkanaRayCompInit[] = {
|
||||
ICHAIN_F32(uncullZoneForward, 4000, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneScale, 1000, ICHAIN_CONTINUE),
|
||||
ICHAIN_F32(uncullZoneDownward, 1000, ICHAIN_CONTINUE),
|
||||
ICHAIN_VEC3F_DIV1000(scale, 100, ICHAIN_STOP),
|
||||
};
|
||||
|
||||
void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ColCylinder* collision = &THIS->collision;
|
||||
ColliderCylinder* collision = &THIS->collision;
|
||||
u32 pad;
|
||||
|
||||
Actor_ProcessInitChain(thisx, bgIkanaRayCompInit);
|
||||
|
||||
Collision_InitCylinderDefault(globalCtx, collision);
|
||||
Collision_InitCylinderWithData(globalCtx, collision, thisx, &bgIkanaRayCylinderInit);
|
||||
Collision_CylinderMoveToActor(thisx, &THIS->collision);
|
||||
Collider_InitCylinder(globalCtx, collision);
|
||||
Collider_SetCylinder(globalCtx, collision, thisx, &bgIkanaRayCylinderInit);
|
||||
Collider_UpdateCylinder(thisx, &THIS->collision);
|
||||
|
||||
THIS->animatedTextures = (AnimatedTexture*)Lib_PtrSegToVirt(object_ikana_obj_001228);
|
||||
|
||||
@@ -61,8 +59,8 @@ void BgIkanaRay_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
}
|
||||
|
||||
void BgIkanaRay_Destroy(Actor* thisx, GlobalContext* globalCtx) {
|
||||
ColCylinder* collision = &THIS->collision;
|
||||
Collision_FiniCylinder(globalCtx, collision);
|
||||
ColliderCylinder* collision = &THIS->collision;
|
||||
Collider_DestroyCylinder(globalCtx, collision);
|
||||
}
|
||||
|
||||
void BgIkanaRay_SetDeactivated(BgIkanaRay* this) {
|
||||
@@ -84,7 +82,7 @@ void BgIkanaRay_SetActivated(BgIkanaRay* this) {
|
||||
}
|
||||
|
||||
void BgIkanaRay_UpdateActivated(BgIkanaRay* this, GlobalContext* globalCtx) {
|
||||
Collision_AddAT(globalCtx, &globalCtx->colCheckCtx, &this->collision.base);
|
||||
CollisionCheck_SetAT(globalCtx, &globalCtx->colCheckCtx, &this->collision.base);
|
||||
}
|
||||
|
||||
void BgIkanaRay_Update(Actor* thisx, GlobalContext* globalCtx) {
|
||||
|
||||
@@ -7,7 +7,7 @@ struct BgIkanaRay;
|
||||
|
||||
typedef struct BgIkanaRay {
|
||||
/* 0x000 */ Actor base;
|
||||
/* 0x144 */ ColCylinder collision;
|
||||
/* 0x144 */ ColliderCylinder collision;
|
||||
/* 0x190 */ AnimatedTexture* animatedTextures;
|
||||
/* 0x194 */ void (*update)(struct BgIkanaRay*, GlobalContext*);
|
||||
} BgIkanaRay; // size = 0x198
|
||||
|
||||
@@ -26,10 +26,9 @@ const ActorInit En_Nnh_InitVars = {
|
||||
(ActorFunc)EnNnh_Draw
|
||||
};
|
||||
|
||||
ColCylinderInit D_80C08A00 =
|
||||
{
|
||||
{ 0x0D, 0x00, 0x09, 0x39, 0x10, 0x01 },
|
||||
{ 0x01, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, 0x00, 0x01, 0x01 },
|
||||
ColliderCylinderInit D_80C08A00 = {
|
||||
{ COLTYPE_TREE, AT_NONE, AC_ON | AC_TYPE_PLAYER, OC1_ON | OC1_TYPE_ALL, OC2_TYPE_1, COLSHAPE_CYLINDER, },
|
||||
{ ELEMTYPE_UNK1, { 0x00000000, 0x00, 0x00 }, { 0xF7CFFFFF, 0x00, 0x00 }, TOUCH_NONE | TOUCH_SFX_NORMAL, BUMP_ON, OCELEM_ON, },
|
||||
{ 20, 50, 0, { 0, 0, 0 } },
|
||||
};
|
||||
|
||||
@@ -39,8 +38,8 @@ void EnNnh_Init(Actor *thisx, GlobalContext *globalCtx) {
|
||||
EnNnh* this = THIS;
|
||||
|
||||
Actor_SetScale(&this->actor, 0.01f);
|
||||
Collision_InitCylinderDefault(globalCtx, &this->collider);
|
||||
Collision_InitCylinderWithData(globalCtx, &this->collider, &this->actor, &D_80C08A00);
|
||||
Collider_InitCylinder(globalCtx, &this->collider);
|
||||
Collider_SetCylinder(globalCtx, &this->collider, &this->actor, &D_80C08A00);
|
||||
this->actor.targetMode = 1;
|
||||
this->actor.focus.pos = this->actor.world.pos;
|
||||
this->actor.focus.pos.y += 30.0f;
|
||||
@@ -50,7 +49,7 @@ void EnNnh_Init(Actor *thisx, GlobalContext *globalCtx) {
|
||||
void EnNnh_Destroy(Actor *thisx, GlobalContext *globalCtx) {
|
||||
EnNnh* this = THIS;
|
||||
|
||||
Collision_FiniCylinder(globalCtx, &this->collider);
|
||||
Collider_DestroyCylinder(globalCtx, &this->collider);
|
||||
}
|
||||
|
||||
void func_80C08828(EnNnh* this) {
|
||||
@@ -81,8 +80,8 @@ void EnNnh_Update(Actor *thisx, GlobalContext *globalCtx) {
|
||||
s32 pad;
|
||||
|
||||
this->actionFunc(this, globalCtx);
|
||||
Collision_CylinderMoveToActor(&this->actor, &this->collider);
|
||||
Collision_AddOT(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
|
||||
Collider_UpdateCylinder(&this->actor, &this->collider);
|
||||
CollisionCheck_SetOC(globalCtx, &globalCtx->colCheckCtx, &this->collider.base);
|
||||
}
|
||||
|
||||
void EnNnh_Draw(Actor *thisx, GlobalContext *globalCtx) {
|
||||
|
||||
@@ -9,7 +9,7 @@ typedef void (*EnNnhActionFunc)(struct EnNnh*, GlobalContext*);
|
||||
|
||||
typedef struct EnNnh {
|
||||
/* 0x000 */ Actor actor;
|
||||
/* 0x144 */ ColCylinder collider;
|
||||
/* 0x144 */ ColliderCylinder collider;
|
||||
/* 0x190 */ EnNnhActionFunc actionFunc;
|
||||
} EnNnh; // size = 0x194
|
||||
|
||||
|
||||
@@ -24,14 +24,15 @@ const ActorInit En_Tanron6_InitVars = {
|
||||
(ActorFunc)EnTanron6_Draw
|
||||
};
|
||||
|
||||
DamageTable D_80BE6170 = { 0xF0, 0xF0, 0x00, 0xF1, 0xE1, 0xE1, 0x00, 0xE1, 0xF0, 0xF0, 0xF0,
|
||||
0xE1, 0xE1, 0x46, 0xF0, 0xF0, 0xE1, 0xF0, 0xF0, 0x00, 0x00, 0xF0,
|
||||
0xE1, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0 };
|
||||
DamageTable D_80BE6170 = {
|
||||
0xF0, 0xF0, 0x00, 0xF1, 0xE1, 0xE1, 0x00, 0xE1, 0xF0, 0xF0, 0xF0, 0xE1, 0xE1, 0x46, 0xF0, 0xF0,
|
||||
0xE1, 0xF0, 0xF0, 0x00, 0x00, 0xF0, 0xE1, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0,
|
||||
};
|
||||
|
||||
void EnTanron6_Init(Actor* thisx, GlobalContext* globalCtx) {
|
||||
EnTanron6* this = THIS;
|
||||
|
||||
this->actor.colChkInfo.mass = 0xA;
|
||||
this->actor.colChkInfo.mass = 10;
|
||||
Actor_SetDrawParams(&this->actor.shape, 0, func_800B3FC0, 19.0f);
|
||||
this->actor.colChkInfo.health = 1;
|
||||
this->actor.colChkInfo.damageTable = &D_80BE6170;
|
||||
|
||||
Reference in New Issue
Block a user