diff --git a/config/SOUE01/rels/d_a_obj_bamboo_islandNP/symbols.txt b/config/SOUE01/rels/d_a_obj_bamboo_islandNP/symbols.txt index 252fe61b..51fdc0a3 100644 --- a/config/SOUE01/rels/d_a_obj_bamboo_islandNP/symbols.txt +++ b/config/SOUE01/rels/d_a_obj_bamboo_islandNP/symbols.txt @@ -2,7 +2,7 @@ _prolog = .text:0x00000000; // type:function size:0x2C scope:global _epilog = .text:0x00000030; // type:function size:0x2C scope:global _unresolved = .text:0x00000060; // type:function size:0x4 scope:global dAcObambooIsland_c_classInit__Fv = .text:0x00000070; // type:function size:0x7C -interactCallback__18dAcObambooIsland_cFPvP9dAcBase_cP12dAcObjBase_c = .text:0x000000F0; // type:function size:0x7C +rideCallback__18dAcObambooIsland_cFP4dBgWP12dAcObjBase_cP12dAcObjBase_c = .text:0x000000F0; // type:function size:0x7C createHeap__18dAcObambooIsland_cFv = .text:0x00000170; // type:function size:0x134 create__18dAcObambooIsland_cFv = .text:0x000002B0; // type:function size:0xE8 doDelete__18dAcObambooIsland_cFv = .text:0x000003A0; // type:function size:0x8 diff --git a/config/SOUE01/splits.txt b/config/SOUE01/splits.txt index 9ea2e393..2d4804e1 100644 --- a/config/SOUE01/splits.txt +++ b/config/SOUE01/splits.txt @@ -893,7 +893,30 @@ libms/msgfile.c: .data start:0x80547278 end:0x80547288 .sdata start:0x80574028 end:0x80574048 -toBeSorted/cc/d_cc_d.cpp: +d/col/c/c_bg_s_chk.cpp: + .text start:0x80327140 end:0x8032721C + .data start:0x80547388 end:0x80547394 + +d/col/c/c_bg_s_gnd_chk.cpp: + .text start:0x80327220 end:0x8032734C + .data start:0x80547398 end:0x805473A4 + +d/col/c/c_bg_s_lin_chk.cpp: + .text start:0x80327350 end:0x80327504 + .data start:0x805473A8 end:0x805473B8 + +d/col/c/c_bg_s_poly_info.cpp: + .text start:0x80327510 end:0x8032766C + +d/col/c/c_bg_s_shdw_draw.cpp: + .text start:0x80327670 end:0x80328064 + .data start:0x805473B8 end:0x805473C4 + +d/col/c/c_bg_w.cpp: + .text start:0x80328070 end:0x80328114 + .data start:0x805473C8 end:0x805473D4 + +d/col/c/c_cc_d.cpp: .text start:0x80328120 end:0x8032BC78 .ctors start:0x804DB8F8 end:0x804DB8FC .rodata start:0x804F0AF0 end:0x804F0B80 @@ -901,20 +924,148 @@ toBeSorted/cc/d_cc_d.cpp: .sdata2 start:0x8057CF98 end:0x8057CFBC .bss start:0x805D0128 end:0x805D0134 -toBeSorted/cc/d_cc_unknown.cpp: - .text start:0x8032BEC0 end:0x8032BF00 - .data start:0x80547668 end:0x80547678 +d/col/c/c_m2d.cpp: + .text start:0x8032BC80 end:0x8032BEB8 -toBeSorted/cc/d_cc_m3d.cpp: - .text start:0x8032BF00 end:0x80337B58 +d/col/c/c_m3d.cpp: + .text start:0x8032BEC0 end:0x80337B58 + .data start:0x80547668 end:0x80547674 -toBeSorted/cc/d_cc_m3d_g_cyl.cpp: +d/col/c/c_m3d_g_aab.cpp: + .text start:0x80337B60 end:0x80337E94 + .sdata2 start:0x8057D030 end:0x8057D038 + +d/col/c/c_m3d_g_cps.cpp: + .text start:0x80337EA0 end:0x80338018 + .sdata2 start:0x8057D038 end:0x8057D03C + +d/col/c/c_m3d_g_cyl.cpp: .text start:0x80338020 end:0x80338348 + .sdata2 start:0x8057D040 end:0x8057D044 -toBeSorted/cc/d_cc_m3d_g_sph.cpp: +d/col/c/c_m3d_g_lin.cpp: + .text start:0x80338350 end:0x8033842C + +d/col/c/c_m3d_g_pla.cpp: + .text start:0x80338430 end:0x80338678 + +d/col/c/c_m3d_g_sph.cpp: .text start:0x80338680 end:0x803388D8 + .sdata2 start:0x8057D050 end:0x8057D058 -toBeSorted/cc/d_cc_shape_colliders.cpp: +d/col/c/c_m3d_g_tri.cpp: + .text start:0x803388E0 end:0x80338940 + +d/col/c/c_m3d_g_unk.cpp: + .text start:0x80338940 end:0x80338F4C + .sdata2 start:0x8057D058 end:0x8057D060 + +d/col/c/c_partition.cpp: + .text start:0x80338F50 end:0x80339BAC + .ctors start:0x804DB8FC end:0x804DB900 + .data start:0x80547688 end:0x80547694 + +d/col/bg/d_bg_pc.cpp: + .text start:0x80339BB0 end:0x80339BC8 + +d/col/bg/d_bg_plc.cpp: + .text start:0x80339BD0 end:0x80339BF8 + +d/col/bg/d_bg_s.cpp: + .text start:0x80339C00 end:0x8033F14C + .rodata start:0x804F0C00 end:0x804F0D00 + .data start:0x80547698 end:0x805477C0 + .sdata start:0x80574060 end:0x80574070 + .sdata2 start:0x8057D068 end:0x8057D0FC + +d/col/bg/d_bg_s_acch.cpp: + .text start:0x8033F150 end:0x803412F8 + .data start:0x805477C0 end:0x80547868 + .sdata2 start:0x8057D100 end:0x8057D13C + +d/col/bg/d_bg_s_chk.cpp: + .text start:0x80341300 end:0x80341488 + .data start:0x80547868 end:0x80547898 + +d/col/bg/d_bg_s_gnd_chk.cpp: + .text start:0x80341490 end:0x80341D68 + .ctors start:0x804DB900 end:0x804DB904 + .data start:0x80547898 end:0x80547994 + .sbss start:0x80575CF8 end:0x80575CFC + .sdata2 start:0x8057D140 end:0x8057D144 + .bss start:0x805D01C8 end:0x805D0268 + +d/col/bg/d_bg_s_grp_pass_chk.cpp: + .text start:0x80341D70 end:0x80341E18 + .data start:0x80547998 end:0x805479A4 + +d/col/bg/d_bg_s_lin_chk.cpp: + .text start:0x80341E20 end:0x80342C98 + .ctors start:0x804DB904 end:0x804DB908 + .data start:0x805479A8 end:0x80547B88 + .sdata2 start:0x8057D148 end:0x8057D150 + .bss start:0x805D0268 end:0x805D03B8 + +d/col/bg/d_bg_s_poly_pass_chk.cpp: + .text start:0x80342CA0 end:0x80342D68 + .data start:0x80547B88 end:0x80547B94 + +d/col/bg/d_bg_s_roof_chk.cpp: + .text start:0x80342D70 end:0x803431A8 + .ctors start:0x804DB908 end:0x804DB90C + .data start:0x80547B98 end:0x80547C28 + .sbss start:0x80575D00 end:0x80575D04 + .sdata2 start:0x8057D150 end:0x8057D158 + .bss start:0x805D03B8 end:0x805D0458 + +d/col/bg/d_bg_s_sph_chk.cpp: + .text start:0x803431B0 end:0x80343428 + .data start:0x80547C28 end:0x80547C88 + .sdata2 start:0x8057D158 end:0x8057D15C + +d/col/bg/d_bg_s_spl_grp_chk.cpp: + .text start:0x80343430 end:0x803435C8 + .data start:0x80547C88 end:0x80547CB8 + .sdata2 start:0x8057D160 end:0x8057D16C + +d/col/bg/d_bg_s_wtr_chk.cpp: + .text start:0x803435D0 end:0x80343818 + .ctors start:0x804DB90C end:0x804DB910 + .data start:0x80547CB8 end:0x80547CE8 + .sbss start:0x80575D08 end:0x80575D0C + .bss start:0x805D0458 end:0x805D0500 + +d/col/bg/d_bg_w.cpp: + .text start:0x80343820 end:0x8034A94C + .ctors start:0x804DB910 end:0x804DB914 + .data start:0x80547CE8 end:0x80547F10 + .sbss start:0x80575D10 end:0x80575D20 + .sdata2 start:0x8057D170 end:0x8057D1AC + .bss start:0x805D0500 end:0x805D0A50 + +d/col/bg/d_bg_w_base.cpp: + .text start:0x8034A950 end:0x8034AF48 + .data start:0x80547F10 end:0x80548018 + +d/col/bg/d_bg_w_kcol.cpp: + .text start:0x8034AF50 end:0x80352138 + .data start:0x80548018 end:0x80548120 + .sdata start:0x80574070 end:0x80574088 + .sdata2 start:0x8057D1B0 end:0x8057D228 + .bss start:0x805D0A50 end:0x805D0F90 + +d/col/bg/d_bg_w_sv.cpp: + .text start:0x80352140 end:0x80352920 + .data start:0x80548120 end:0x80548234 + .sdata2 start:0x8057D228 end:0x8057D230 + +d/col/bg/d_bg_w_time.cpp: + .text start:0x80352920 end:0x80353B44 + .data start:0x80548238 end:0x80548340 + .sdata2 start:0x8057D230 end:0x8057D240 + .bss start:0x805D0F90 end:0x805D0FB4 + +d/col/cc/d_cc_shape_colliders.cpp: .text start:0x80353B50 end:0x80354298 .data start:0x80548340 end:0x80548580 diff --git a/config/SOUE01/symbols.txt b/config/SOUE01/symbols.txt index d7c3f4c4..062fe9fc 100644 --- a/config/SOUE01/symbols.txt +++ b/config/SOUE01/symbols.txt @@ -14432,7 +14432,7 @@ __dt__46sFStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c>Fv = .text:0x80271AF0; // __dt__19dAcOswMdlCallback_cFv = .text:0x80271BA0; // type:function size:0x58 timingB__19dAcOswMdlCallback_cFUlPQ34nw4r3g3d13WorldMtxManipQ34nw4r3g3d6ResMdl = .text:0x80271C00; // type:function size:0x90 isPushableBlock__FP9dAcBase_c = .text:0x80271C90; // type:function size:0x5C -interactCallback__8dAcOsw_cFPvP9dAcBase_cP12dAcObjBase_c = .text:0x80271CF0; // type:function size:0x1CC +rideCallback__8dAcOsw_cFP4dBgWP12dAcObjBase_cP12dAcObjBase_c = .text:0x80271CF0; // type:function size:0x1CC getStateID__76sStateMgr_c<8dAcOsw_c,20sStateMethodUsr_FI_c,12sFStateFct_c,13sStateIDChk_c>CFv = .text:0x80271EC0; // type:function size:0x10 createHeap__8dAcOsw_cFv = .text:0x80271ED0; // type:function size:0x1B4 actorCreate__8dAcOsw_cFv = .text:0x80272090; // type:function size:0x1B4 @@ -17841,7 +17841,7 @@ makeHeapOnCurrentGameHeap__5mHeapFUlPCcUlUl = .text:0x802F1640; // type:function mMtx__ctor = .text:0x802F1660; // type:function size:0x44 XrotS__6mMtx_cFRC4mAng = .text:0x802F16B0; // type:function size:0xBC mMtx__XrotM = .text:0x802F1770; // type:function size:0x4C -mMtx__YrotS = .text:0x802F17C0; // type:function size:0xBC +YrotS__6mMtx_cFRC4mAng = .text:0x802F17C0; // type:function size:0xBC YrotM__6mMtx_cFRC4mAng = .text:0x802F1880; // type:function size:0x4C mMtx__ZrotS = .text:0x802F18D0; // type:function size:0xBC ZrotM__6mMtx_cFRC4mAng = .text:0x802F1990; // type:function size:0x4C @@ -18712,34 +18712,34 @@ fn_80327070 = .text:0x80327070; // type:function size:0x34 fn_803270B0 = .text:0x803270B0; // type:function size:0x14 fn_803270D0 = .text:0x803270D0; // type:function size:0x44 fn_80327120 = .text:0x80327120; // type:function size:0x14 -fn_80327140 = .text:0x80327140; // type:function size:0x60 -fn_803271A0 = .text:0x803271A0; // type:function size:0x5C -fn_80327200 = .text:0x80327200; // type:function size:0x1C -fn_80327220 = .text:0x80327220; // type:function size:0x84 -fn_803272B0 = .text:0x803272B0; // type:function size:0x58 -BgChecker__setPosition = .text:0x80327310; // type:function size:0x1C -BgChecker__setPosition2 = .text:0x80327330; // type:function size:0x1C -fn_80327350 = .text:0x80327350; // type:function size:0x64 -fn_803273C0 = .text:0x803273C0; // type:function size:0x58 -fn_80327420 = .text:0x80327420; // type:function size:0x70 -fn_80327490 = .text:0x80327490; // type:function size:0x68 -fn_80327500 = .text:0x80327500; // type:function size:0x4 -cBgS_PolyInfo__ChkSetInfo = .text:0x80327510; // type:function size:0x2C -fn_80327540 = .text:0x80327540; // type:function size:0x5C -cBgS_PolyInfo__ChkSafe = .text:0x803275A0; // type:function size:0x28 -cBgS_PolyInfo__ChkBgIndex = .text:0x803275D0; // type:function size:0x18 -fn_803275F0 = .text:0x803275F0; // type:function size:0x7C -fn_80327670 = .text:0x80327670; // type:function size:0x44 -fn_803276C0 = .text:0x803276C0; // type:function size:0x58 -fn_80327720 = .text:0x80327720; // type:function size:0x34 -fn_80327760 = .text:0x80327760; // type:function size:0x8 -fn_80327770 = .text:0x80327770; // type:function size:0x8 -fn_80327780 = .text:0x80327780; // type:function size:0x8E4 -cBgW_BgId__cBgW_BgId = .text:0x80328070; // type:function size:0x18 -fn_80328090 = .text:0x80328090; // type:function size:0x40 -cBgW_BgId__Regist = .text:0x803280D0; // type:function size:0x8 -cBgSomething__Release = .text:0x803280E0; // type:function size:0xC -dBgW_Base__CheckUsed = .text:0x803280F0; // type:function size:0x24 +__ct__8cBgS_ChkFv = .text:0x80327140; // type:function size:0x60 +__dt__8cBgS_ChkFv = .text:0x803271A0; // type:function size:0x5C +SetActorID__8cBgS_ChkFPUl = .text:0x80327200; // type:function size:0x1C +__ct__11cBgS_GndChkFv = .text:0x80327220; // type:function size:0x84 +__dt__11cBgS_GndChkFv = .text:0x803272B0; // type:function size:0x58 +SetPos__11cBgS_GndChkFRC7mVec3_c = .text:0x80327310; // type:function size:0x1C +SetPos__11cBgS_GndChkFPC7mVec3_c = .text:0x80327330; // type:function size:0x1C +__ct__11cBgS_LinChkFv = .text:0x80327350; // type:function size:0x64 +__dt__11cBgS_LinChkFv = .text:0x803273C0; // type:function size:0x58 +Ct__11cBgS_LinChkFv = .text:0x80327420; // type:function size:0x70 +Set2__11cBgS_LinChkFRC7mVec3_cRC7mVec3_cUl = .text:0x80327490; // type:function size:0x68 +SetEnd__11cBgS_LinChkFPC7mVec3_c = .text:0x80327500; // type:function size:0x4 +ChkSetInfo__13cBgS_PolyInfoCFv = .text:0x80327510; // type:function size:0x2C +SetPolyInfo__13cBgS_PolyInfoFRC13cBgS_PolyInfo = .text:0x80327540; // type:function size:0x5C +ChkSafe__13cBgS_PolyInfoCFPCvl = .text:0x803275A0; // type:function size:0x28 +ChkBgIndex__13cBgS_PolyInfoCFv = .text:0x803275D0; // type:function size:0x18 +GetAngle__13cBgS_PolyInfoCF4mAng = .text:0x803275F0; // type:function size:0x7C +__ct__13cBgS_ShdwDrawFv = .text:0x80327670; // type:function size:0x44 +__dt__13cBgS_ShdwDrawFv = .text:0x803276C0; // type:function size:0x58 +Set__13cBgS_ShdwDrawFRC7mVec3_cRC7mVec3_c = .text:0x80327720; // type:function size:0x34 +SetCallback__13cBgS_ShdwDrawFPFP13cBgS_ShdwDrawRC7mVec3_cRC7mVec3_cRC7mVec3_cRC8cM3dGTri_v = .text:0x80327760; // type:function size:0x8 +SetP__13cBgS_ShdwDrawFP8cM3dGPla = .text:0x80327770; // type:function size:0x8 +Calc__13cBgS_ShdwDrawFP8cM3dGTriP7mVec3_cP7mVec3_cP7mVec3_c = .text:0x80327780; // type:function size:0x8E4 +__ct__9cBgW_BgIdFv = .text:0x80328070; // type:function size:0x18 +__dt__9cBgW_BgIdFv = .text:0x80328090; // type:function size:0x40 +Regist__9cBgW_BgIdFi = .text:0x803280D0; // type:function size:0x8 +Release__9cBgW_BgIdFv = .text:0x803280E0; // type:function size:0xC +ChkUsed__9cBgW_BgIdCFv = .text:0x803280F0; // type:function size:0x24 __ct__15dCcD_DivideInfoFv = .text:0x80328120; // type:function size:0x10 __dt__15dCcD_DivideInfoFv = .text:0x80328130; // type:function size:0x40 __ct__15dCcD_DivideAreaFv = .text:0x80328170; // type:function size:0x10 @@ -18840,7 +18840,7 @@ getShapeAccess__15dCcD_ShapeAttr2Fv = .text:0x803298A0; // type:function size:0x dCcD_ShapeAttr_0x50__15dCcD_ShapeAttr2Fv = .text:0x80329900; // type:function size:0x1C dCcD_ShapeAttr_0x58__15dCcD_ShapeAttr2Fv = .text:0x80329920; // type:function size:0x4C __ct__15dCcD_ShapeAttr5Fv = .text:0x80329970; // type:function size:0x4C -__dt__9cM3dGAabbFv = .text:0x803299C0; // type:function size:0x40 +__dt__8cM3dGUnkFv = .text:0x803299C0; // type:function size:0x40 __dt__15dCcD_ShapeAttr5Fv = .text:0x80329A00; // type:function size:0x58 dCcD_ShapeAttr_0x0C__15dCcD_ShapeAttr5Fv = .text:0x80329A60; // type:function size:0x1B0 dCcD_ShapeAttr_0x10__15dCcD_ShapeAttr5Fv = .text:0x80329C10; // type:function size:0x1C @@ -18947,753 +18947,753 @@ setSomeAtFlags__11dCcD_GObjCoFUl = .text:0x8032BC10; // type:function size:0x1C adjustHitPos__11dCcD_GObjCoFff = .text:0x8032BC30; // type:function size:0x4 __sinit_\d_cc_d_cpp = .text:0x8032BC40; // type:function size:0x2C @44@__dt__15dCcD_ShapeAttr5Fv = .text:0x8032BC70; // type:function size:0x8 -fn_8032BC80 = .text:0x8032BC80; // type:function size:0x238 +cM2d_CrossCirLin__FR8cM2dGCirffffPfPf = .text:0x8032BC80; // type:function size:0x238 fn_8032BEC0 = .text:0x8032BEC0; // type:function size:0x40 -cM3d_Len2dSqPntAndSegLine = .text:0x8032BF00; // type:function size:0xB0 -cM3d_Len3dSqPntAndSegLine = .text:0x8032BFB0; // type:function size:0x11C -cM3d_SignedLenPlaAndPos = .text:0x8032C0D0; // type:function size:0x84 +cM3d_Len2dSqPntAndSegLine__FffffffPfPfPf = .text:0x8032BF00; // type:function size:0xB0 +cM3d_Len3dSqPntAndSegLine__FPC8cM3dGLinPCQ34nw4r4math4VEC3PQ34nw4r4math4VEC3PfPf = .text:0x8032BFB0; // type:function size:0x11C +cM3d_SignedLenPlaAndPos__FPC8cM3dGPlaPCQ34nw4r4math4VEC3 = .text:0x8032C0D0; // type:function size:0x84 cM3d_CalcPla__FPCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PQ34nw4r4math4VEC3Pf = .text:0x8032C160; // type:function size:0x10C -fn_8032C270 = .text:0x8032C270; // type:function size:0x298 -fn_8032C510 = .text:0x8032C510; // type:function size:0x1D0 -fn_8032C6E0 = .text:0x8032C6E0; // type:function size:0xD34 -fn_8032D420 = .text:0x8032D420; // type:function size:0x134 -fn_8032D560 = .text:0x8032D560; // type:function size:0x224 -fn_8032D790 = .text:0x8032D790; // type:function size:0x228 -fn_8032D9C0 = .text:0x8032D9C0; // type:function size:0x228 -fn_8032DBF0 = .text:0x8032DBF0; // type:function size:0x184 -fn_8032DD80 = .text:0x8032DD80; // type:function size:0x8C -fn_8032DE10 = .text:0x8032DE10; // type:function size:0x224 -fn_8032E040 = .text:0x8032E040; // type:function size:0xDC -fn_8032E120 = .text:0x8032E120; // type:function size:0x224 -fn_8032E350 = .text:0x8032E350; // type:function size:0x228 -fn_8032E580 = .text:0x8032E580; // type:function size:0x8C -fn_8032E610 = .text:0x8032E610; // type:function size:0x2F0 -fn_8032E900 = .text:0x8032E900; // type:function size:0x2E4 -fn_8032EBF0 = .text:0x8032EBF0; // type:function size:0xD4 -fn_8032ECD0 = .text:0x8032ECD0; // type:function size:0x44 -fn_8032ED20 = .text:0x8032ED20; // type:function size:0x2CC -fn_8032EFF0 = .text:0x8032EFF0; // type:function size:0x438 -fn_8032F430 = .text:0x8032F430; // type:function size:0x558 -fn_8032F990 = .text:0x8032F990; // type:function size:0x300 -fn_8032FC90 = .text:0x8032FC90; // type:function size:0xE4 -fn_8032FD80 = .text:0x8032FD80; // type:function size:0x98 -fn_8032FE20 = .text:0x8032FE20; // type:function size:0xE4 -fn_8032FF10 = .text:0x8032FF10; // type:function size:0xFC -fn_80330010 = .text:0x80330010; // type:function size:0x330 -fn_80330340 = .text:0x80330340; // type:function size:0x12C -fn_80330470 = .text:0x80330470; // type:function size:0x1C4 -fn_80330640 = .text:0x80330640; // type:function size:0x320 +cM3d_Check_LinLin__FPC8cM3dGLinPC8cM3dGLinPfPf = .text:0x8032C270; // type:function size:0x298 +cM3d_Cross_LinPla__FPC8cM3dGLinPC8cM3dGPlaPQ34nw4r4math4VEC3bb = .text:0x8032C510; // type:function size:0x1D0 +cM3d_Cross_MinMaxBoxLine__FPCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3 = .text:0x8032C6E0; // type:function size:0xD34 +cM3d_InclusionCheckPosIn3PosBox3d__FPCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3f = .text:0x8032D420; // type:function size:0x134 +cM3d_CrossX_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3f = .text:0x8032D560; // type:function size:0x224 +cM3d_CrossX_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3 = .text:0x8032D790; // type:function size:0x228 +cM3d_CrossY_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3 = .text:0x8032D9C0; // type:function size:0x228 +cM3d_CrossY_Tri_Front__FRCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3 = .text:0x8032DBF0; // type:function size:0x184 +cM3d_CrossY_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3Pf = .text:0x8032DD80; // type:function size:0x8C +cM3d_CrossY_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3f = .text:0x8032DE10; // type:function size:0x224 +cM3d_CrossY_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3PC10cM3d_RangePf = .text:0x8032E040; // type:function size:0xDC +cM3d_CrossZ_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3f = .text:0x8032E120; // type:function size:0x224 +cM3d_CrossZ_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3 = .text:0x8032E350; // type:function size:0x228 +cM3d_CrossZ_Tri__FPC8cM3dGTriPCQ34nw4r4math4VEC3Pf = .text:0x8032E580; // type:function size:0x8C +cM3d_Cross_LinTri__FPC8cM3dGLinPC8cM3dGTriPQ34nw4r4math4VEC3bb = .text:0x8032E610; // type:function size:0x2F0 +cM3d_Cross_LinTri__FPC8cM3dGLinPCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PC8cM3dGTriPQ34nw4r4math4VEC3bb = .text:0x8032E900; // type:function size:0x2E4 +cM3d_Cross_LinTri_Easy__FPC8cM3dGTriPCQ34nw4r4math4VEC3 = .text:0x8032EBF0; // type:function size:0xD4 +cM3d_Cross_SphPnt__FPC8cM3dGSphPCQ34nw4r4math4VEC3 = .text:0x8032ECD0; // type:function size:0x44 +cM3d_Cross_LinSph__FPC8cM3dGLinPC8cM3dGSphPQ34nw4r4math4VEC3 = .text:0x8032ED20; // type:function size:0x2CC +cM3d_Cross_LinSph_CrossPos__FRC8cM3dGSphRC8cM3dGLinPQ34nw4r4math4VEC3PQ34nw4r4math4VEC3 = .text:0x8032EFF0; // type:function size:0x438 +cM3d_Cross_CylSph__FPC8cM3dGCylPC8cM3dGSphPf = .text:0x8032F430; // type:function size:0x558 +cM3d_Cross_CylSph__FPC8cM3dGCylPC8cM3dGSphPQ34nw4r4math4VEC3Pf = .text:0x8032F990; // type:function size:0x300 +cM3d_Cross_SphSph__FPC8cM3dGSphPC8cM3dGSphPf = .text:0x8032FC90; // type:function size:0xE4 +cM3d_Cross_SphSph__FPC8cM3dGSphPC8cM3dGSphPfPf = .text:0x8032FD80; // type:function size:0x98 +cM3d_Cross_SphSph__FPC8cM3dGSphPC8cM3dGSphPQ34nw4r4math4VEC3 = .text:0x8032FE20; // type:function size:0xE4 +cM3d_CalcSphVsTriCrossPoint__FPC8cM3dGSphPC8cM3dGTriPQ34nw4r4math4VEC3 = .text:0x8032FF10; // type:function size:0xFC +cM3d_Cross_SphTri__FPC8cM3dGSphPC8cM3dGTriPQ34nw4r4math4VEC3PfPQ34nw4r4math4VEC3 = .text:0x80330010; // type:function size:0x330 +cM3d_Cross_CylCyl__FPC8cM3dGCylPC8cM3dGCylPf = .text:0x80330340; // type:function size:0x12C +cM3d_Cross_CylCyl__FPC8cM3dGCylPC8cM3dGCylPQ34nw4r4math4VEC3 = .text:0x80330470; // type:function size:0x1C4 +cM3d_Cross_CylTri__FPC8cM3dGCylPC8cM3dGTriPQ34nw4r4math4VEC3 = .text:0x80330640; // type:function size:0x320 fn_80330960 = .text:0x80330960; // type:function size:0x34 -fn_803309A0 = .text:0x803309A0; // type:function size:0xB30 -fn_803314D0 = .text:0x803314D0; // type:function size:0x5C -fn_80331530 = .text:0x80331530; // type:function size:0x64 +cM3d_Cross_CylLin__FPC8cM3dGCylPC8cM3dGLinPQ34nw4r4math4VEC3PQ34nw4r4math4VEC3 = .text:0x803309A0; // type:function size:0xB30 +cM3d_Cross_CylPntPnt__FPC8cM3dGCylPCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PQ34nw4r4math4VEC3PQ34nw4r4math4VEC3 = .text:0x803314D0; // type:function size:0x5C +cM3d_Cross_CylPnt__FPC8cM3dGCylPCQ34nw4r4math4VEC3 = .text:0x80331530; // type:function size:0x64 fn_803315A0 = .text:0x803315A0; // type:function size:0x9F8 fn_80331FA0 = .text:0x80331FA0; // type:function size:0x2BC fn_80332260 = .text:0x80332260; // type:function size:0x19C8 fn_80333C30 = .text:0x80333C30; // type:function size:0x100 fn_80333D30 = .text:0x80333D30; // type:function size:0x244 -fn_80333F80 = .text:0x80333F80; // type:function size:0x14C -fn_803340D0 = .text:0x803340D0; // type:function size:0x628 -fn_80334700 = .text:0x80334700; // type:function size:0x2B8 -fn_803349C0 = .text:0x803349C0; // type:function size:0x360 +cM3d_Cross_CpsSph_CrossPos__FRC8cM3dGCpsRC8cM3dGSphRCQ34nw4r4math4VEC3PQ34nw4r4math4VEC3 = .text:0x80333F80; // type:function size:0x14C +cM3d_Cross_CpsSph__FRC8cM3dGCpsRC8cM3dGSphPQ34nw4r4math4VEC3 = .text:0x803340D0; // type:function size:0x628 +cM3d_Cross_TriTri__FRC8cM3dGTriRC8cM3dGTriPQ34nw4r4math4VEC3 = .text:0x80334700; // type:function size:0x2B8 +cM3d_Cross_CpsTri__FRC8cM3dGCps8cM3dGTriPQ34nw4r4math4VEC3 = .text:0x803349C0; // type:function size:0x360 fn_80334D20 = .text:0x80334D20; // type:function size:0x1C4 -fn_80334EF0 = .text:0x80334EF0; // type:function size:0xA0 +cM3d_CalcVecZAngle__FRCQ34nw4r4math4VEC3P7mAng3_c = .text:0x80334EF0; // type:function size:0xA0 fn_80334F90 = .text:0x80334F90; // type:function size:0x110 fn_803350A0 = .text:0x803350A0; // type:function size:0x18 -fn_803350C0 = .text:0x803350C0; // type:function size:0x2C -fn_803350F0 = .text:0x803350F0; // type:function size:0x194 -fn_80335290 = .text:0x80335290; // type:function size:0x144 -fn_803353E0 = .text:0x803353E0; // type:function size:0x10 -fn_803353F0 = .text:0x803353F0; // type:function size:0xEC -fn_803354E0 = .text:0x803354E0; // type:function size:0xB20 +cM3d_PlaneCrossLineProcWork__FfffffffPfPf = .text:0x803350C0; // type:function size:0x2C +cM3d_2PlaneCrossLine__FRC8cM3dGPlaRC8cM3dGPlaP8cM3dGLin = .text:0x803350F0; // type:function size:0x194 +cM3d_3PlaneCrossPos__FRC8cM3dGPlaRC8cM3dGPlaRC8cM3dGPlaPQ34nw4r4math4VEC3 = .text:0x80335290; // type:function size:0x144 +cM3d_lineVsPosSuisenCross__FPC8cM3dGLinPCQ34nw4r4math4VEC3PQ34nw4r4math4VEC3 = .text:0x803353E0; // type:function size:0x10 +cM3d_lineVsPosSuisenCross__FRCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3PQ34nw4r4math4VEC3 = .text:0x803353F0; // type:function size:0xEC +fn_803354e0__FP8cM3dGUnkP8cM3dGUnkPQ34nw4r4math4VEC3 = .text:0x803354E0; // type:function size:0xB20 fn_80336000 = .text:0x80336000; // type:function size:0x108 -fn_80336110 = .text:0x80336110; // type:function size:0x3C4 -fn_803364E0 = .text:0x803364E0; // type:function size:0x858 +fn_80336110__FP8cM3dGCylP8cM3dGUnkPQ34nw4r4math4VEC3 = .text:0x80336110; // type:function size:0x3C4 +fn_803364e0__FP8cM3dGCylP8cM3dGUnkPf = .text:0x803364E0; // type:function size:0x858 fn_80336D40 = .text:0x80336D40; // type:function size:0x4C -fn_80336D90 = .text:0x80336D90; // type:function size:0x68C +fn_80336d90__FP8cM3dGCpsP8cM3dGUnkPQ34nw4r4math4VEC3 = .text:0x80336D90; // type:function size:0x68C fn_80337420 = .text:0x80337420; // type:function size:0x264 -fn_80337690 = .text:0x80337690; // type:function size:0xE4 -fn_80337780 = .text:0x80337780; // type:function size:0x308 +fn_80337690__FP8cM3dGUnkP8cM3dGSphPQ34nw4r4math4VEC3 = .text:0x80337690; // type:function size:0xE4 +fn_80337780__FP8cM3dGUnkP8cM3dGSphPf = .text:0x80337780; // type:function size:0x308 fn_80337A90 = .text:0x80337A90; // type:function size:0x80 fn_80337B10 = .text:0x80337B10; // type:function size:0x48 -Vec3f__setMax = .text:0x80337B60; // type:function size:0x40 -Vec3f__setMin = .text:0x80337BA0; // type:function size:0x40 -fn_80337BE0 = .text:0x80337BE0; // type:function size:0x44 -fn_80337C30 = .text:0x80337C30; // type:function size:0x4C -fn_80337C80 = .text:0x80337C80; // type:function size:0x7C -fn_80337D00 = .text:0x80337D00; // type:function size:0xAC -fn_80337DB0 = .text:0x80337DB0; // type:function size:0x64 -fn_80337E20 = .text:0x80337E20; // type:function size:0x74 -fn_80337EA0 = .text:0x80337EA0; // type:function size:0x18 -fn_80337EC0 = .text:0x80337EC0; // type:function size:0x20 -fn_80337EE0 = .text:0x80337EE0; // type:function size:0x8 -fn_80337EF0 = .text:0x80337EF0; // type:function size:0x34 -fn_80337F30 = .text:0x80337F30; // type:function size:0x4 -fn_80337F40 = .text:0x80337F40; // type:function size:0xD8 -setC__8cM3dGCylFRC7mVec3_cff = .text:0x80338020; // type:function size:0x5C -setC__8cM3dGCylFRC7mVec3_c = .text:0x80338080; // type:function size:0x1C -setH__8cM3dGCylFf = .text:0x803380A0; // type:function size:0x18 -setR__8cM3dGCylFf = .text:0x803380C0; // type:function size:0x18 -fn_803380E0 = .text:0x803380E0; // type:function size:0x4 -fn_803380F0 = .text:0x803380F0; // type:function size:0x4 -fn_80338100 = .text:0x80338100; // type:function size:0x6C -fn_80338170 = .text:0x80338170; // type:function size:0x1D8 -fn_80338350 = .text:0x80338350; // type:function size:0x34 -fn_80338390 = .text:0x80338390; // type:function size:0x4 -fn_803383A0 = .text:0x803383A0; // type:function size:0x70 -fn_80338410 = .text:0x80338410; // type:function size:0x1C -fn_80338430 = .text:0x80338430; // type:function size:0xE8 -fn_80338520 = .text:0x80338520; // type:function size:0x58 -fn_80338580 = .text:0x80338580; // type:function size:0xAC -fn_80338630 = .text:0x80338630; // type:function size:0x48 +SetMin__8cM3dGAabFRC7mVec3_c = .text:0x80337B60; // type:function size:0x40 +SetMax__8cM3dGAabFRC7mVec3_c = .text:0x80337BA0; // type:function size:0x40 +CalcCenter__8cM3dGAabCFR7mVec3_c = .text:0x80337BE0; // type:function size:0x44 +PlusR__8cM3dGAabFf = .text:0x80337C30; // type:function size:0x4C +Clamp__8cM3dGAabCFRC7mVec3_cR7mVec3_c = .text:0x80337C80; // type:function size:0x7C +Set__8cM3dGAabFRC8cM3dGSph = .text:0x80337D00; // type:function size:0xAC +Cross__8cM3dGAabCFRC7mVec3_c = .text:0x80337DB0; // type:function size:0x64 +SetBounds__8cM3dGAabFRC7mVec3_cRC7mVec3_c = .text:0x80337E20; // type:function size:0x74 +__ct__8cM3dGCpsFv = .text:0x80337EA0; // type:function size:0x18 +SetR__8cM3dGCpsFf = .text:0x80337EC0; // type:function size:0x20 +Set_0x1C__8cM3dGCpsFf = .text:0x80337EE0; // type:function size:0x8 +Set__8cM3dGCpsFRC7mVec3_cRC7mVec3_cf = .text:0x80337EF0; // type:function size:0x34 +fn_80337f30__8cM3dGCpsFP8cM3dGUnkP7mVec3_c = .text:0x80337F30; // type:function size:0x4 +fn_80337f40__8cM3dGCpsCFRC7mVec3_c = .text:0x80337F40; // type:function size:0xD8 +SetC__8cM3dGCylFRC7mVec3_cff = .text:0x80338020; // type:function size:0x5C +SetC__8cM3dGCylFRC7mVec3_c = .text:0x80338080; // type:function size:0x1C +SetH__8cM3dGCylFf = .text:0x803380A0; // type:function size:0x18 +SetR__8cM3dGCylFf = .text:0x803380C0; // type:function size:0x18 +fn_803380e0__8cM3dGCylFP8cM3dGUnkP7mVec3_c = .text:0x803380E0; // type:function size:0x4 +fn_803380f0__8cM3dGCylFP8cM3dGUnkPf = .text:0x803380F0; // type:function size:0x4 +Cross__8cM3dGCylCFRC7mVec3_c = .text:0x80338100; // type:function size:0x6C +Clamp__8cM3dGCylCFRC7mVec3_cR7mVec3_c = .text:0x80338170; // type:function size:0x1D8 +SetStartEnd__8cM3dGLinFRCQ34nw4r4math4VEC3RCQ34nw4r4math4VEC3 = .text:0x80338350; // type:function size:0x34 +SetStartEnd__8cM3dGLinFPC7mVec3_cPC7mVec3_c = .text:0x80338390; // type:function size:0x4 +CalcPos__8cM3dGLinCFP7mVec3_cf = .text:0x803383A0; // type:function size:0x70 +SetStart__8cM3dGLinFRC7mVec3_c = .text:0x80338410; // type:function size:0x1C +CrossInfLin__8cM3dGPlaCFRC7mVec3_cRC7mVec3_cR7mVec3_c = .text:0x80338430; // type:function size:0xE8 +getCrossYLessD__8cM3dGPlaCFRC7mVec3_cPf = .text:0x80338520; // type:function size:0x58 +GetAngle__8cM3dGPlaCF4mAng = .text:0x80338580; // type:function size:0xAC +GetNegativeAngle__8cM3dGPlaCF4mAng = .text:0x80338630; // type:function size:0x48 __ct__8cM3dGSphFv = .text:0x80338680; // type:function size:0xC -setC__8cM3dGSphFRC7mVec3_c = .text:0x80338690; // type:function size:0x1C -set__8cM3dGSphFRC7mVec3_cf = .text:0x803386B0; // type:function size:0x44 -setR__8cM3dGSphFf = .text:0x80338700; // type:function size:0x18 -setC__8cM3dGSphFfff = .text:0x80338720; // type:function size:0x30 -fn_80338750 = .text:0x80338750; // type:function size:0x10 -fn_80338760 = .text:0x80338760; // type:function size:0x10 -fn_80338770 = .text:0x80338770; // type:function size:0x6C -fn_803387E0 = .text:0x803387E0; // type:function size:0x10 -fn_803387F0 = .text:0x803387F0; // type:function size:0xE0 -fn_803388D0 = .text:0x803388D0; // type:function size:0x8 -fn_803388E0 = .text:0x803388E0; // type:function size:0x60 -fn_80338940 = .text:0x80338940; // type:function size:0xB4 -setMinMax__9cM3dGAabbFRC7mVec3_cRC7mVec3_c = .text:0x80338A00; // type:function size:0x144 -fn_80338B50 = .text:0x80338B50; // type:function size:0xA0 -fn_80338BF0 = .text:0x80338BF0; // type:function size:0x34 -fn_80338C30 = .text:0x80338C30; // type:function size:0x10 -fn_80338C40 = .text:0x80338C40; // type:function size:0x5C -fn_80338CA0 = .text:0x80338CA0; // type:function size:0x8 -fn_80338CB0 = .text:0x80338CB0; // type:function size:0x10 -fn_80338CC0 = .text:0x80338CC0; // type:function size:0x10 -fn_80338CD0 = .text:0x80338CD0; // type:function size:0x4 -fn_80338CE0 = .text:0x80338CE0; // type:function size:0x4 -fn_80338CF0 = .text:0x80338CF0; // type:function size:0x64 -setWithYRot__9cM3dGAabbFRC7mVec3_cRC4mAng = .text:0x80338D60; // type:function size:0x78 -fn_80338DE0 = .text:0x80338DE0; // type:function size:0xBC -fn_80338EA0 = .text:0x80338EA0; // type:function size:0x90 -fn_80338F30 = .text:0x80338F30; // type:function size:0x1C -fn_80338F50 = .text:0x80338F50; // type:function size:0x20 -fn_80338F70 = .text:0x80338F70; // type:function size:0x40 -fn_80338FB0 = .text:0x80338FB0; // type:function size:0x8 +SetC__8cM3dGSphFPC7mVec3_c = .text:0x80338690; // type:function size:0x1C +Set__8cM3dGSphFPC7mVec3_cf = .text:0x803386B0; // type:function size:0x44 +SetR__8cM3dGSphFf = .text:0x80338700; // type:function size:0x18 +SetC__8cM3dGSphFfff = .text:0x80338720; // type:function size:0x30 +fn_80338750__8cM3dGSphFP8cM3dGUnkP7mVec3_c = .text:0x80338750; // type:function size:0x10 +fn_80338760__8cM3dGSphFP8cM3dGUnkPf = .text:0x80338760; // type:function size:0x10 +GetYDist__8cM3dGSphCFf = .text:0x80338770; // type:function size:0x6C +Cross__8cM3dGSphFPC8cM3dGTriPfP7mVec3_c = .text:0x803387E0; // type:function size:0x10 +Clamp__8cM3dGSphCFRC7mVec3_cR7mVec3_c = .text:0x803387F0; // type:function size:0xE0 +SetRatio__8cM3dGSphFf = .text:0x803388D0; // type:function size:0x8 +SetPos__8cM3dGTriFPCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3PCQ34nw4r4math4VEC3 = .text:0x803388E0; // type:function size:0x60 +__ct__8cM3dGUnkFv = .text:0x80338940; // type:function size:0xB4 +Set__8cM3dGUnkFRC7mVec3_cRC7mVec3_c = .text:0x80338A00; // type:function size:0x144 +Update__8cM3dGUnkFv = .text:0x80338B50; // type:function size:0xA0 +GetStartEnd__8cM3dGUnkFR7mVec3_cR7mVec3_c = .text:0x80338BF0; // type:function size:0x34 +fn_80338c30__8cM3dGUnkFP8cM3dGCpsP7mVec3_c = .text:0x80338C30; // type:function size:0x10 +fn_80338c40__8cM3dGUnkFP8cM3dGUnkP7mVec3_c = .text:0x80338C40; // type:function size:0x5C +fn_80338ca0__8cM3dGUnkFv = .text:0x80338CA0; // type:function size:0x8 +fn_80338cb0__8cM3dGUnkFP8cM3dGCylP7mVec3_c = .text:0x80338CB0; // type:function size:0x10 +fn_80338cc0__8cM3dGUnkFP8cM3dGCylPf = .text:0x80338CC0; // type:function size:0x10 +fn_80338cd0__8cM3dGUnkFP8cM3dGSphP7mVec3_c = .text:0x80338CD0; // type:function size:0x4 +fn_80338ce0__8cM3dGUnkFP8cM3dGSphPf = .text:0x80338CE0; // type:function size:0x4 +Set__8cM3dGUnkFRC6mMtx_c = .text:0x80338CF0; // type:function size:0x64 +Set__8cM3dGUnkFRC7mVec3_cRC4mAng = .text:0x80338D60; // type:function size:0x78 +Cross__8cM3dGUnkFRC7mVec3_c = .text:0x80338DE0; // type:function size:0xBC +Clamp__8cM3dGUnkFRC7mVec3_cR7mVec3_c = .text:0x80338EA0; // type:function size:0x90 +fn_80338f30__8cM3dGUnkFff = .text:0x80338F30; // type:function size:0x1C +__ct__10cPartitionFv = .text:0x80338F50; // type:function size:0x20 +__dt__10cPartitionFv = .text:0x80338F70; // type:function size:0x40 +fn_80338fb0__10cPartitionFv = .text:0x80338FB0; // type:function size:0x8 fn_80338FC0 = .text:0x80338FC0; // type:function size:0x44 fn_80339010 = .text:0x80339010; // type:function size:0x5C -fn_80339070 = .text:0x80339070; // type:function size:0x17C -fn_803391F0 = .text:0x803391F0; // type:function size:0x36C -PartitionInfo__calc = .text:0x80339560; // type:function size:0x1D8 -fn_80339740 = .text:0x80339740; // type:function size:0x26C -fn_803399B0 = .text:0x803399B0; // type:function size:0x1E0 +fn_80339070__10cPartitionFPC8cM3dGAab = .text:0x80339070; // type:function size:0x17C +fn_803391f0__10cPartitionFPC8cM3dGAab = .text:0x803391F0; // type:function size:0x36C +Calc__10cPartitionFP7mVec3_c = .text:0x80339560; // type:function size:0x1D8 +fn_80339740__10cPartitionFP7mVec3_cf = .text:0x80339740; // type:function size:0x26C +fn_803399b0__10cPartitionFP7mVec3_c = .text:0x803399B0; // type:function size:0x1E0 fn_80339B90 = .text:0x80339B90; // type:function size:0x1C -dBgPc__getWtr = .text:0x80339BB0; // type:function size:0x18 -dBgPlc__setBase = .text:0x80339BD0; // type:function size:0x8 -BgPlc__GetCode4 = .text:0x80339BE0; // type:function size:0x18 -cBgS_ChkElm__ctor = .text:0x80339C00; // type:function size:0x4C -cBgS_ChkElm__dtor = .text:0x80339C50; // type:function size:0x60 -cBgS_ChkElm__Init = .text:0x80339CB0; // type:function size:0x10 -cBgS_ChkElm__Regist2 = .text:0x80339CC0; // type:function size:0x20 -cBgS_ChkElm__Release = .text:0x80339CE0; // type:function size:0x4 -cBgS__cBgS = .text:0x80339CF0; // type:function size:0x68 -cBgS___cBgS = .text:0x80339D60; // type:function size:0x78 -fn_80339DE0 = .text:0x80339DE0; // type:function size:0x58 -cBgS__Regist = .text:0x80339E40; // type:function size:0x100 -destroyActorBgCollision__21CollisionCheckContextFR14ActorCollision = .text:0x80339F40; // type:function size:0xEC -cBgS__Ct = .text:0x8033A030; // type:function size:0x88 -cBgS__Dt = .text:0x8033A0C0; // type:function size:0x74 -fn_8033A140 = .text:0x8033A140; // type:function size:0xA0 -fn_8033A1E0 = .text:0x8033A1E0; // type:function size:0x98 -fn_8033A280 = .text:0x8033A280; // type:function size:0x224 -BgChecker__getFloorPosition = .text:0x8033A4B0; // type:function size:0x20C -fn_8033A6C0 = .text:0x8033A6C0; // type:function size:0x18C -cBgS__GetActorPointer = .text:0x8033A850; // type:function size:0x10 -dBgS__GetActorPointer = .text:0x8033A860; // type:function size:0x54 -cBgS__GetBgWBasePointer = .text:0x8033A8C0; // type:function size:0x54 -dBgS__ChkPolySafe = .text:0x8033A920; // type:function size:0x9C -cBgS__GetTriPlane = .text:0x8033A9C0; // type:function size:0x7C -cBgS__GetTriPnt = .text:0x8033AA40; // type:function size:0x80 -fn_8033AAC0 = .text:0x8033AAC0; // type:function size:0x44 -fn_8033AB10 = .text:0x8033AB10; // type:function size:0x2C -dBgS__Regist = .text:0x8033AB40; // type:function size:0x10 -get__21CollisionCheckContextFv = .text:0x8033AB50; // type:function size:0x8 -CollisionContext__ctor = .text:0x8033AB60; // type:function size:0x84 -dBgS___dBgS = .text:0x8033ABF0; // type:function size:0x60 -dBgS__Ct = .text:0x8033AC50; // type:function size:0x270 -dBgS__Dt = .text:0x8033AEC0; // type:function size:0xEC -dBgS__ClrMoveFlagMaybe = .text:0x8033AFB0; // type:function size:0x80 -registerActorBgCollision__21CollisionCheckContextFR14ActorCollisionP12dAcObjBase_c = .text:0x8033B030; // type:function size:0xBC -fn_8033B0F0 = .text:0x8033B0F0; // type:function size:0x13C -fn_8033B230 = .text:0x8033B230; // type:function size:0xE4 -dBgS__ChkMoveBG = .text:0x8033B320; // type:function size:0x9C -dBgS__ChkShadowThrough = .text:0x8033B3C0; // type:function size:0x68 -dBgS__GetGroundCode = .text:0x8033B430; // type:function size:0x68 -dBgS__GetWallCode = .text:0x8033B4A0; // type:function size:0x68 -dBgS__GetMaterialCode = .text:0x8033B510; // type:function size:0x84 -dBgS__GetPolyCode1_s17_0x7 = .text:0x8033B5A0; // type:function size:0x68 -fn_8033B610 = .text:0x8033B610; // type:function size:0x10C -dBgS__GetLightingCode = .text:0x8033B720; // type:function size:0x68 -dBgS__GetLedgeCode = .text:0x8033B790; // type:function size:0x68 -dBgS__GetCode1_s25_0x1 = .text:0x8033B800; // type:function size:0x68 -dBgS__GetRoomCamId = .text:0x8033B870; // type:function size:0x68 -dBgS__GetRoomId = .text:0x8033B8E0; // type:function size:0x64 -dBgS__GetPolyObjectThrough = .text:0x8033B950; // type:function size:0x74 -dBgS__GetPolyCameraThrough = .text:0x8033B9D0; // type:function size:0x74 -dBgS__GetPolyShadowThrough = .text:0x8033BA50; // type:function size:0x74 -dBgS__GetPolyLinkThrough = .text:0x8033BAD0; // type:function size:0x74 -dBgS__GetPolyArrowThrough = .text:0x8033BB50; // type:function size:0x74 -dBgS__GetPolyBombThrough = .text:0x8033BBD0; // type:function size:0x74 -dBgS__GetPolyBeetleThrough = .text:0x8033BC50; // type:function size:0x74 -dBgS__GetPolyClawshotThrough = .text:0x8033BCD0; // type:function size:0x74 -dBgS__GetPolyCode1_s26_0x1 = .text:0x8033BD50; // type:function size:0x74 -dBgS__GetPolyCode1_s27_0x1 = .text:0x8033BDD0; // type:function size:0x74 -dBgS__GetPolyWhipThrough = .text:0x8033BE50; // type:function size:0x74 -dBgS__GetPolySlingshotThrough = .text:0x8033BED0; // type:function size:0x74 -fn_8033BF50 = .text:0x8033BF50; // type:function size:0x524 -fn_8033C480 = .text:0x8033C480; // type:function size:0x20C -fn_8033C690 = .text:0x8033C690; // type:function size:0x26C -fn_8033C900 = .text:0x8033C900; // type:function size:0x238 -fn_8033CB40 = .text:0x8033CB40; // type:function size:0x104 -fn_8033CC50 = .text:0x8033CC50; // type:function size:0xF4 -memberMatrixMultVec_func = .text:0x8033CD50; // type:function size:0x7C -fn_8033CDD0 = .text:0x8033CDD0; // type:function size:0x34 -fn_8033CE10 = .text:0x8033CE10; // type:function size:0x6C -fn_8033CE80 = .text:0x8033CE80; // type:function size:0x80 -fn_8033CF00 = .text:0x8033CF00; // type:function size:0x78 -fn_8033CF80 = .text:0x8033CF80; // type:function size:0x88 -fn_8033D010 = .text:0x8033D010; // type:function size:0x98 -fn_8033D0B0 = .text:0x8033D0B0; // type:function size:0x70 -fn_8033D120 = .text:0x8033D120; // type:function size:0x5C -fn_8033D180 = .text:0x8033D180; // type:function size:0x5C -fn_8033D1E0 = .text:0x8033D1E0; // type:function size:0x3C -fn_8033D220 = .text:0x8033D220; // type:function size:0x5C -fn_8033D280 = .text:0x8033D280; // type:function size:0x90 -fn_8033D310 = .text:0x8033D310; // type:function size:0x4E0 -fn_8033D7F0 = .text:0x8033D7F0; // type:function size:0x224 -fn_8033DA20 = .text:0x8033DA20; // type:function size:0x8 -fn_8033DA30 = .text:0x8033DA30; // type:function size:0x1A8 -fn_8033DBE0 = .text:0x8033DBE0; // type:function size:0x2A0 -fn_8033DE80 = .text:0x8033DE80; // type:function size:0x408 -fn_8033E290 = .text:0x8033E290; // type:function size:0x200 -fn_8033E490 = .text:0x8033E490; // type:function size:0x2E4 -fn_8033E780 = .text:0x8033E780; // type:function size:0x1A0 -fn_8033E920 = .text:0x8033E920; // type:function size:0x20 -fn_8033E940 = .text:0x8033E940; // type:function size:0x60 -fn_8033E9A0 = .text:0x8033E9A0; // type:function size:0x4 -fn_8033E9B0 = .text:0x8033E9B0; // type:function size:0x4 -fn_8033E9C0 = .text:0x8033E9C0; // type:function size:0x4 -fn_8033E9D0 = .text:0x8033E9D0; // type:function size:0x48 -fn_8033EA20 = .text:0x8033EA20; // type:function size:0x48 -fn_8033EA70 = .text:0x8033EA70; // type:function size:0x4 -fn_8033EA80 = .text:0x8033EA80; // type:function size:0x178 -fn_8033EC00 = .text:0x8033EC00; // type:function size:0x58 -fn_8033EC60 = .text:0x8033EC60; // type:function size:0x60 -fn_8033ECC0 = .text:0x8033ECC0; // type:function size:0x8C -fn_8033ED50 = .text:0x8033ED50; // type:function size:0xBC -fn_8033EE10 = .text:0x8033EE10; // type:function size:0x78 -fn_8033EE90 = .text:0x8033EE90; // type:function size:0xB4 -fn_8033EF50 = .text:0x8033EF50; // type:function size:0x94 -fn_8033EFF0 = .text:0x8033EFF0; // type:function size:0x114 -GetMapGradationBorderColor = .text:0x8033F110; // type:function size:0x3C -fn_8033F150 = .text:0x8033F150; // type:function size:0x5C -fn_8033F1B0 = .text:0x8033F1B0; // type:function size:0x40 -fn_8033F1F0 = .text:0x8033F1F0; // type:function size:0x40 -fn_8033F230 = .text:0x8033F230; // type:function size:0x5C -fn_8033F290 = .text:0x8033F290; // type:function size:0x8 -fn_8033F2A0 = .text:0x8033F2A0; // type:function size:0xC -fn_8033F2B0 = .text:0x8033F2B0; // type:function size:0x16C -fn_8033F420 = .text:0x8033F420; // type:function size:0x98 -fn_8033F4C0 = .text:0x8033F4C0; // type:function size:0x74 -copyActorObjectBaseVelocityToSomething = .text:0x8033F540; // type:function size:0x70 -fn_8033F5B0 = .text:0x8033F5B0; // type:function size:0x198 -fn_8033F750 = .text:0x8033F750; // type:function size:0x3E8 -fn_8033FB40 = .text:0x8033FB40; // type:function size:0x16C -fn_8033FCB0 = .text:0x8033FCB0; // type:function size:0x190 -fn_8033FE40 = .text:0x8033FE40; // type:function size:0x554 -fn_803403A0 = .text:0x803403A0; // type:function size:0xE4 -fn_80340490 = .text:0x80340490; // type:function size:0x600 -fn_80340A90 = .text:0x80340A90; // type:function size:0x44 -fn_80340AE0 = .text:0x80340AE0; // type:function size:0x19C -fn_80340C80 = .text:0x80340C80; // type:function size:0x14 -fn_80340CA0 = .text:0x80340CA0; // type:function size:0xB8 -fn_80340D60 = .text:0x80340D60; // type:function size:0x4 -fn_80340D70 = .text:0x80340D70; // type:function size:0x1C -fn_80340D90 = .text:0x80340D90; // type:function size:0x1C -someCollisionCheck = .text:0x80340DB0; // type:function size:0x5C -fn_80340E10 = .text:0x80340E10; // type:function size:0x5C -fn_80340E70 = .text:0x80340E70; // type:function size:0x98 -fn_80340F10 = .text:0x80340F10; // type:function size:0x10 -fn_80340F20 = .text:0x80340F20; // type:function size:0x10 -fn_80340F30 = .text:0x80340F30; // type:function size:0x10 -fn_80340F40 = .text:0x80340F40; // type:function size:0x10 -fn_80340F50 = .text:0x80340F50; // type:function size:0x10 -fn_80340F60 = .text:0x80340F60; // type:function size:0x10 -fn_80340F70 = .text:0x80340F70; // type:function size:0x84 -fn_80341000 = .text:0x80341000; // type:function size:0x3C -fn_80341040 = .text:0x80341040; // type:function size:0x54 -fn_803410A0 = .text:0x803410A0; // type:function size:0x58 -fn_80341100 = .text:0x80341100; // type:function size:0x54 -fn_80341160 = .text:0x80341160; // type:function size:0x58 -fn_803411C0 = .text:0x803411C0; // type:function size:0x54 -fn_80341220 = .text:0x80341220; // type:function size:0x58 -fn_80341280 = .text:0x80341280; // type:function size:0x8 -fn_80341290 = .text:0x80341290; // type:function size:0x8 -fn_803412A0 = .text:0x803412A0; // type:function size:0x8 -fn_803412B0 = .text:0x803412B0; // type:function size:0x8 -fn_803412C0 = .text:0x803412C0; // type:function size:0x8 -fn_803412D0 = .text:0x803412D0; // type:function size:0x8 -fn_803412E0 = .text:0x803412E0; // type:function size:0x8 -fn_803412F0 = .text:0x803412F0; // type:function size:0x8 -fn_80341300 = .text:0x80341300; // type:function size:0x4C -fn_80341350 = .text:0x80341350; // type:function size:0x68 -fn_803413C0 = .text:0x803413C0; // type:function size:0x4 -fn_803413D0 = .text:0x803413D0; // type:function size:0x10 -fn_803413E0 = .text:0x803413E0; // type:function size:0x10 -fn_803413F0 = .text:0x803413F0; // type:function size:0x40 -fn_80341430 = .text:0x80341430; // type:function size:0x10 -fn_80341440 = .text:0x80341440; // type:function size:0x40 -fn_80341480 = .text:0x80341480; // type:function size:0x8 -fn_80341490 = .text:0x80341490; // type:function size:0x6C -fn_80341500 = .text:0x80341500; // type:function size:0x68 -fn_80341570 = .text:0x80341570; // type:function size:0x44 -fn_803415C0 = .text:0x803415C0; // type:function size:0x54 -fn_80341620 = .text:0x80341620; // type:function size:0x58 -BgChecker__ctor = .text:0x80341680; // type:function size:0x54 -BgChecker__dtor = .text:0x803416E0; // type:function size:0x58 -fn_80341740 = .text:0x80341740; // type:function size:0x5C -fn_803417A0 = .text:0x803417A0; // type:function size:0x58 -fn_80341800 = .text:0x80341800; // type:function size:0x58 -fn_80341860 = .text:0x80341860; // type:function size:0x54 -fn_803418C0 = .text:0x803418C0; // type:function size:0x58 -fn_80341920 = .text:0x80341920; // type:function size:0x58 -fn_80341980 = .text:0x80341980; // type:function size:0x58 -fn_803419E0 = .text:0x803419E0; // type:function size:0x58 -fn_80341A40 = .text:0x80341A40; // type:function size:0x2C -checkCollision = .text:0x80341A70; // type:function size:0x5C -fn_80341AD0 = .text:0x80341AD0; // type:function size:0x30 -fn_80341B00 = .text:0x80341B00; // type:function size:0x30 -fn_80341B30 = .text:0x80341B30; // type:function size:0x40 -collisionCheckGetRoom = .text:0x80341B70; // type:function size:0x30 -fn_80341BA0 = .text:0x80341BA0; // type:function size:0x34 -fn_80341BE0 = .text:0x80341BE0; // type:function size:0x30 -fn_80341C10 = .text:0x80341C10; // type:function size:0x30 -BgChecker__init = .text:0x80341C40; // type:function size:0x48 -fn_80341C90 = .text:0x80341C90; // type:function size:0x8 -fn_80341CA0 = .text:0x80341CA0; // type:function size:0x8 -fn_80341CB0 = .text:0x80341CB0; // type:function size:0x8 -fn_80341CC0 = .text:0x80341CC0; // type:function size:0x8 -fn_80341CD0 = .text:0x80341CD0; // type:function size:0x8 -fn_80341CE0 = .text:0x80341CE0; // type:function size:0x8 -fn_80341CF0 = .text:0x80341CF0; // type:function size:0x8 -fn_80341D00 = .text:0x80341D00; // type:function size:0x8 -fn_80341D10 = .text:0x80341D10; // type:function size:0x8 -fn_80341D20 = .text:0x80341D20; // type:function size:0x8 -fn_80341D30 = .text:0x80341D30; // type:function size:0x8 -fn_80341D40 = .text:0x80341D40; // type:function size:0x8 -fn_80341D50 = .text:0x80341D50; // type:function size:0x8 -fn_80341D60 = .text:0x80341D60; // type:function size:0x8 -fn_80341D70 = .text:0x80341D70; // type:function size:0x44 -fn_80341DC0 = .text:0x80341DC0; // type:function size:0x58 -fn_80341E20 = .text:0x80341E20; // type:function size:0x6C -fn_80341E90 = .text:0x80341E90; // type:function size:0x68 -fn_80341F00 = .text:0x80341F00; // type:function size:0x18 -fn_80341F20 = .text:0x80341F20; // type:function size:0x54 -fn_80341F80 = .text:0x80341F80; // type:function size:0x58 -fn_80341FE0 = .text:0x80341FE0; // type:function size:0x58 -fn_80342040 = .text:0x80342040; // type:function size:0x58 -fn_803420A0 = .text:0x803420A0; // type:function size:0x5C -fn_80342100 = .text:0x80342100; // type:function size:0x58 -fn_80342160 = .text:0x80342160; // type:function size:0x2C -fn_80342190 = .text:0x80342190; // type:function size:0x24 -fn_803421C0 = .text:0x803421C0; // type:function size:0x4C -fn_80342210 = .text:0x80342210; // type:function size:0x40 -fn_80342250 = .text:0x80342250; // type:function size:0x40 -fn_80342290 = .text:0x80342290; // type:function size:0x30 -fn_803422C0 = .text:0x803422C0; // type:function size:0x34 -fn_80342300 = .text:0x80342300; // type:function size:0x38 -fn_80342340 = .text:0x80342340; // type:function size:0x4C -fn_80342390 = .text:0x80342390; // type:function size:0x38 -fn_803423D0 = .text:0x803423D0; // type:function size:0x5C -fn_80342430 = .text:0x80342430; // type:function size:0x58 -fn_80342490 = .text:0x80342490; // type:function size:0x2C -fn_803424C0 = .text:0x803424C0; // type:function size:0x24 -fn_803424F0 = .text:0x803424F0; // type:function size:0x80 -fn_80342570 = .text:0x80342570; // type:function size:0x54 -fn_803425D0 = .text:0x803425D0; // type:function size:0x58 -fn_80342630 = .text:0x80342630; // type:function size:0x54 -fn_80342690 = .text:0x80342690; // type:function size:0x58 -fn_803426F0 = .text:0x803426F0; // type:function size:0x54 -fn_80342750 = .text:0x80342750; // type:function size:0x58 -fn_803427B0 = .text:0x803427B0; // type:function size:0x54 -fn_80342810 = .text:0x80342810; // type:function size:0x58 -fn_80342870 = .text:0x80342870; // type:function size:0x54 -fn_803428D0 = .text:0x803428D0; // type:function size:0x58 -fn_80342930 = .text:0x80342930; // type:function size:0x54 -fn_80342990 = .text:0x80342990; // type:function size:0x58 -fn_803429F0 = .text:0x803429F0; // type:function size:0x54 -fn_80342A50 = .text:0x80342A50; // type:function size:0x58 -fn_80342AB0 = .text:0x80342AB0; // type:function size:0x64 -fn_80342B20 = .text:0x80342B20; // type:function size:0x8 -fn_80342B30 = .text:0x80342B30; // type:function size:0x8 -fn_80342B40 = .text:0x80342B40; // type:function size:0x8 -fn_80342B50 = .text:0x80342B50; // type:function size:0x8 -fn_80342B60 = .text:0x80342B60; // type:function size:0x8 -fn_80342B70 = .text:0x80342B70; // type:function size:0x8 -fn_80342B80 = .text:0x80342B80; // type:function size:0x8 -fn_80342B90 = .text:0x80342B90; // type:function size:0x8 -fn_80342BA0 = .text:0x80342BA0; // type:function size:0x8 -fn_80342BB0 = .text:0x80342BB0; // type:function size:0x8 -fn_80342BC0 = .text:0x80342BC0; // type:function size:0x8 -fn_80342BD0 = .text:0x80342BD0; // type:function size:0x8 -fn_80342BE0 = .text:0x80342BE0; // type:function size:0x8 -fn_80342BF0 = .text:0x80342BF0; // type:function size:0x8 -fn_80342C00 = .text:0x80342C00; // type:function size:0x8 -fn_80342C10 = .text:0x80342C10; // type:function size:0x8 -fn_80342C20 = .text:0x80342C20; // type:function size:0x8 -fn_80342C30 = .text:0x80342C30; // type:function size:0x8 -fn_80342C40 = .text:0x80342C40; // type:function size:0x8 -fn_80342C50 = .text:0x80342C50; // type:function size:0x8 -fn_80342C60 = .text:0x80342C60; // type:function size:0x8 -fn_80342C70 = .text:0x80342C70; // type:function size:0x8 -fn_80342C80 = .text:0x80342C80; // type:function size:0x8 -fn_80342C90 = .text:0x80342C90; // type:function size:0x8 -fn_80342CA0 = .text:0x80342CA0; // type:function size:0x6C -fn_80342D10 = .text:0x80342D10; // type:function size:0x58 -fn_80342D70 = .text:0x80342D70; // type:function size:0xC0 -fn_80342E30 = .text:0x80342E30; // type:function size:0x68 -fn_80342EA0 = .text:0x80342EA0; // type:function size:0x1C -fn_80342EC0 = .text:0x80342EC0; // type:function size:0x5C -fn_80342F20 = .text:0x80342F20; // type:function size:0x58 -fn_80342F80 = .text:0x80342F80; // type:function size:0x2C -fn_80342FB0 = .text:0x80342FB0; // type:function size:0x5C -fn_80343010 = .text:0x80343010; // type:function size:0x5C -fn_80343070 = .text:0x80343070; // type:function size:0x58 -fn_803430D0 = .text:0x803430D0; // type:function size:0x48 -fn_80343120 = .text:0x80343120; // type:function size:0x8 -fn_80343130 = .text:0x80343130; // type:function size:0x8 -fn_80343140 = .text:0x80343140; // type:function size:0x8 -fn_80343150 = .text:0x80343150; // type:function size:0x8 -fn_80343160 = .text:0x80343160; // type:function size:0x8 -fn_80343170 = .text:0x80343170; // type:function size:0x8 -fn_80343180 = .text:0x80343180; // type:function size:0x8 -fn_80343190 = .text:0x80343190; // type:function size:0x8 -fn_803431A0 = .text:0x803431A0; // type:function size:0x8 -fn_803431B0 = .text:0x803431B0; // type:function size:0xEC -fn_803432A0 = .text:0x803432A0; // type:function size:0x68 -fn_80343310 = .text:0x80343310; // type:function size:0x5C -fn_80343370 = .text:0x80343370; // type:function size:0x58 -fn_803433D0 = .text:0x803433D0; // type:function size:0x8 -fn_803433E0 = .text:0x803433E0; // type:function size:0x8 -fn_803433F0 = .text:0x803433F0; // type:function size:0x8 -fn_80343400 = .text:0x80343400; // type:function size:0x8 -fn_80343410 = .text:0x80343410; // type:function size:0x8 -fn_80343420 = .text:0x80343420; // type:function size:0x8 -fn_80343430 = .text:0x80343430; // type:function size:0xD4 -fn_80343510 = .text:0x80343510; // type:function size:0x68 -fn_80343580 = .text:0x80343580; // type:function size:0x20 -fn_803435A0 = .text:0x803435A0; // type:function size:0x8 -fn_803435B0 = .text:0x803435B0; // type:function size:0x8 -fn_803435C0 = .text:0x803435C0; // type:function size:0x8 -fn_803435D0 = .text:0x803435D0; // type:function size:0x60 -fn_80343630 = .text:0x80343630; // type:function size:0x58 -fn_80343690 = .text:0x80343690; // type:function size:0x2C -fn_803436C0 = .text:0x803436C0; // type:function size:0xAC -fn_80343770 = .text:0x80343770; // type:function size:0x2C -fn_803437A0 = .text:0x803437A0; // type:function size:0x48 -fn_803437F0 = .text:0x803437F0; // type:function size:0x8 -fn_80343800 = .text:0x80343800; // type:function size:0x8 -fn_80343810 = .text:0x80343810; // type:function size:0x8 -cBgW__cBgW = .text:0x80343820; // type:function size:0xAC -cBgW___cBgW = .text:0x803438D0; // type:function size:0x6C -cBgW__FreeArea = .text:0x80343940; // type:function size:0xC0 -cBgW_TriElm___cBgW_TriElm = .text:0x80343A00; // type:function size:0x40 -fn_80343A40 = .text:0x80343A40; // type:function size:0x40 -cBgW_GrpElm___cBgW_GrpElm = .text:0x80343A80; // type:function size:0x40 -fn_80343AC0 = .text:0x80343AC0; // type:function size:0x8 -ActorCollision__InitMatrix = .text:0x80343AD0; // type:function size:0xA4 -cBgW__GlobalVtx = .text:0x80343B80; // type:function size:0xDC -cBgW__SetVtx = .text:0x80343C60; // type:function size:0xE0 -cBgW__CalcPlane = .text:0x80343D40; // type:function size:0x110 -cBgW__SetTri = .text:0x80343E50; // type:function size:0x8C -cBgW_TriElm__cBgW_TriElm = .text:0x80343EE0; // type:function size:0x4 -cBgW__BlckConnect = .text:0x80343EF0; // type:function size:0x48 -cBgW__ClassifyPlane = .text:0x80343F40; // type:function size:0x1F0 -cBgW__MakeBlckTransMinMax = .text:0x80344130; // type:function size:0x44 -cBgW__MakeBlckMinMax = .text:0x80344180; // type:function size:0x84 -fn_80344210 = .text:0x80344210; // type:function size:0x8 -cBgW__MakeBlckBnd = .text:0x80344220; // type:function size:0x170 -cBgW__MakeNodeTreeRp = .text:0x80344390; // type:function size:0x128 -cBgW__MakeNodeTreeGrpRp = .text:0x803444C0; // type:function size:0x128 -cBgW__MakeNodeTree = .text:0x803445F0; // type:function size:0x144 -cBgW__ChkMemoryError = .text:0x80344740; // type:function size:0x4C -create__14ActorCollisionFPvPvbRC6mMtx_cRC7mVec3_c = .text:0x80344790; // type:function size:0x27C -cBgW_RwgElm__cBgW_RwgElm = .text:0x80344A10; // type:function size:0x4 -cBgW_BlkElm__cBgW_BlkElm = .text:0x80344A20; // type:function size:0x4 -fn_80344A30 = .text:0x80344A30; // type:function size:0x4 -cBgW_GrpElm__cBgW_GrpElm = .text:0x80344A40; // type:function size:0x4 -fn_80344A50 = .text:0x80344A50; // type:function size:0x30 -fn_80344A80 = .text:0x80344A80; // type:function size:0xCC -fn_80344B50 = .text:0x80344B50; // type:function size:0x124 -fn_80344C80 = .text:0x80344C80; // type:function size:0x148 -fn_80344DD0 = .text:0x80344DD0; // type:function size:0x30 -fn_80344E00 = .text:0x80344E00; // type:function size:0x114 -fn_80344F20 = .text:0x80344F20; // type:function size:0x14C -fn_80345070 = .text:0x80345070; // type:function size:0x220 -fn_80345290 = .text:0x80345290; // type:function size:0x244 -init__14ActorCollisionFv = .text:0x803454E0; // type:function size:0x38 -cBgW__CopyOldMtx = .text:0x80345520; // type:function size:0x4C -cBgW__Move = .text:0x80345570; // type:function size:0x254 -fn_803457D0 = .text:0x803457D0; // type:function size:0x8 -fn_803457E0 = .text:0x803457E0; // type:function size:0x170 -fn_80345950 = .text:0x80345950; // type:function size:0x1B8 -fn_80345B10 = .text:0x80345B10; // type:function size:0x2AC -fn_80345DC0 = .text:0x80345DC0; // type:function size:0x14 -fn_80345DE0 = .text:0x80345DE0; // type:function size:0x88 -fn_80345E70 = .text:0x80345E70; // type:function size:0x24 -fn_80345EA0 = .text:0x80345EA0; // type:function size:0x30 -fn_80345ED0 = .text:0x80345ED0; // type:function size:0x34 -fn_80345F10 = .text:0x80345F10; // type:function size:0x20 -fn_80345F30 = .text:0x80345F30; // type:function size:0x30 -fn_80345F60 = .text:0x80345F60; // type:function size:0x30 -fn_80345F90 = .text:0x80345F90; // type:function size:0x30 -fn_80345FC0 = .text:0x80345FC0; // type:function size:0x14 -fn_80345FE0 = .text:0x80345FE0; // type:function size:0x30 -fn_80346010 = .text:0x80346010; // type:function size:0x30 -fn_80346040 = .text:0x80346040; // type:function size:0x30 -fn_80346070 = .text:0x80346070; // type:function size:0x2C -fn_803460A0 = .text:0x803460A0; // type:function size:0x2C -fn_803460D0 = .text:0x803460D0; // type:function size:0x2C -fn_80346100 = .text:0x80346100; // type:function size:0x2C -fn_80346130 = .text:0x80346130; // type:function size:0x2C -fn_80346160 = .text:0x80346160; // type:function size:0x2C -fn_80346190 = .text:0x80346190; // type:function size:0x2C -fn_803461C0 = .text:0x803461C0; // type:function size:0x2C -fn_803461F0 = .text:0x803461F0; // type:function size:0x2C -fn_80346220 = .text:0x80346220; // type:function size:0x2C -fn_80346250 = .text:0x80346250; // type:function size:0x2C -fn_80346280 = .text:0x80346280; // type:function size:0x34 -fn_803462C0 = .text:0x803462C0; // type:function size:0x14 -fn_803462E0 = .text:0x803462E0; // type:function size:0x30 -fn_80346310 = .text:0x80346310; // type:function size:0x40 -fn_80346350 = .text:0x80346350; // type:function size:0x34 -fn_80346390 = .text:0x80346390; // type:function size:0x34 -fn_803463D0 = .text:0x803463D0; // type:function size:0x30 -fn_80346400 = .text:0x80346400; // type:function size:0x30 -fn_80346430 = .text:0x80346430; // type:function size:0x30 -fn_80346460 = .text:0x80346460; // type:function size:0x34 -fn_803464A0 = .text:0x803464A0; // type:function size:0x34 -fn_803464E0 = .text:0x803464E0; // type:function size:0x34 -fn_80346520 = .text:0x80346520; // type:function size:0x34 -fn_80346560 = .text:0x80346560; // type:function size:0x34 -fn_803465A0 = .text:0x803465A0; // type:function size:0x10 -fn_803465B0 = .text:0x803465B0; // type:function size:0xC -dBgW__ChkMoveFlag = .text:0x803465C0; // type:function size:0xC -__ct__14ActorCollisionFv = .text:0x803465D0; // type:function size:0x54 -__dt__14ActorCollisionFv = .text:0x80346630; // type:function size:0x58 -execute__14ActorCollisionFv = .text:0x80346690; // type:function size:0x10 -dBgW__positionWallCorrect = .text:0x803466A0; // type:function size:0x50 -dBgW__RwgWallCorrect = .text:0x803466F0; // type:function size:0xA6C -dBgW__WallCorrectRp = .text:0x80347160; // type:function size:0x178 -dBgW__WallCorrectGrpRp = .text:0x803472E0; // type:function size:0x150 -dBgW__WallCorrect = .text:0x80347430; // type:function size:0x30 -dBgW__RwgWallCorrectSort = .text:0x80347460; // type:function size:0x360 -fn_803477C0 = .text:0x803477C0; // type:function size:0x190 -fn_80347950 = .text:0x80347950; // type:function size:0x150 -fn_80347AA0 = .text:0x80347AA0; // type:function size:0xEA4 -dBgW__RwgRoofChk = .text:0x80348950; // type:function size:0x150 -fn_80348AA0 = .text:0x80348AA0; // type:function size:0xA4 -fn_80348B50 = .text:0x80348B50; // type:function size:0xC4 -fn_80348C20 = .text:0x80348C20; // type:function size:0x150 -fn_80348D70 = .text:0x80348D70; // type:function size:0x114 -dBgW__RoofChk = .text:0x80348E90; // type:function size:0x30 -fn_80348EC0 = .text:0x80348EC0; // type:function size:0x278 -fn_80349140 = .text:0x80349140; // type:function size:0x128 -fn_80349270 = .text:0x80349270; // type:function size:0x114 -dBgW__SplGrpChk = .text:0x80349390; // type:function size:0x30 -dBgW__RwgCaptPoly = .text:0x803493C0; // type:function size:0x98 -dBgW__CaptPolyRp = .text:0x80349460; // type:function size:0x1C4 -dBgW__CaptPolyGrpRp = .text:0x80349630; // type:function size:0x17C -dBgW__CaptPoly = .text:0x803497B0; // type:function size:0x8 -dBgW__RwgSphChk = .text:0x803497C0; // type:function size:0x1F0 -dBgW__SphChkRp = .text:0x803499B0; // type:function size:0x1A8 -dBgW__SphChkGrpRp = .text:0x80349B60; // type:function size:0x164 -dBgW__SphChk = .text:0x80349CD0; // type:function size:0x30 -fn_80349D00 = .text:0x80349D00; // type:function size:0x30 -fn_80349D30 = .text:0x80349D30; // type:function size:0x30 -dBgW__MatrixCrrPos = .text:0x80349D60; // type:function size:0x10 -fn_80349D70 = .text:0x80349D70; // type:function size:0x18 -fn_80349D90 = .text:0x80349D90; // type:function size:0x18 -fn_80349DB0 = .text:0x80349DB0; // type:function size:0x1C -dBgW__OffMoveFlag = .text:0x80349DD0; // type:function size:0x10 -dBgW__ChkMoveFlag2 = .text:0x80349DE0; // type:function size:0xC -fn_80349DF0 = .text:0x80349DF0; // type:function size:0x68 -fn_80349E60 = .text:0x80349E60; // type:function size:0x100 -fn_80349F60 = .text:0x80349F60; // type:function size:0x24C -fn_8034A1B0 = .text:0x8034A1B0; // type:function size:0x34 -fn_8034A1F0 = .text:0x8034A1F0; // type:function size:0x1C -fn_8034A210 = .text:0x8034A210; // type:function size:0x718 -fn_8034A930 = .text:0x8034A930; // type:function size:0x1C -dBgW_Base__dBgW_Base = .text:0x8034A950; // type:function size:0x54 -dBgW_Base___dBgW_Base = .text:0x8034A9B0; // type:function size:0xB8 -dBgW_Base__ClrDBgWBase = .text:0x8034AA70; // type:function size:0x148 -dBgW_Base__ChkMemoryError = .text:0x8034ABC0; // type:function size:0x8 -fn_8034ABD0 = .text:0x8034ABD0; // type:function size:0x4 -fn_8034ABE0 = .text:0x8034ABE0; // type:function size:0x4 -fn_8034ABF0 = .text:0x8034ABF0; // type:function size:0x8 -dBgW_Base__CalcDiffShapeAngleY = .text:0x8034AC00; // type:function size:0x14 -dBgW_Base__SetOldShapeAngleY = .text:0x8034AC20; // type:function size:0x8 -fn_8034AC30 = .text:0x8034AC30; // type:function size:0x134 -fn_8034AD70 = .text:0x8034AD70; // type:function size:0x24 -fn_8034ADA0 = .text:0x8034ADA0; // type:function size:0x20 -fn_8034ADC0 = .text:0x8034ADC0; // type:function size:0x104 -fn_8034AED0 = .text:0x8034AED0; // type:function size:0x8 -fn_8034AEE0 = .text:0x8034AEE0; // type:function size:0xC -fn_8034AEF0 = .text:0x8034AEF0; // type:function size:0x4C -fn_8034AF40 = .text:0x8034AF40; // type:function size:0x8 -dBgWKCol__dBgWKCol = .text:0x8034AF50; // type:function size:0x50 -dBgWKCol___dBgWKCol = .text:0x8034AFA0; // type:function size:0x64 -dBgWKCol__initKCollision = .text:0x8034B010; // type:function size:0x34 -RoomCollision__create = .text:0x8034B050; // type:function size:0x144 -RoomCollision__GetTriNrm = .text:0x8034B1A0; // type:function size:0x1C -RoomCollision__ChkNotReady = .text:0x8034B1C0; // type:function size:0x10 -dBgWKCol__ChkLock = .text:0x8034B1D0; // type:function size:0x8 -dBgWKCol__ChkMoveBG = .text:0x8034B1E0; // type:function size:0x8 -dBgWKCol__ChkMoveFlag = .text:0x8034B1F0; // type:function size:0x8 -dBgWKCol__GetTriPla = .text:0x8034B200; // type:function size:0xB0 -dBgWKCol__GetTriPnt = .text:0x8034B2B0; // type:function size:0x8 -dBgWKCol__GetTriPnt2 = .text:0x8034B2C0; // type:function size:0x14 -dBgWKCol__GetTriPnt3 = .text:0x8034B2E0; // type:function size:0x1CC -dBgWKCol__GetBnd = .text:0x8034B4B0; // type:function size:0x8 -RoomCollision__GetCode4 = .text:0x8034B4C0; // type:function size:0x20 -dBgWKCol__OffMoveFlag = .text:0x8034B4E0; // type:function size:0x4 -dBgWKCol__chkPolyThrough = .text:0x8034B4F0; // type:function size:0x2C0 -fn_8034B7B0 = .text:0x8034B7B0; // type:function size:0x2A0 -fn_8034BA50 = .text:0x8034BA50; // type:function size:0x10 -fn_8034BA60 = .text:0x8034BA60; // type:function size:0x904 -fn_8034C370 = .text:0x8034C370; // type:function size:0x47C -fn_8034C7F0 = .text:0x8034C7F0; // type:function size:0x790 -fn_8034CF80 = .text:0x8034CF80; // type:function size:0x474 -fn_8034D400 = .text:0x8034D400; // type:function size:0x1570 -fn_8034E970 = .text:0x8034E970; // type:function size:0xDF4 -fn_8034F770 = .text:0x8034F770; // type:function size:0x3E4 -fn_8034FB60 = .text:0x8034FB60; // type:function size:0x478 -fn_8034FFE0 = .text:0x8034FFE0; // type:function size:0x5B4 -dBgWKCol__GetTopUnder = .text:0x803505A0; // type:function size:0x3C -dBgWKCol__GetGrpRoomIndex = .text:0x803505E0; // type:function size:0x30 -dBgWKCol__GetExitId = .text:0x80350610; // type:function size:0x30 -dBgWKCol__GetPolyTargetThrough = .text:0x80350640; // type:function size:0x30 -dBgWKCol__GetGroundType = .text:0x80350670; // type:function size:0x14 -dBgWKCol__GetGroundType2 = .text:0x80350690; // type:function size:0x30 -RoomCollision__CheckCode0_shift28_0x3 = .text:0x803506C0; // type:function size:0x30 -RoomCollision__CheckCode0_shift31_0x1 = .text:0x803506F0; // type:function size:0x30 -dBgWKCol__GetPolyObjThrough = .text:0x80350720; // type:function size:0x2C -dBgWKCol__GetPolyCamThrough = .text:0x80350750; // type:function size:0x2C -dBgWKCol__GetPolyLinkThrough = .text:0x80350780; // type:function size:0x2C -dBgWKCol__GetPolyArrowThrough = .text:0x803507B0; // type:function size:0x2C -dBgWKCol__GetPolySlingshotThrough = .text:0x803507E0; // type:function size:0x2C -dBgWKCol__GetPolyBeetleThrough = .text:0x80350810; // type:function size:0x2C -dBgWKCol__GetPolyClawshotThrough = .text:0x80350840; // type:function size:0x2C -dBgWKCol__GetPolyBombThrough = .text:0x80350870; // type:function size:0x2C -dBgWKCol__GetPolyWhipThrough = .text:0x803508A0; // type:function size:0x2C -dBgWKCol__GetUnderwaterRoofCode = .text:0x803508D0; // type:function size:0x2C -dBgWKCol__GetShdwThrough = .text:0x80350900; // type:function size:0x2C -dBgWKCol__GetLinkNo = .text:0x80350930; // type:function size:0x34 -dBgWKCol__GetWallCode = .text:0x80350970; // type:function size:0x34 -dBgWKCol__GetMaterialCode = .text:0x803509B0; // type:function size:0x40 -dBgWKCol__GetCode1_s17_0x7 = .text:0x803509F0; // type:function size:0x34 -RoomCollision__GetPolyLedgeCode = .text:0x80350A30; // type:function size:0x34 -RoomCollision__CheckCode1_shift25_0x1 = .text:0x80350A70; // type:function size:0x30 -RoomCollision__CheckCode1_shift26_0x1 = .text:0x80350AA0; // type:function size:0x30 -RoomCollision__CheckCode1_shift27_0x1 = .text:0x80350AD0; // type:function size:0x30 -dBgWKCol__GetLightingCode = .text:0x80350B00; // type:function size:0x34 -dBgWKCol__GetCamMoveBG = .text:0x80350B40; // type:function size:0x34 -dBgWKCol__GetRoomCamId = .text:0x80350B80; // type:function size:0x34 -dBgWKCol__GetRoomPathId = .text:0x80350BC0; // type:function size:0x34 -dBgWKCol__GetRoomPathPntNo = .text:0x80350C00; // type:function size:0x34 -dBgWKCol__CrrPos = .text:0x80350C40; // type:function size:0x4 -dBgWKCol__TransPos = .text:0x80350C50; // type:function size:0x4 -dBgWKCol__MatrixCrrPos = .text:0x80350C60; // type:function size:0x4 -fn_80350C70 = .text:0x80350C70; // type:function size:0x228 -fn_80350EA0 = .text:0x80350EA0; // type:function size:0x42C -fn_803512D0 = .text:0x803512D0; // type:function size:0x4 -fn_803512E0 = .text:0x803512E0; // type:function size:0x40 -RoomCollision__CheckCode3_shift5_0x3F = .text:0x80351320; // type:function size:0x34 -fn_80351360 = .text:0x80351360; // type:function size:0x30 -fn_80351390 = .text:0x80351390; // type:function size:0x400 -fn_80351790 = .text:0x80351790; // type:function size:0x990 -fn_80352120 = .text:0x80352120; // type:function size:0x18 -fn_80352140 = .text:0x80352140; // type:function size:0x44 -fn_80352190 = .text:0x80352190; // type:function size:0x58 -fn_803521F0 = .text:0x803521F0; // type:function size:0x98 -fn_80352290 = .text:0x80352290; // type:function size:0x6C -fn_80352300 = .text:0x80352300; // type:function size:0x1C8 -fn_803524D0 = .text:0x803524D0; // type:function size:0xBC -fn_80352590 = .text:0x80352590; // type:function size:0x228 -fn_803527C0 = .text:0x803527C0; // type:function size:0xBC -fn_80352880 = .text:0x80352880; // type:function size:0x4 -fn_80352890 = .text:0x80352890; // type:function size:0x60 -fn_803528F0 = .text:0x803528F0; // type:function size:0x14 -fn_80352910 = .text:0x80352910; // type:function size:0x10 -fn_80352920 = .text:0x80352920; // type:function size:0x3C -fn_80352960 = .text:0x80352960; // type:function size:0x58 -fn_803529C0 = .text:0x803529C0; // type:function size:0x18 -fn_803529E0 = .text:0x803529E0; // type:function size:0x8 -fn_803529F0 = .text:0x803529F0; // type:function size:0x8 -fn_80352A00 = .text:0x80352A00; // type:function size:0x8 -fn_80352A10 = .text:0x80352A10; // type:function size:0x8 -fn_80352A20 = .text:0x80352A20; // type:function size:0x24 -fn_80352A50 = .text:0x80352A50; // type:function size:0x15C -fn_80352BB0 = .text:0x80352BB0; // type:function size:0x8 -fn_80352BC0 = .text:0x80352BC0; // type:function size:0x8 -fn_80352BD0 = .text:0x80352BD0; // type:function size:0x4 -fn_80352BE0 = .text:0x80352BE0; // type:function size:0x10 -fn_80352BF0 = .text:0x80352BF0; // type:function size:0x178 -fn_80352D70 = .text:0x80352D70; // type:function size:0x8 -fn_80352D80 = .text:0x80352D80; // type:function size:0x4 -fn_80352D90 = .text:0x80352D90; // type:function size:0x4 -fn_80352DA0 = .text:0x80352DA0; // type:function size:0x4E0 -fn_80353280 = .text:0x80353280; // type:function size:0x10 -fn_80353290 = .text:0x80353290; // type:function size:0x8 -fn_803532A0 = .text:0x803532A0; // type:function size:0x8 -fn_803532B0 = .text:0x803532B0; // type:function size:0x2B4 -fn_80353570 = .text:0x80353570; // type:function size:0x8 -fn_80353580 = .text:0x80353580; // type:function size:0x8 -fn_80353590 = .text:0x80353590; // type:function size:0x8 -fn_803535A0 = .text:0x803535A0; // type:function size:0x8 -fn_803535B0 = .text:0x803535B0; // type:function size:0x8 -fn_803535C0 = .text:0x803535C0; // type:function size:0x8 -fn_803535D0 = .text:0x803535D0; // type:function size:0x8 -fn_803535E0 = .text:0x803535E0; // type:function size:0x8 -fn_803535F0 = .text:0x803535F0; // type:function size:0x8 -fn_80353600 = .text:0x80353600; // type:function size:0x8 -fn_80353610 = .text:0x80353610; // type:function size:0x8 -fn_80353620 = .text:0x80353620; // type:function size:0x8 -fn_80353630 = .text:0x80353630; // type:function size:0x8 -fn_80353640 = .text:0x80353640; // type:function size:0x8 -fn_80353650 = .text:0x80353650; // type:function size:0x8 -fn_80353660 = .text:0x80353660; // type:function size:0x8 -fn_80353670 = .text:0x80353670; // type:function size:0x8 -fn_80353680 = .text:0x80353680; // type:function size:0x8 -fn_80353690 = .text:0x80353690; // type:function size:0x8 -fn_803536A0 = .text:0x803536A0; // type:function size:0x8 -fn_803536B0 = .text:0x803536B0; // type:function size:0x8 -fn_803536C0 = .text:0x803536C0; // type:function size:0x8 -fn_803536D0 = .text:0x803536D0; // type:function size:0x8 -fn_803536E0 = .text:0x803536E0; // type:function size:0x8 -fn_803536F0 = .text:0x803536F0; // type:function size:0x8 -fn_80353700 = .text:0x80353700; // type:function size:0x8 -fn_80353710 = .text:0x80353710; // type:function size:0x8 -fn_80353720 = .text:0x80353720; // type:function size:0x8 -fn_80353730 = .text:0x80353730; // type:function size:0x8 -fn_80353740 = .text:0x80353740; // type:function size:0x8 -fn_80353750 = .text:0x80353750; // type:function size:0x8 -fn_80353760 = .text:0x80353760; // type:function size:0x8 -fn_80353770 = .text:0x80353770; // type:function size:0x4 -fn_80353780 = .text:0x80353780; // type:function size:0x4 -fn_80353790 = .text:0x80353790; // type:function size:0x4 +getWtr__5dBgPcCFv = .text:0x80339BB0; // type:function size:0x18 +setBase__6dBgPlcFPv = .text:0x80339BD0; // type:function size:0x8 +getGrpCode__6dBgPlcCFi = .text:0x80339BE0; // type:function size:0x18 +__ct__11cBgS_ChkElmFv = .text:0x80339C00; // type:function size:0x4C +__dt__11cBgS_ChkElmFv = .text:0x80339C50; // type:function size:0x60 +Init__11cBgS_ChkElmFv = .text:0x80339CB0; // type:function size:0x10 +Regist2__11cBgS_ChkElmFP9dBgW_BaseP12dAcObjBase_c = .text:0x80339CC0; // type:function size:0x20 +Release__11cBgS_ChkElmFv = .text:0x80339CE0; // type:function size:0x4 +__ct__4cBgSFv = .text:0x80339CF0; // type:function size:0x68 +__dt__4cBgSFv = .text:0x80339D60; // type:function size:0x78 +fn_80339de0__4cBgSFP9dBgW_Base = .text:0x80339DE0; // type:function size:0x58 +Regist__4cBgSFP9dBgW_BaseP12dAcObjBase_c = .text:0x80339E40; // type:function size:0x100 +Release__4cBgSFP9dBgW_Base = .text:0x80339F40; // type:function size:0xEC +Ct__4cBgSFv = .text:0x8033A030; // type:function size:0x88 +Dt__4cBgSFv = .text:0x8033A0C0; // type:function size:0x74 +ConvDzb__4cBgSFPv = .text:0x8033A140; // type:function size:0xA0 +fn_8033a1e0__4cBgSFv = .text:0x8033A1E0; // type:function size:0x98 +LineCross__4cBgSFP11cBgS_LinChk = .text:0x8033A280; // type:function size:0x224 +GroundCross__4cBgSFP11cBgS_GndChk = .text:0x8033A4B0; // type:function size:0x20C +ShdwDraw__4cBgSFP13cBgS_ShdwDraw = .text:0x8033A6C0; // type:function size:0x18C +GetActorPointer__4cBgSCFi = .text:0x8033A850; // type:function size:0x10 +GetActorPointer__4cBgSCFRC13cBgS_PolyInfo = .text:0x8033A860; // type:function size:0x54 +GetBgWBasePointer__4cBgSCFRC13cBgS_PolyInfo = .text:0x8033A8C0; // type:function size:0x54 +ChkPolySafe__4cBgSCFRC13cBgS_PolyInfo = .text:0x8033A920; // type:function size:0x9C +GetTriPla__4cBgSCFRC13cBgS_PolyInfoP8cM3dGPla = .text:0x8033A9C0; // type:function size:0x7C +GetTriPnt__4cBgSCFRC13cBgS_PolyInfoP7mVec3_cP7mVec3_cP7mVec3_c = .text:0x8033AA40; // type:function size:0x80 +RegistKCol__4cBgSFP8dBgWKColP8dAcObg_c = .text:0x8033AAC0; // type:function size:0x44 +ReleaseKCol__4cBgSFP8dBgWKCol = .text:0x8033AB10; // type:function size:0x2C +Regist__4dBgSFP9dBgW_Basei = .text:0x8033AB40; // type:function size:0x10 +GetInstance__4dBgSFv = .text:0x8033AB50; // type:function size:0x8 +__ct__4dBgSFv = .text:0x8033AB60; // type:function size:0x84 +__dt__4dBgSFv = .text:0x8033ABF0; // type:function size:0x60 +Ct__4dBgSFv = .text:0x8033AC50; // type:function size:0x270 +Dt__4dBgSFv = .text:0x8033AEC0; // type:function size:0xEC +ClrMoveFlag__4dBgSFv = .text:0x8033AFB0; // type:function size:0x80 +Regist__4dBgSFP9dBgW_BaseP12dAcObjBase_c = .text:0x8033B030; // type:function size:0xBC +RegistBg__4dBgSFP9dBgW_BaseP12dAcObjBase_c = .text:0x8033B0F0; // type:function size:0x13C +UnRegist__4dBgSFP9dBgW_Base = .text:0x8033B230; // type:function size:0xE4 +ChkMoveBG__4dBgSFRC13cBgS_PolyInfob = .text:0x8033B320; // type:function size:0x9C +ChkShadowThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B3C0; // type:function size:0x68 +GetSpecialCode__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B430; // type:function size:0x68 +GetWallCode__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B4A0; // type:function size:0x68 +GetPolyAtt0__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B510; // type:function size:0x84 +GetPolyAtt1__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B5A0; // type:function size:0x68 +GetMapCode__4dBgSFiib = .text:0x8033B610; // type:function size:0x10C +GetLightingCode__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B720; // type:function size:0x68 +GetGroundCode__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B790; // type:function size:0x68 +GetCode1_0x02000000__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B800; // type:function size:0x68 +GetRoomCamId__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B870; // type:function size:0x68 +GetRoomId__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B8E0; // type:function size:0x64 +GetPolyObjectThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B950; // type:function size:0x74 +GetPolyCameraThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033B9D0; // type:function size:0x74 +GetPolyShadowThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BA50; // type:function size:0x74 +GetPolyLinkThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BAD0; // type:function size:0x74 +GetPolyArrowThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BB50; // type:function size:0x74 +GetPolyBombThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BBD0; // type:function size:0x74 +GetPolyBeetleThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BC50; // type:function size:0x74 +GetPolyClawshotThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BCD0; // type:function size:0x74 +GetPolyThrough_Code1_0x04000000__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BD50; // type:function size:0x74 +GetPolyThrough_Code1_0x08000000__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BDD0; // type:function size:0x74 +GetPolyWhipThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BE50; // type:function size:0x74 +GetPolySlingshotThrough__4dBgSFRC13cBgS_PolyInfo = .text:0x8033BED0; // type:function size:0x74 +WallCorrect__4dBgSFP9dBgS_Acchb = .text:0x8033BF50; // type:function size:0x524 +RoofChk__4dBgSFP12dBgS_RoofChk = .text:0x8033C480; // type:function size:0x20C +SplGrpChk__4dBgSFP14dBgS_SplGrpChk = .text:0x8033C690; // type:function size:0x26C +SphChk__4dBgSFP11dBgS_SphChkPv = .text:0x8033C900; // type:function size:0x238 +MoveBgCrrPos__4dBgSFRC13cBgS_PolyInfobP7mVec3_cP7mAng3_cP7mAng3_cbb = .text:0x8033CB40; // type:function size:0x104 +MoveBgTransPos__4dBgSFRC13cBgS_PolyInfobP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x8033CC50; // type:function size:0xF4 +dBgS_MoveBGProc_Typical__FP4dBgWPvRC13cBgS_PolyInfobP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x8033CD50; // type:function size:0x7C +dBgS_MoveBGProc_RotY__FP4dBgWPvRC13cBgS_PolyInfobP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x8033CDD0; // type:function size:0x34 +dBgS_MoveBGProc_TypicalRotY__FP4dBgWPvRC13cBgS_PolyInfobP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x8033CE10; // type:function size:0x6C +RideCallBack__4dBgSFRC13cBgS_PolyInfoP12dAcObjBase_c = .text:0x8033CE80; // type:function size:0x80 +ArrowStickCallBack__4dBgSFRC13cBgS_PolyInfoP9dAcBase_cR7mVec3_c = .text:0x8033CF00; // type:function size:0x78 +UnkCallback__4dBgSFRC13cBgS_PolyInfoP9dAcBase_c = .text:0x8033CF80; // type:function size:0x88 +PushPullCallBack__4dBgSFRC13cBgS_PolyInfoP9dAcBase_cQ29dBgW_Base13PushPullLabel = .text:0x8033D010; // type:function size:0x98 +dBgS_CheckBWallPoly__FRC13cBgS_PolyInfo = .text:0x8033D0B0; // type:function size:0x70 +dBgS_CheckBGroundPoly__FRC13cBgS_PolyInfo = .text:0x8033D120; // type:function size:0x5C +dBgS_CheckBRoofPoly__FRC13cBgS_PolyInfo = .text:0x8033D180; // type:function size:0x5C +dBgS_GetNY__FRC13cBgS_PolyInfo = .text:0x8033D1E0; // type:function size:0x3C +dBgS_GetN__FRC13cBgS_PolyInfo = .text:0x8033D220; // type:function size:0x5C +UpdateScrollTex__4dBgSFv = .text:0x8033D280; // type:function size:0x90 +SetupMapGX__4dBgSFP6mMtx_c = .text:0x8033D310; // type:function size:0x4E0 +SetupMapMaterial__4dBgSFibl = .text:0x8033D7F0; // type:function size:0x224 +GetMapAccessor__4dBgSFv = .text:0x8033DA20; // type:function size:0x8 +DrawMap__4dBgSFUcP6mMtx_cbi = .text:0x8033DA30; // type:function size:0x1A8 +SetupScrollGX__4dBgSFv = .text:0x8033DBE0; // type:function size:0x2A0 +SetupScrollMaterial__4dBgSFilb = .text:0x8033DE80; // type:function size:0x408 +DrawMapScroll__4dBgSFUcP6mMtx_cbi = .text:0x8033E290; // type:function size:0x200 +DrawSkyKeepMap__4dBgSFP6mMtx_ci = .text:0x8033E490; // type:function size:0x2E4 +ConfigureMapTexture__4dBgSFPQ23EGG4Heap = .text:0x8033E780; // type:function size:0x1A0 +__ct__14MapLineSegmentFv = .text:0x8033E920; // type:function size:0x20 +__dt__14MapLineSegmentFv = .text:0x8033E940; // type:function size:0x60 +fn_8033e9a0__14MapLineSegmentFv = .text:0x8033E9A0; // type:function size:0x4 +Dt__14MapLineSegmentFv = .text:0x8033E9B0; // type:function size:0x4 +fn_8033e9c0__14MapLineSegmentFv = .text:0x8033E9C0; // type:function size:0x4 +Append__14MapLineSegmentFv = .text:0x8033E9D0; // type:function size:0x48 +Remove__14MapLineSegmentFv = .text:0x8033EA20; // type:function size:0x48 +Draw__14MapLineSegmentFiP6mMtx_cbi = .text:0x8033EA70; // type:function size:0x4 +InitMapParts__4dBgSFv = .text:0x8033EA80; // type:function size:0x178 +AppendMapSegment__4dBgSFP14MapLineSegment = .text:0x8033EC00; // type:function size:0x58 +RemoveMapSegment__4dBgSFP14MapLineSegment = .text:0x8033EC60; // type:function size:0x60 +DrawMapSegments__4dBgSFiP6mMtx_cbi = .text:0x8033ECC0; // type:function size:0x8C +ClearMapSegments__4dBgSFv = .text:0x8033ED50; // type:function size:0xBC +SetLightingCode__4dBgSFP12dAcObjBase_cRC13cBgS_PolyInfo = .text:0x8033EE10; // type:function size:0x78 +SetLightingCode__4dBgSFP12dAcObjBase_cf = .text:0x8033EE90; // type:function size:0xB4 +GetLightingCode__4dBgSFPC7mVec3_c = .text:0x8033EF50; // type:function size:0x94 +GetPolyPreventObjOnly__4dBgSFRC13cBgS_PolyInfo = .text:0x8033EFF0; // type:function size:0x114 +GetMapGradationColor__4dBgSFP8_GXColor = .text:0x8033F110; // type:function size:0x3C +__ct__12dBgS_AcchCirFv = .text:0x8033F150; // type:function size:0x5C +__dt__8cM3dGCirFv = .text:0x8033F1B0; // type:function size:0x40 +__dt__12dBgS_AcchCirFv = .text:0x8033F1F0; // type:function size:0x40 +ChkWallHit__12dBgS_AcchCirCFv = .text:0x8033F230; // type:function size:0x5C +SetWallR__12dBgS_AcchCirFf = .text:0x8033F290; // type:function size:0x8 +SetWall__12dBgS_AcchCirFff = .text:0x8033F2A0; // type:function size:0xC +__ct__9dBgS_AcchFv = .text:0x8033F2B0; // type:function size:0x16C +__dt__9dBgS_AcchFv = .text:0x8033F420; // type:function size:0x98 +Set__9dBgS_AcchFP7mVec3_cP7mVec3_cP12dAcObjBase_ciP12dBgS_AcchCirP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x8033F4C0; // type:function size:0x74 +Set__9dBgS_AcchFP12dAcObjBase_ciP12dBgS_AcchCir = .text:0x8033F540; // type:function size:0x70 +fn_8033f5b0__9dBgS_AcchFP7mVec3_cP7mVec3_cf = .text:0x8033F5B0; // type:function size:0x198 +GroundCheck__9dBgS_AcchFR4dBgSb = .text:0x8033F750; // type:function size:0x3E8 +RoofCheck__9dBgS_AcchFR4dBgS = .text:0x8033FB40; // type:function size:0x16C +GroundRoofProc__9dBgS_AcchFR4dBgSb = .text:0x8033FCB0; // type:function size:0x190 +LineCheck__9dBgS_AcchFR4dBgS = .text:0x8033FE40; // type:function size:0x554 +SphCheck__9dBgS_AcchFv = .text:0x803403A0; // type:function size:0xE4 +CrrPos__9dBgS_AcchFR4dBgS = .text:0x80340490; // type:function size:0x600 +GetWallAllR__9dBgS_AcchFv = .text:0x80340A90; // type:function size:0x44 +CalcWallBmdCyl__9dBgS_AcchFv = .text:0x80340AE0; // type:function size:0x19C +SetGroundUpY__9dBgS_AcchFf = .text:0x80340C80; // type:function size:0x14 +fn_80340ca0__9dBgS_AcchCFR13cBgS_PolyInfo = .text:0x80340CA0; // type:function size:0xB8 +Draw__9dBgS_AcchFR4dBgS = .text:0x80340D60; // type:function size:0x4 +SetMoveBGOnly__9dBgS_AcchFv = .text:0x80340D70; // type:function size:0x1C +ClrMoveBGOnly__9dBgS_AcchFv = .text:0x80340D90; // type:function size:0x1C +ChkGndHit__9dBgS_AcchCFv = .text:0x80340DB0; // type:function size:0x5C +ChkRoofHit__9dBgS_AcchCFv = .text:0x80340E10; // type:function size:0x5C +ChkWallHit__9dBgS_AcchCFPi = .text:0x80340E70; // type:function size:0x98 +SetGndThinCellingOff__9dBgS_AcchFv = .text:0x80340F10; // type:function size:0x10 +ClrGndThinCellingOff__9dBgS_AcchFv = .text:0x80340F20; // type:function size:0x10 +Set_0x2000000__9dBgS_AcchFv = .text:0x80340F30; // type:function size:0x10 +Clr_0x2000000__9dBgS_AcchFv = .text:0x80340F40; // type:function size:0x10 +OnWallSort__9dBgS_AcchFv = .text:0x80340F50; // type:function size:0x10 +GetCir__9dBgS_AcchFi = .text:0x80340F60; // type:function size:0x10 +fn_80340f70__9dBgS_AcchFPC7mVec3_c = .text:0x80340F70; // type:function size:0x84 +fn_80341000__9dBgS_AcchFv = .text:0x80341000; // type:function size:0x3C +__ct__12dBgS_ObjAcchFv = .text:0x80341040; // type:function size:0x54 +__dt__12dBgS_ObjAcchFv = .text:0x803410A0; // type:function size:0x58 +__ct__13dBgS_LinkAcchFv = .text:0x80341100; // type:function size:0x54 +__dt__13dBgS_LinkAcchFv = .text:0x80341160; // type:function size:0x58 +__ct__13dBgS_BombAcchFv = .text:0x803411C0; // type:function size:0x54 +__dt__13dBgS_BombAcchFv = .text:0x80341220; // type:function size:0x58 +@56@__dt__9dBgS_AcchFv = .text:0x80341280; // type:function size:0x8 +@40@__dt__9dBgS_AcchFv = .text:0x80341290; // type:function size:0x8 +@56@__dt__12dBgS_ObjAcchFv = .text:0x803412A0; // type:function size:0x8 +@40@__dt__12dBgS_ObjAcchFv = .text:0x803412B0; // type:function size:0x8 +@56@__dt__13dBgS_LinkAcchFv = .text:0x803412C0; // type:function size:0x8 +@40@__dt__13dBgS_LinkAcchFv = .text:0x803412D0; // type:function size:0x8 +@56@__dt__13dBgS_BombAcchFv = .text:0x803412E0; // type:function size:0x8 +@40@__dt__13dBgS_BombAcchFv = .text:0x803412F0; // type:function size:0x8 +__ct__8dBgS_ChkFv = .text:0x80341300; // type:function size:0x4C +__dt__8dBgS_ChkFv = .text:0x80341350; // type:function size:0x68 +GetPolyPassChkInfo__8dBgS_ChkFv = .text:0x803413C0; // type:function size:0x4 +GetGrpPassChkInfo__8dBgS_ChkFv = .text:0x803413D0; // type:function size:0x10 +__ct__15cBgS_GrpPassChkFv = .text:0x803413E0; // type:function size:0x10 +__dt__15cBgS_GrpPassChkFv = .text:0x803413F0; // type:function size:0x40 +__ct__16cBgS_PolyPassChkFv = .text:0x80341430; // type:function size:0x10 +__dt__16cBgS_PolyPassChkFv = .text:0x80341440; // type:function size:0x40 +@16@__dt__8dBgS_ChkFv = .text:0x80341480; // type:function size:0x8 +__ct__11dBgS_GndChkFv = .text:0x80341490; // type:function size:0x6C +__dt__11dBgS_GndChkFv = .text:0x80341500; // type:function size:0x68 +Set__11dBgS_GndChkFPC7mVec3_cPUl = .text:0x80341570; // type:function size:0x44 +__ct__15dBgS_LinkGndChkFv = .text:0x803415C0; // type:function size:0x54 +__dt__15dBgS_LinkGndChkFv = .text:0x80341620; // type:function size:0x58 +__ct__14dBgS_ObjGndChkFv = .text:0x80341680; // type:function size:0x54 +__dt__14dBgS_ObjGndChkFv = .text:0x803416E0; // type:function size:0x58 +__ct__18dBgS_ObjGndChk_WtrFv = .text:0x80341740; // type:function size:0x5C +__dt__18dBgS_ObjGndChk_WtrFv = .text:0x803417A0; // type:function size:0x58 +__dt__18dBgS_ObjGndChk_AllFv = .text:0x80341800; // type:function size:0x58 +__ct__14dBgS_CamGndChkFv = .text:0x80341860; // type:function size:0x54 +__dt__14dBgS_CamGndChkFv = .text:0x803418C0; // type:function size:0x58 +__ct__18dBgS_ObjGndChk_AllFv = .text:0x80341920; // type:function size:0x58 +__ct__18dBgS_CamGndChk_WtrFv = .text:0x80341980; // type:function size:0x58 +__dt__18dBgS_CamGndChk_WtrFv = .text:0x803419E0; // type:function size:0x58 +ClearInstance__14dBgS_ObjGndChkFv = .text:0x80341A40; // type:function size:0x2C +CheckPos__14dBgS_ObjGndChkFPC7mVec3_c = .text:0x80341A70; // type:function size:0x5C +GetMaterial__14dBgS_ObjGndChkFv = .text:0x80341AD0; // type:function size:0x30 +GetPolyAtt1__14dBgS_ObjGndChkFv = .text:0x80341B00; // type:function size:0x30 +GetTriPlane__14dBgS_ObjGndChkFP8cM3dGPla = .text:0x80341B30; // type:function size:0x40 +GetRoomID__14dBgS_ObjGndChkFv = .text:0x80341B70; // type:function size:0x30 +ChkMoveBG__14dBgS_ObjGndChkFv = .text:0x80341BA0; // type:function size:0x34 +GetLightingCode__14dBgS_ObjGndChkFv = .text:0x80341BE0; // type:function size:0x30 +GetSpecialCode__14dBgS_ObjGndChkFv = .text:0x80341C10; // type:function size:0x30 +__sinit_\d_bg_s_gnd_chk_cpp = .text:0x80341C40; // type:function size:0x48 scope:local +@136@__dt__11dBgS_GndChkFv = .text:0x80341C90; // type:function size:0x8 scope:weak +@120@__dt__11dBgS_GndChkFv = .text:0x80341CA0; // type:function size:0x8 scope:weak +@136@__dt__15dBgS_LinkGndChkFv = .text:0x80341CB0; // type:function size:0x8 scope:weak +@120@__dt__15dBgS_LinkGndChkFv = .text:0x80341CC0; // type:function size:0x8 scope:weak +@136@__dt__14dBgS_ObjGndChkFv = .text:0x80341CD0; // type:function size:0x8 scope:weak +@120@__dt__14dBgS_ObjGndChkFv = .text:0x80341CE0; // type:function size:0x8 scope:weak +@136@__dt__18dBgS_ObjGndChk_WtrFv = .text:0x80341CF0; // type:function size:0x8 scope:weak +@120@__dt__18dBgS_ObjGndChk_WtrFv = .text:0x80341D00; // type:function size:0x8 scope:weak +@136@__dt__18dBgS_ObjGndChk_AllFv = .text:0x80341D10; // type:function size:0x8 scope:weak +@120@__dt__18dBgS_ObjGndChk_AllFv = .text:0x80341D20; // type:function size:0x8 scope:weak +@136@__dt__14dBgS_CamGndChkFv = .text:0x80341D30; // type:function size:0x8 scope:weak +@120@__dt__14dBgS_CamGndChkFv = .text:0x80341D40; // type:function size:0x8 scope:weak +@136@__dt__18dBgS_CamGndChk_WtrFv = .text:0x80341D50; // type:function size:0x8 scope:weak +@120@__dt__18dBgS_CamGndChk_WtrFv = .text:0x80341D60; // type:function size:0x8 scope:weak +__ct__15dBgS_GrpPassChkFv = .text:0x80341D70; // type:function size:0x44 +__dt__15dBgS_GrpPassChkFv = .text:0x80341DC0; // type:function size:0x58 +__ct__11dBgS_LinChkFv = .text:0x80341E20; // type:function size:0x6C +__dt__11dBgS_LinChkFv = .text:0x80341E90; // type:function size:0x68 +Set__11dBgS_LinChkFPC7mVec3_cPC7mVec3_cPC12dAcObjBase_c = .text:0x80341F00; // type:function size:0x18 +__ct__14dBgS_CamLinChkFv = .text:0x80341F20; // type:function size:0x54 +__dt__14dBgS_CamLinChkFv = .text:0x80341F80; // type:function size:0x58 +__ct__21dBgS_CamLinChk_NorWtrFv = .text:0x80341FE0; // type:function size:0x58 +__dt__21dBgS_CamLinChk_NorWtrFv = .text:0x80342040; // type:function size:0x58 +__ct__14dBgS_ObjLinChkFv = .text:0x803420A0; // type:function size:0x5C +__dt__14dBgS_ObjLinChkFv = .text:0x80342100; // type:function size:0x58 +ClearInstance__14dBgS_ObjLinChkFv = .text:0x80342160; // type:function size:0x2C +SetEnd__14dBgS_ObjLinChkFPC7mVec3_c = .text:0x80342190; // type:function size:0x24 +LineCross__14dBgS_ObjLinChkFPC7mVec3_cPC7mVec3_cPC12dAcObjBase_c = .text:0x803421C0; // type:function size:0x4C +GetAngle__14dBgS_ObjLinChkFv = .text:0x80342210; // type:function size:0x40 +GetTriPla__14dBgS_ObjLinChkFP8cM3dGPla = .text:0x80342250; // type:function size:0x40 +GetMaterial__14dBgS_ObjLinChkFv = .text:0x80342290; // type:function size:0x30 +ChkMoveBG__14dBgS_ObjLinChkFv = .text:0x803422C0; // type:function size:0x34 +ChkGround__14dBgS_ObjLinChkFv = .text:0x80342300; // type:function size:0x38 +ChkWall__14dBgS_ObjLinChkFv = .text:0x80342340; // type:function size:0x4C +ChkRoof__14dBgS_ObjLinChkFv = .text:0x80342390; // type:function size:0x38 +__ct__14dBgS_WtrLinChkFv = .text:0x803423D0; // type:function size:0x5C +__dt__14dBgS_WtrLinChkFv = .text:0x80342430; // type:function size:0x58 +ClearInstance__14dBgS_WtrLinChkFv = .text:0x80342490; // type:function size:0x2C +SetEnd__14dBgS_WtrLinChkFPC7mVec3_c = .text:0x803424C0; // type:function size:0x24 +SetIsWater__14dBgS_WtrLinChkFPC7mVec3_cPC7mVec3_cPC12dAcObjBase_c = .text:0x803424F0; // type:function size:0x80 +__ct__15dBgS_LinkLinChkFv = .text:0x80342570; // type:function size:0x54 +__dt__15dBgS_LinkLinChkFv = .text:0x803425D0; // type:function size:0x58 +__ct__15dBgS_BombLinChkFv = .text:0x80342630; // type:function size:0x54 +__dt__15dBgS_BombLinChkFv = .text:0x80342690; // type:function size:0x58 +__ct__16dBgS_ArrowLinChkFv = .text:0x803426F0; // type:function size:0x54 +__dt__16dBgS_ArrowLinChkFv = .text:0x80342750; // type:function size:0x58 +__ct__17dBgS_BeetleLinChkFv = .text:0x803427B0; // type:function size:0x54 +__dt__17dBgS_BeetleLinChkFv = .text:0x80342810; // type:function size:0x58 +__ct__19dBgS_ClawshotLinChkFv = .text:0x80342870; // type:function size:0x54 +__dt__19dBgS_ClawshotLinChkFv = .text:0x803428D0; // type:function size:0x58 +__ct__22dBgS_GustBellowsLinChkFv = .text:0x80342930; // type:function size:0x54 +__dt__22dBgS_GustBellowsLinChkFv = .text:0x80342990; // type:function size:0x58 +__ct__15dBgS_WhipLinChkFv = .text:0x803429F0; // type:function size:0x54 +__dt__15dBgS_WhipLinChkFv = .text:0x80342A50; // type:function size:0x58 +__sinit_\d_bg_s_lin_chk_cpp = .text:0x80342AB0; // type:function size:0x64 scope:local +@144@__dt__11dBgS_LinChkFv = .text:0x80342B20; // type:function size:0x8 scope:weak +@128@__dt__11dBgS_LinChkFv = .text:0x80342B30; // type:function size:0x8 scope:weak +@144@__dt__14dBgS_CamLinChkFv = .text:0x80342B40; // type:function size:0x8 scope:weak +@128@__dt__14dBgS_CamLinChkFv = .text:0x80342B50; // type:function size:0x8 scope:weak +@144@__dt__21dBgS_CamLinChk_NorWtrFv = .text:0x80342B60; // type:function size:0x8 scope:weak +@128@__dt__21dBgS_CamLinChk_NorWtrFv = .text:0x80342B70; // type:function size:0x8 scope:weak +@144@__dt__14dBgS_ObjLinChkFv = .text:0x80342B80; // type:function size:0x8 scope:weak +@128@__dt__14dBgS_ObjLinChkFv = .text:0x80342B90; // type:function size:0x8 scope:weak +@144@__dt__15dBgS_LinkLinChkFv = .text:0x80342BA0; // type:function size:0x8 scope:weak +@128@__dt__15dBgS_LinkLinChkFv = .text:0x80342BB0; // type:function size:0x8 scope:weak +@144@__dt__15dBgS_BombLinChkFv = .text:0x80342BC0; // type:function size:0x8 scope:weak +@128@__dt__15dBgS_BombLinChkFv = .text:0x80342BD0; // type:function size:0x8 scope:weak +@144@__dt__16dBgS_ArrowLinChkFv = .text:0x80342BE0; // type:function size:0x8 scope:weak +@128@__dt__16dBgS_ArrowLinChkFv = .text:0x80342BF0; // type:function size:0x8 scope:weak +@144@__dt__17dBgS_BeetleLinChkFv = .text:0x80342C00; // type:function size:0x8 scope:weak +@128@__dt__17dBgS_BeetleLinChkFv = .text:0x80342C10; // type:function size:0x8 scope:weak +@144@__dt__19dBgS_ClawshotLinChkFv = .text:0x80342C20; // type:function size:0x8 scope:weak +@128@__dt__19dBgS_ClawshotLinChkFv = .text:0x80342C30; // type:function size:0x8 scope:weak +@144@__dt__22dBgS_GustBellowsLinChkFv = .text:0x80342C40; // type:function size:0x8 scope:weak +@128@__dt__22dBgS_GustBellowsLinChkFv = .text:0x80342C50; // type:function size:0x8 scope:weak +@144@__dt__15dBgS_WhipLinChkFv = .text:0x80342C60; // type:function size:0x8 scope:weak +@128@__dt__15dBgS_WhipLinChkFv = .text:0x80342C70; // type:function size:0x8 scope:weak +@144@__dt__14dBgS_WtrLinChkFv = .text:0x80342C80; // type:function size:0x8 scope:weak +@128@__dt__14dBgS_WtrLinChkFv = .text:0x80342C90; // type:function size:0x8 scope:weak +__ct__16dBgS_PolyPassChkFv = .text:0x80342CA0; // type:function size:0x6C +__dt__16dBgS_PolyPassChkFv = .text:0x80342D10; // type:function size:0x58 +__ct__12dBgS_RoofChkFv = .text:0x80342D70; // type:function size:0xC0 +__dt__12dBgS_RoofChkFv = .text:0x80342E30; // type:function size:0x68 +SetPos__12dBgS_RoofChkFPC7mVec3_c = .text:0x80342EA0; // type:function size:0x1C +__ct__15dBgS_ObjRoofChkFv = .text:0x80342EC0; // type:function size:0x5C +__dt__15dBgS_ObjRoofChkFv = .text:0x80342F20; // type:function size:0x58 +ClearInstance__15dBgS_ObjRoofChkFv = .text:0x80342F80; // type:function size:0x2C +CheckPos__15dBgS_ObjRoofChkFPC7mVec3_c = .text:0x80342FB0; // type:function size:0x5C +__ct__16dBgS_LinkRoofChkFv = .text:0x80343010; // type:function size:0x5C +__dt__16dBgS_LinkRoofChkFv = .text:0x80343070; // type:function size:0x58 +__sinit_\d_bg_s_roof_chk_cpp = .text:0x803430D0; // type:function size:0x48 scope:local +@44@__dt__12dBgS_RoofChkFv = .text:0x80343120; // type:function size:0x8 +@100@__dt__12dBgS_RoofChkFv = .text:0x80343130; // type:function size:0x8 +@84@__dt__12dBgS_RoofChkFv = .text:0x80343140; // type:function size:0x8 +@44@__dt__15dBgS_ObjRoofChkFv = .text:0x80343150; // type:function size:0x8 +@100@__dt__15dBgS_ObjRoofChkFv = .text:0x80343160; // type:function size:0x8 +@84@__dt__15dBgS_ObjRoofChkFv = .text:0x80343170; // type:function size:0x8 +@44@__dt__16dBgS_LinkRoofChkFv = .text:0x80343180; // type:function size:0x8 +@100@__dt__16dBgS_LinkRoofChkFv = .text:0x80343190; // type:function size:0x8 +@84@__dt__16dBgS_LinkRoofChkFv = .text:0x803431A0; // type:function size:0x8 +__ct__11dBgS_SphChkFv = .text:0x803431B0; // type:function size:0xEC +__dt__11dBgS_SphChkFv = .text:0x803432A0; // type:function size:0x68 +__ct__14dBgS_CamSphChkFv = .text:0x80343310; // type:function size:0x5C +__dt__14dBgS_CamSphChkFv = .text:0x80343370; // type:function size:0x58 +@64@__dt__11dBgS_SphChkFv = .text:0x803433D0; // type:function size:0x8 +@120@__dt__11dBgS_SphChkFv = .text:0x803433E0; // type:function size:0x8 +@104@__dt__11dBgS_SphChkFv = .text:0x803433F0; // type:function size:0x8 +@64@__dt__14dBgS_CamSphChkFv = .text:0x80343400; // type:function size:0x8 +@120@__dt__14dBgS_CamSphChkFv = .text:0x80343410; // type:function size:0x8 +@104@__dt__14dBgS_CamSphChkFv = .text:0x80343420; // type:function size:0x8 +__ct__14dBgS_SplGrpChkFv = .text:0x80343430; // type:function size:0xD4 +__dt__14dBgS_SplGrpChkFv = .text:0x80343510; // type:function size:0x68 +Set__14dBgS_SplGrpChkFR7mVec3_cf = .text:0x80343580; // type:function size:0x20 +@44@__dt__14dBgS_SplGrpChkFv = .text:0x803435A0; // type:function size:0x8 +@100@__dt__14dBgS_SplGrpChkFv = .text:0x803435B0; // type:function size:0x8 +@84@__dt__14dBgS_SplGrpChkFv = .text:0x803435C0; // type:function size:0x8 +__ct__11dBgS_WtrChkFv = .text:0x803435D0; // type:function size:0x60 +__dt__11dBgS_WtrChkFv = .text:0x80343630; // type:function size:0x58 +ClearInstance__11dBgS_WtrChkFv = .text:0x80343690; // type:function size:0x2C +CheckPos__11dBgS_WtrChkFPC7mVec3_cbff = .text:0x803436C0; // type:function size:0xAC +GetMaterial__11dBgS_WtrChkFv = .text:0x80343770; // type:function size:0x2C +__sinit_\d_bg_s_wtr_chk_cpp = .text:0x803437A0; // type:function size:0x48 scope:local +@44@__dt__11dBgS_WtrChkFv = .text:0x803437F0; // type:function size:0x8 +@100@__dt__11dBgS_WtrChkFv = .text:0x80343800; // type:function size:0x8 +@84@__dt__11dBgS_WtrChkFv = .text:0x80343810; // type:function size:0x8 +__ct__4cBgWFv = .text:0x80343820; // type:function size:0xAC +__dt__4cBgWFv = .text:0x803438D0; // type:function size:0x6C +FreeArea__4cBgWFv = .text:0x80343940; // type:function size:0xC0 +__dt__11cBgW_TriElmFv = .text:0x80343A00; // type:function size:0x40 +__dt__13cBgW_NodeTreeFv = .text:0x80343A40; // type:function size:0x40 +__dt__11cBgW_GrpElmFv = .text:0x80343A80; // type:function size:0x40 +GetOldInvMtx__4cBgWFP6mMtx_c = .text:0x80343AC0; // type:function size:0x8 +UpdateMtx__4cBgWFv = .text:0x80343AD0; // type:function size:0xA4 +GlobalVtx__4cBgWFv = .text:0x80343B80; // type:function size:0xDC +SetVtx__4cBgWFv = .text:0x80343C60; // type:function size:0xE0 +CalcPlane__4cBgWFv = .text:0x80343D40; // type:function size:0x110 +SetTri__4cBgWFv = .text:0x80343E50; // type:function size:0x8C +__ct__11cBgW_TriElmFv = .text:0x80343EE0; // type:function size:0x4 +BlckConnect__4cBgWFPUsPii = .text:0x80343EF0; // type:function size:0x48 +ClassifyPlane__4cBgWFv = .text:0x80343F40; // type:function size:0x1F0 +MakeBlckTransMinMax__4cBgWFP7mVec3_cP7mVec3_c = .text:0x80344130; // type:function size:0x44 +MakeBlckMinMax__4cBgWFiP7mVec3_cP7mVec3_c = .text:0x80344180; // type:function size:0x84 +GetPolyAtt0__4cBgWFRC13cBgS_PolyInfo = .text:0x80344210; // type:function size:0x8 +MakeBlckBnd__4cBgWFiP7mVec3_cP7mVec3_c = .text:0x80344220; // type:function size:0x170 +MakeNodeTreeRp__4cBgWFi = .text:0x80344390; // type:function size:0x128 +MakeNodeTreeGrpRp__4cBgWFi = .text:0x803444C0; // type:function size:0x128 +MakeNodeTree__4cBgWFv = .text:0x803445F0; // type:function size:0x144 +ChkMemoryError__4cBgWFv = .text:0x80344740; // type:function size:0x4C +Set__4cBgWFP6cBgD_tP3PLCUlP6mMtx_cP7mVec3_c = .text:0x80344790; // type:function size:0x27C +__ct__11cBgW_RwgElmFv = .text:0x80344A10; // type:function size:0x4 scope:weak +__ct__11cBgW_BlkElmFv = .text:0x80344A20; // type:function size:0x4 scope:weak +__ct__13cBgW_NodeTreeFv = .text:0x80344A30; // type:function size:0x4 scope:weak +__ct__11cBgW_GrpElmFv = .text:0x80344A40; // type:function size:0x4 scope:weak +LineCheck__4cBgWFP11cBgS_LinChk = .text:0x80344A50; // type:function size:0x30 +LineCheckGrpRp__4cBgWFP11cBgS_LinChki = .text:0x80344A80; // type:function size:0xCC +LineCheckRp__4cBgWFP11cBgS_LinChki = .text:0x80344B50; // type:function size:0x124 +RwgLineCheck__4cBgWFiP11cBgS_LinChk = .text:0x80344C80; // type:function size:0x148 +GroundCross__4cBgWFP11cBgS_GndChk = .text:0x80344DD0; // type:function size:0x30 +GroundCrossGrpRp__4cBgWFP11cBgS_GndChki = .text:0x80344E00; // type:function size:0x114 +GroundCrossRp__4cBgWFP11cBgS_GndChki = .text:0x80344F20; // type:function size:0x14C +RwgGroundCheckGnd__4cBgWFUsP11cBgS_GndChk = .text:0x80345070; // type:function size:0x220 +RwgGroundCheckWall__4cBgWFUsP11cBgS_GndChk = .text:0x80345290; // type:function size:0x244 +Lock__4cBgWFv = .text:0x803454E0; // type:function size:0x38 +CopyOldMtx__4cBgWFv = .text:0x80345520; // type:function size:0x4C +Move__4cBgWFv = .text:0x80345570; // type:function size:0x254 +ShdwDraw__4cBgWFP13cBgS_ShdwDraw = .text:0x803457D0; // type:function size:0x8 +ShdwDrawGrpRp__4cBgWFP13cBgS_ShdwDrawi = .text:0x803457E0; // type:function size:0x170 +ShdwDrawRp__4cBgWFP13cBgS_ShdwDrawi = .text:0x80345950; // type:function size:0x1B8 +RwgShdwDraw__4cBgWFiP13cBgS_ShdwDraw = .text:0x80345B10; // type:function size:0x2AC +GetBnd__4cBgWCFv = .text:0x80345DC0; // type:function size:0x14 +GetTriPnt__4cBgWCFRC13cBgS_PolyInfoP7mVec3_cP7mVec3_cP7mVec3_c = .text:0x80345DE0; // type:function size:0x88 +GetTopUnder__4cBgWCFPfPf = .text:0x80345E70; // type:function size:0x24 +GetTriPla__4cBgWFiP8cM3dGPla = .text:0x80345EA0; // type:function size:0x30 +GetTriPla__4cBgWCFRC13cBgS_PolyInfoP8cM3dGPla = .text:0x80345ED0; // type:function size:0x34 +GetGrpInf__4cBgWCFRC13cBgS_PolyInfo = .text:0x80345F10; // type:function size:0x20 +GetGrpRoomIndex__4dBgWCFRC13cBgS_PolyInfo = .text:0x80345F30; // type:function size:0x30 +GetExitId__4dBgWFRC13cBgS_PolyInfo = .text:0x80345F60; // type:function size:0x30 +GetZTargetThrough__4dBgWFRC13cBgS_PolyInfo = .text:0x80345F90; // type:function size:0x30 +GetSpecialCode__4dBgWFRC13cBgS_PolyInfo = .text:0x80345FC0; // type:function size:0x14 +GetSpecialCode__4dBgWFi = .text:0x80345FE0; // type:function size:0x30 +GetCode0_0x30000000__4dBgWFRC13cBgS_PolyInfo = .text:0x80346010; // type:function size:0x30 +GetCode0_0x80000000__4dBgWFRC13cBgS_PolyInfo = .text:0x80346040; // type:function size:0x30 +GetPolyObjThrough__4dBgWFi = .text:0x80346070; // type:function size:0x2C +GetPolyCamThrough__4dBgWFi = .text:0x803460A0; // type:function size:0x2C +GetPolyLinkThrough__4dBgWFi = .text:0x803460D0; // type:function size:0x2C +GetPolyArrowThrough__4dBgWFi = .text:0x80346100; // type:function size:0x2C +GetPolySlingshotThrough__4dBgWFi = .text:0x80346130; // type:function size:0x2C +GetPolyBeetleThrough__4dBgWFi = .text:0x80346160; // type:function size:0x2C +GetPolyClawshotThrough__4dBgWFi = .text:0x80346190; // type:function size:0x2C +GetPolyBombThrough__4dBgWFi = .text:0x803461C0; // type:function size:0x2C +GetPolyWhipThrough__4dBgWFi = .text:0x803461F0; // type:function size:0x2C +GetUnderwaterRoofCode__4dBgWFi = .text:0x80346220; // type:function size:0x2C +GetShdwThrough__4dBgWFi = .text:0x80346250; // type:function size:0x2C +GetLinkNo__4dBgWFRC13cBgS_PolyInfo = .text:0x80346280; // type:function size:0x34 +GetWallCode__4dBgWFRC13cBgS_PolyInfo = .text:0x803462C0; // type:function size:0x14 +GetWallAtt__4dBgWFi = .text:0x803462E0; // type:function size:0x30 +GetPolyAtt0Material__4dBgWFRC13cBgS_PolyInfo = .text:0x80346310; // type:function size:0x40 +GetPolyAtt1__4dBgWFRC13cBgS_PolyInfo = .text:0x80346350; // type:function size:0x34 +GetGroundCode__4dBgWFRC13cBgS_PolyInfo = .text:0x80346390; // type:function size:0x34 +GetCode1_0x02000000__4dBgWFi = .text:0x803463D0; // type:function size:0x30 +GetCode1_0x04000000__4dBgWFi = .text:0x80346400; // type:function size:0x30 +GetCode1_0x08000000__4dBgWFi = .text:0x80346430; // type:function size:0x30 +GetLightingCode__4dBgWFRC13cBgS_PolyInfo = .text:0x80346460; // type:function size:0x34 +GetCamMoveBG__4dBgWFRC13cBgS_PolyInfo = .text:0x803464A0; // type:function size:0x34 +GetRoomCamId__4dBgWFRC13cBgS_PolyInfo = .text:0x803464E0; // type:function size:0x34 +GetRoomPathId__4dBgWFRC13cBgS_PolyInfo = .text:0x80346520; // type:function size:0x34 +GetRoomPathPntNo__4dBgWFRC13cBgS_PolyInfo = .text:0x80346560; // type:function size:0x34 +ChkNotReady__4cBgWCFv = .text:0x803465A0; // type:function size:0x10 +ChkLock__4cBgWCFv = .text:0x803465B0; // type:function size:0xC +ChkMoveBg__4cBgWCFv = .text:0x803465C0; // type:function size:0xC +__ct__4dBgWFv = .text:0x803465D0; // type:function size:0x54 +__dt__4dBgWFv = .text:0x80346630; // type:function size:0x58 +Move__4dBgWFv = .text:0x80346690; // type:function size:0x10 +positionWallCorrect__4dBgWFP9dBgS_AcchfR8cM3dGPlaP7mVec3_cf = .text:0x803466A0; // type:function size:0x50 +RwgWallCorrect__4dBgWFP9dBgS_AcchUs = .text:0x803466F0; // type:function size:0xA6C +WallCorrectRp__4dBgWFP9dBgS_Acchi = .text:0x80347160; // type:function size:0x178 +WallCorrectGrpRp__4dBgWFP9dBgS_Acchi = .text:0x803472E0; // type:function size:0x150 +WallCorrect__4dBgWFP9dBgS_Acch = .text:0x80347430; // type:function size:0x30 +RwgWallCorrectSort__4dBgWFP9dBgS_AcchUs = .text:0x80347460; // type:function size:0x360 +WallCorrectRpSort__4dBgWFP9dBgS_Acchi = .text:0x803477C0; // type:function size:0x190 +WallCorrectGrpRpSort__4dBgWFP9dBgS_Acchi = .text:0x80347950; // type:function size:0x150 +WallCorrectSort__4dBgWFP9dBgS_Acch = .text:0x80347AA0; // type:function size:0xEA4 +RwgRoofChk__4dBgWFUsP12dBgS_RoofChkf = .text:0x80348950; // type:function size:0x150 +RwgRoofChkRoof__4dBgWFUsP12dBgS_RoofChk = .text:0x80348AA0; // type:function size:0xA4 +RwgRoofChkWall__4dBgWFUsP12dBgS_RoofChk = .text:0x80348B50; // type:function size:0xC4 +RoofChkRp__4dBgWFP12dBgS_RoofChki = .text:0x80348C20; // type:function size:0x150 +RoofChkGrpRp__4dBgWFP12dBgS_RoofChki = .text:0x80348D70; // type:function size:0x114 +RoofChk__4dBgWFP12dBgS_RoofChk = .text:0x80348E90; // type:function size:0x30 +RwgSplGrpChk__4dBgWFUsP14dBgS_SplGrpChk = .text:0x80348EC0; // type:function size:0x278 +SplGrpChkRp__4dBgWFP14dBgS_SplGrpChki = .text:0x80349140; // type:function size:0x128 +SplGrpChkGrpRp__4dBgWFP14dBgS_SplGrpChki = .text:0x80349270; // type:function size:0x114 +SplGrpChk__4dBgWFP14dBgS_SplGrpChk = .text:0x80349390; // type:function size:0x30 +RwgCaptPoly__4dBgWFUsR13dBgS_CaptPoly = .text:0x803493C0; // type:function size:0x98 +CaptPolyRp__4dBgWFR13dBgS_CaptPolyi = .text:0x80349460; // type:function size:0x1C4 +CaptPolyGrpRp__4dBgWFR13dBgS_CaptPolyi = .text:0x80349630; // type:function size:0x17C +CaptPoly__4dBgWFR13dBgS_CaptPoly = .text:0x803497B0; // type:function size:0x8 +RwgSphChk__4dBgWFUsP11dBgS_SphChkPv = .text:0x803497C0; // type:function size:0x1F0 +SphChkRp__4dBgWFP11dBgS_SphChkPvi = .text:0x803499B0; // type:function size:0x1A8 +SphChkGrpRp__4dBgWFP11dBgS_SphChkPvi = .text:0x80349B60; // type:function size:0x164 +SphChk__4dBgWFP11dBgS_SphChkPv = .text:0x80349CD0; // type:function size:0x30 +CrrPos__4dBgWFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80349D00; // type:function size:0x30 +TransPos__4dBgWFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80349D30; // type:function size:0x30 +MatrixCrrPos__4dBgWFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80349D60; // type:function size:0x10 +CallRideCallback__4dBgWFP12dAcObjBase_cP12dAcObjBase_c = .text:0x80349D70; // type:function size:0x18 +CallArrowStickCallback__4dBgWFP12dAcObjBase_cP12dAcObjBase_cR7mVec3_c = .text:0x80349D90; // type:function size:0x18 +CallUnkCallback__4dBgWFP12dAcObjBase_cP12dAcObjBase_c = .text:0x80349DB0; // type:function size:0x1C +OffMoveFlag__4dBgWFv = .text:0x80349DD0; // type:function size:0x10 +ChkMoveFlag__4dBgWCFv = .text:0x80349DE0; // type:function size:0xC +vt_0x3C__4dBgWFv = .text:0x80349DF0; // type:function size:0x68 +GetMapCode__4dBgWFiPi = .text:0x80349E60; // type:function size:0x100 +UpdateDraw__4dBgWFP12mAllocator_c = .text:0x80349F60; // type:function size:0x24C +GetPolyAtt0__4dBgWFRC13cBgS_PolyInfo = .text:0x8034A1B0; // type:function size:0x34 +GetIsDraw__4dBgWFi = .text:0x8034A1F0; // type:function size:0x1C +DrawOnMap__4dBgWFib = .text:0x8034A210; // type:function size:0x718 +__sinit_\d_bg_w_cpp = .text:0x8034A930; // type:function size:0x1C scope:local +__ct__9dBgW_BaseFv = .text:0x8034A950; // type:function size:0x54 +__dt__9dBgW_BaseFv = .text:0x8034A9B0; // type:function size:0xB8 +ClrDBgWBase__9dBgW_BaseFv = .text:0x8034AA70; // type:function size:0x148 +ChkMemoryError__9dBgW_BaseFv = .text:0x8034ABC0; // type:function size:0x8 +CallRideCallback__9dBgW_BaseFP12dAcObjBase_cP12dAcObjBase_c = .text:0x8034ABD0; // type:function size:0x4 +CallArrowStickCallback__9dBgW_BaseFP12dAcObjBase_cP12dAcObjBase_cR7mVec3_c = .text:0x8034ABE0; // type:function size:0x4 +CallUnkCallback__9dBgW_BaseFP12dAcObjBase_cP12dAcObjBase_c = .text:0x8034ABF0; // type:function size:0x8 +CalcDiffShapeAngleY__9dBgW_BaseFs = .text:0x8034AC00; // type:function size:0x14 +SetOldShapeAngleY__9dBgW_BaseFs = .text:0x8034AC20; // type:function size:0x8 +InitMapStuff__9dBgW_BaseFP12mAllocator_c = .text:0x8034AC30; // type:function size:0x134 +fn_8034AD70__9dBgW_BaseCFv = .text:0x8034AD70; // type:function size:0x24 +fn_8034ADA0__9dBgW_BaseCFv = .text:0x8034ADA0; // type:function size:0x20 +UpdateDraw__9dBgW_BaseFP12mAllocator_c = .text:0x8034ADC0; // type:function size:0x104 +RegistBg__9dBgW_BaseFi = .text:0x8034AED0; // type:function size:0x8 +UnRegistBg__9dBgW_BaseFv = .text:0x8034AEE0; // type:function size:0xC +ChkReady__9dBgW_BaseCFv = .text:0x8034AEF0; // type:function size:0x4C +Set0x2F__9dBgW_BaseFUc = .text:0x8034AF40; // type:function size:0x8 +__ct__8dBgWKColFv = .text:0x8034AF50; // type:function size:0x50 +__dt__8dBgWKColFv = .text:0x8034AFA0; // type:function size:0x64 +initKCollision__8dBgWKColFPv = .text:0x8034B010; // type:function size:0x34 +Set__8dBgWKColFPvPv = .text:0x8034B050; // type:function size:0x144 +GetTriNrm__8dBgWKColCFP12KC_PrismDataPP7mVec3_c = .text:0x8034B1A0; // type:function size:0x1C +ChkNotReady__8dBgWKColCFv = .text:0x8034B1C0; // type:function size:0x10 +ChkLock__8dBgWKColCFv = .text:0x8034B1D0; // type:function size:0x8 +ChkMoveBg__8dBgWKColCFv = .text:0x8034B1E0; // type:function size:0x8 +ChkMoveFlag__8dBgWKColCFv = .text:0x8034B1F0; // type:function size:0x8 +GetTriPla__8dBgWKColCFRC13cBgS_PolyInfoP8cM3dGPla = .text:0x8034B200; // type:function size:0xB0 +GetTriPnt__8dBgWKColCFRC13cBgS_PolyInfoP7mVec3_cP7mVec3_cP7mVec3_c = .text:0x8034B2B0; // type:function size:0x8 +GetTriPnt__8dBgWKColCFiP7mVec3_cP7mVec3_cP7mVec3_c = .text:0x8034B2C0; // type:function size:0x14 +GetTriPnt__8dBgWKColCFPC12KC_PrismDataP7mVec3_cP7mVec3_cP7mVec3_c = .text:0x8034B2E0; // type:function size:0x1CC +GetBnd__8dBgWKColCFv = .text:0x8034B4B0; // type:function size:0x8 +GetGrpInf__8dBgWKColCFRC13cBgS_PolyInfo = .text:0x8034B4C0; // type:function size:0x20 +OffMoveFlag__8dBgWKColFv = .text:0x8034B4E0; // type:function size:0x4 +ChkPolyThrough__8dBgWKColFiP5dBgPcP8cBgS_Chk = .text:0x8034B4F0; // type:function size:0x2C0 +ChkPolyThroughGnd__8dBgWKColFiP5dBgPcP8cBgS_Chk = .text:0x8034B7B0; // type:function size:0x2A0 +vt_0x3C__8dBgWKColFv = .text:0x8034BA50; // type:function size:0x10 +LineCheck__8dBgWKColFP11cBgS_LinChk = .text:0x8034BA60; // type:function size:0x904 +GroundCross__8dBgWKColFP11cBgS_GndChk = .text:0x8034C370; // type:function size:0x47C +ShdwDraw__8dBgWKColFP13cBgS_ShdwDraw = .text:0x8034C7F0; // type:function size:0x790 +CaptPoly__8dBgWKColFR13dBgS_CaptPoly = .text:0x8034CF80; // type:function size:0x474 +WallCorrectSort__8dBgWKColFP9dBgS_Acch = .text:0x8034D400; // type:function size:0x1570 +WallCorrect__8dBgWKColFP9dBgS_Acch = .text:0x8034E970; // type:function size:0xDF4 +RoofChk__8dBgWKColFP12dBgS_RoofChk = .text:0x8034F770; // type:function size:0x3E4 +SplGrpChk__8dBgWKColFP14dBgS_SplGrpChk = .text:0x8034FB60; // type:function size:0x478 +SphChk__8dBgWKColFP11dBgS_SphChkPv = .text:0x8034FFE0; // type:function size:0x5B4 +GetTopUnder__8dBgWKColCFPfPf = .text:0x803505A0; // type:function size:0x3C +GetGrpRoomIndex__8dBgWKColCFRC13cBgS_PolyInfo = .text:0x803505E0; // type:function size:0x30 +GetExitId__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350610; // type:function size:0x30 +GetZTargetThrough__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350640; // type:function size:0x30 +GetSpecialCode__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350670; // type:function size:0x14 +GetSpecialCode__8dBgWKColFi = .text:0x80350690; // type:function size:0x30 +GetCode0_0x30000000__8dBgWKColFRC13cBgS_PolyInfo = .text:0x803506C0; // type:function size:0x30 +GetCode0_0x80000000__8dBgWKColFRC13cBgS_PolyInfo = .text:0x803506F0; // type:function size:0x30 +GetPolyObjThrough__8dBgWKColFi = .text:0x80350720; // type:function size:0x2C +GetPolyCamThrough__8dBgWKColFi = .text:0x80350750; // type:function size:0x2C +GetPolyLinkThrough__8dBgWKColFi = .text:0x80350780; // type:function size:0x2C +GetPolyArrowThrough__8dBgWKColFi = .text:0x803507B0; // type:function size:0x2C +GetPolySlingshotThrough__8dBgWKColFi = .text:0x803507E0; // type:function size:0x2C +GetPolyBeetleThrough__8dBgWKColFi = .text:0x80350810; // type:function size:0x2C +GetPolyClawshotThrough__8dBgWKColFi = .text:0x80350840; // type:function size:0x2C +GetPolyBombThrough__8dBgWKColFi = .text:0x80350870; // type:function size:0x2C +GetPolyWhipThrough__8dBgWKColFi = .text:0x803508A0; // type:function size:0x2C +GetUnderwaterRoofCode__8dBgWKColFi = .text:0x803508D0; // type:function size:0x2C +GetShdwThrough__8dBgWKColFi = .text:0x80350900; // type:function size:0x2C +GetLinkNo__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350930; // type:function size:0x34 +GetWallCode__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350970; // type:function size:0x34 +GetPolyAtt0Material__8dBgWKColFRC13cBgS_PolyInfo = .text:0x803509B0; // type:function size:0x40 +GetPolyAtt1__8dBgWKColFRC13cBgS_PolyInfo = .text:0x803509F0; // type:function size:0x34 +GetGroundCode__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350A30; // type:function size:0x34 +GetCode1_0x02000000__8dBgWKColFi = .text:0x80350A70; // type:function size:0x30 +GetCode1_0x04000000__8dBgWKColFi = .text:0x80350AA0; // type:function size:0x30 +GetCode1_0x08000000__8dBgWKColFi = .text:0x80350AD0; // type:function size:0x30 +GetLightingCode__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350B00; // type:function size:0x34 +GetCamMoveBG__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350B40; // type:function size:0x34 +GetRoomCamId__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350B80; // type:function size:0x34 +GetRoomPathId__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350BC0; // type:function size:0x34 +GetRoomPathPntNo__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80350C00; // type:function size:0x34 +CrrPos__8dBgWKColFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80350C40; // type:function size:0x4 +TransPos__8dBgWKColFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80350C50; // type:function size:0x4 +MatrixCrrPos__8dBgWKColFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80350C60; // type:function size:0x4 +GetMapCode__8dBgWKColFP12KC_PrismDataPi = .text:0x80350C70; // type:function size:0x228 +UpdateDraw__8dBgWKColFP12mAllocator_c = .text:0x80350EA0; // type:function size:0x42C +__ct__6KC_TriFv = .text:0x803512D0; // type:function size:0x4 +__dt__6KC_TriFv = .text:0x803512E0; // type:function size:0x40 +GetPolyAtt0__8dBgWKColFRC13cBgS_PolyInfo = .text:0x80351320; // type:function size:0x34 +GetIsDraw__8dBgWKColFi = .text:0x80351360; // type:function size:0x30 +DrawMapSection__8dBgWKColFifff = .text:0x80351390; // type:function size:0x400 +DrawOnMap__8dBgWKColFib = .text:0x80351790; // type:function size:0x990 +GetPrismIdx__8dBgWKColFPC12KC_PrismData = .text:0x80352120; // type:function size:0x18 +__ct__6dBgWSvFv = .text:0x80352140; // type:function size:0x44 +__dt__6dBgWSvFv = .text:0x80352190; // type:function size:0x58 +Set__6dBgWSvFP6cBgD_tP3PLCUlb = .text:0x803521F0; // type:function size:0x98 +CopyBackVtx__6dBgWSvFv = .text:0x80352290; // type:function size:0x6C +CrrPosWork__6dBgWSvFP7mVec3_ciii = .text:0x80352300; // type:function size:0x1C8 +CrrPos__6dBgWSvFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x803524D0; // type:function size:0xBC +TransPosWork__6dBgWSvFP7mVec3_ciii = .text:0x80352590; // type:function size:0x228 +TransPos__6dBgWSvFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x803527C0; // type:function size:0xBC +MatrixCrrPos__6dBgWSvFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80352880; // type:function size:0x4 +ApplyMtx__6dBgWSvFP6mMtx_c = .text:0x80352890; // type:function size:0x60 +SetTriHeight__6dBgWSvFif = .text:0x803528F0; // type:function size:0x14 +GetTri__6dBgWSvFi = .text:0x80352910; // type:function size:0x10 +__ct__8dBgWTimeFv = .text:0x80352920; // type:function size:0x3C +__dt__8dBgWTimeFv = .text:0x80352960; // type:function size:0x58 +GetTopUnder__8dBgWTimeCFPfPf = .text:0x803529C0; // type:function size:0x18 +ChkNotReady__8dBgWTimeCFv = .text:0x803529E0; // type:function size:0x8 +ChkLock__8dBgWTimeCFv = .text:0x803529F0; // type:function size:0x8 +ChkMoveBg__8dBgWTimeCFv = .text:0x80352A00; // type:function size:0x8 +ChkMoveFlag__8dBgWTimeCFv = .text:0x80352A10; // type:function size:0x8 +GetTriPla__8dBgWTimeCFRC13cBgS_PolyInfoP8cM3dGPla = .text:0x80352A20; // type:function size:0x24 +GetTriPnt__8dBgWTimeCFRC13cBgS_PolyInfoP7mVec3_cP7mVec3_cP7mVec3_c = .text:0x80352A50; // type:function size:0x15C +GetBnd__8dBgWTimeCFv = .text:0x80352BB0; // type:function size:0x8 +GetGrpInf__8dBgWTimeCFRC13cBgS_PolyInfo = .text:0x80352BC0; // type:function size:0x8 +OffMoveFlag__8dBgWTimeFv = .text:0x80352BD0; // type:function size:0x4 +vt_0x3C__8dBgWTimeFv = .text:0x80352BE0; // type:function size:0x10 +LineCheck__8dBgWTimeFP11cBgS_LinChk = .text:0x80352BF0; // type:function size:0x178 +GroundCross__8dBgWTimeFP11cBgS_GndChk = .text:0x80352D70; // type:function size:0x8 +ShdwDraw__8dBgWTimeFP13cBgS_ShdwDraw = .text:0x80352D80; // type:function size:0x4 +CaptPoly__8dBgWTimeFR13dBgS_CaptPoly = .text:0x80352D90; // type:function size:0x4 +WallCorrect__8dBgWTimeFP9dBgS_Acch = .text:0x80352DA0; // type:function size:0x4E0 +WallCorrectSort__8dBgWTimeFP9dBgS_Acch = .text:0x80353280; // type:function size:0x10 +RoofChk__8dBgWTimeFP12dBgS_RoofChk = .text:0x80353290; // type:function size:0x8 +SplGrpChk__8dBgWTimeFP14dBgS_SplGrpChk = .text:0x803532A0; // type:function size:0x8 +SphChk__8dBgWTimeFP11dBgS_SphChkPv = .text:0x803532B0; // type:function size:0x2B4 +GetGrpRoomIndex__8dBgWTimeCFRC13cBgS_PolyInfo = .text:0x80353570; // type:function size:0x8 +GetExitId__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353580; // type:function size:0x8 +GetZTargetThrough__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353590; // type:function size:0x8 +GetSpecialCode__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x803535A0; // type:function size:0x8 +GetSpecialCode__8dBgWTimeFi = .text:0x803535B0; // type:function size:0x8 +GetCode0_0x30000000__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x803535C0; // type:function size:0x8 +GetPolyObjThrough__8dBgWTimeFi = .text:0x803535D0; // type:function size:0x8 +GetPolyCamThrough__8dBgWTimeFi = .text:0x803535E0; // type:function size:0x8 +GetPolyLinkThrough__8dBgWTimeFi = .text:0x803535F0; // type:function size:0x8 +GetPolyArrowThrough__8dBgWTimeFi = .text:0x80353600; // type:function size:0x8 +GetPolySlingshotThrough__8dBgWTimeFi = .text:0x80353610; // type:function size:0x8 +GetPolyBeetleThrough__8dBgWTimeFi = .text:0x80353620; // type:function size:0x8 +GetPolyClawshotThrough__8dBgWTimeFi = .text:0x80353630; // type:function size:0x8 +GetPolyBombThrough__8dBgWTimeFi = .text:0x80353640; // type:function size:0x8 +GetPolyWhipThrough__8dBgWTimeFi = .text:0x80353650; // type:function size:0x8 +GetShdwThrough__8dBgWTimeFi = .text:0x80353660; // type:function size:0x8 +GetUnderwaterRoofCode__8dBgWTimeFi = .text:0x80353670; // type:function size:0x8 +GetCode0_0x80000000__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353680; // type:function size:0x8 +GetLinkNo__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353690; // type:function size:0x8 +GetWallCode__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x803536A0; // type:function size:0x8 +GetPolyAtt0Material__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x803536B0; // type:function size:0x8 +GetPolyAtt0__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x803536C0; // type:function size:0x8 +GetPolyAtt1__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x803536D0; // type:function size:0x8 +GetGroundCode__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x803536E0; // type:function size:0x8 +GetCode1_0x02000000__8dBgWTimeFi = .text:0x803536F0; // type:function size:0x8 +GetCode1_0x04000000__8dBgWTimeFi = .text:0x80353700; // type:function size:0x8 +GetCode1_0x08000000__8dBgWTimeFi = .text:0x80353710; // type:function size:0x8 +GetLightingCode__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353720; // type:function size:0x8 +GetCamMoveBG__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353730; // type:function size:0x8 +GetRoomCamId__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353740; // type:function size:0x8 +GetRoomPathId__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353750; // type:function size:0x8 +GetRoomPathPntNo__8dBgWTimeFRC13cBgS_PolyInfo = .text:0x80353760; // type:function size:0x8 +CrrPos__8dBgWTimeFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80353770; // type:function size:0x4 +TransPos__8dBgWTimeFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80353780; // type:function size:0x4 +MatrixCrrPos__8dBgWTimeFRC13cBgS_PolyInfoPvbP7mVec3_cP7mAng3_cP7mAng3_c = .text:0x80353790; // type:function size:0x4 fn_803537A0 = .text:0x803537A0; // type:function size:0x178 fn_80353920 = .text:0x80353920; // type:function size:0xDC fn_80353A00 = .text:0x80353A00; // type:function size:0x128 -fn_80353B30 = .text:0x80353B30; // type:function size:0x8 -fn_80353B40 = .text:0x80353B40; // type:function size:0x4 +GetIsDraw__8dBgWTimeFi = .text:0x80353B30; // type:function size:0x8 +DrawOnMap__8dBgWTimeFib = .text:0x80353B40; // type:function size:0x4 __ct__9dCcD_Unk1Fv = .text:0x80353B50; // type:function size:0x4C __dt__9dCcD_Unk1Fv = .text:0x80353BA0; // type:function size:0x68 init__9dCcD_Unk1FRC11dCcD_SrcUnk = .text:0x80353C10; // type:function size:0x44 @@ -19790,17 +19790,17 @@ fn_80358850 = .text:0x80358850; // type:function size:0xBC0 fn_80359410 = .text:0x80359410; // type:function size:0xF0 fn_80359500 = .text:0x80359500; // type:function size:0x30C fn_80359810 = .text:0x80359810; // type:function size:0xB4 -fn_803598D0 = .text:0x803598D0; // type:function size:0x18 -fn_803598F0 = .text:0x803598F0; // type:function size:0x40 +__ct__14dBgW_Base_0x18Fv = .text:0x803598D0; // type:function size:0x18 +__dt__14dBgW_Base_0x18Fv = .text:0x803598F0; // type:function size:0x40 fn_80359930 = .text:0x80359930; // type:function size:0x14 fn_80359950 = .text:0x80359950; // type:function size:0x48 fn_803599A0 = .text:0x803599A0; // type:function size:0xC fn_803599B0 = .text:0x803599B0; // type:function size:0x4 fn_803599C0 = .text:0x803599C0; // type:function size:0x98 fn_80359A60 = .text:0x80359A60; // type:function size:0x98 -fn_80359B00 = .text:0x80359B00; // type:function size:0x34 -fn_80359B40 = .text:0x80359B40; // type:function size:0x28 -fn_80359B70 = .text:0x80359B70; // type:function size:0x4C +__ct__15dBgS_Acch_0x1A8Fv = .text:0x80359B00; // type:function size:0x34 +Init__15dBgS_Acch_0x1A8Fv = .text:0x80359B40; // type:function size:0x28 +CalcPos__15dBgS_Acch_0x1A8FP7mVec3_c = .text:0x80359B70; // type:function size:0x4C fn_80359BC0 = .text:0x80359BC0; // type:function size:0x84 fn_80359C50 = .text:0x80359C50; // type:function size:0x1C fn_80359C70 = .text:0x80359C70; // type:function size:0x8 @@ -36099,11 +36099,11 @@ lbl_80547258 = .data:0x80547258; // type:object size:0x10 lbl_80547268 = .data:0x80547268; // type:object size:0x10 lbl_80547278 = .data:0x80547278; // type:object size:0x10 lbl_80547288 = .data:0x80547288; // type:object size:0x100 -lbl_80547388 = .data:0x80547388; // type:object size:0x10 -lbl_80547398 = .data:0x80547398; // type:object size:0x10 -lbl_805473A8 = .data:0x805473A8; // type:object size:0x10 -lbl_805473B8 = .data:0x805473B8; // type:object size:0x10 -cBgW_BgId__vtable = .data:0x805473C8; // type:object size:0x10 +__vt__8cBgS_Chk = .data:0x80547388; // type:object size:0xC +__vt__11cBgS_GndChk = .data:0x80547398; // type:object size:0xC +__vt__11cBgS_LinChk = .data:0x805473A8; // type:object size:0x10 +__vt__13cBgS_ShdwDraw = .data:0x805473B8; // type:object size:0xC +__vt__9cBgW_BgId = .data:0x805473C8; // type:object size:0xC __vt__15dCcD_ShapeAttr4 = .data:0x805473D8; // type:object size:0x5C __vt__15dCcD_ShapeAttr3 = .data:0x80547434; // type:object size:0x5C __vt__15dCcD_ShapeAttr5 = .data:0x80547490; // type:object size:0x68 @@ -36117,61 +36117,61 @@ __vt__11dCcD_GObjAt = .data:0x80547638; // type:object size:0xC __vt__22dCcD_GAtTgCoCommonBase = .data:0x80547644; // type:object size:0xC __vt__15dCcD_DivideArea = .data:0x80547650; // type:object size:0xC __vt__15dCcD_DivideInfo = .data:0x8054765C; // type:object size:0xC -lbl_80547668 = .data:0x80547668; // type:object size:0x10 -lbl_80547678 = .data:0x80547678; // type:object size:0x10 -lbl_80547688 = .data:0x80547688; // type:object size:0x10 +__vt__8cM2dGCir = .data:0x80547668; // type:object size:0xC +__vt__8cM3dGUnk = .data:0x80547678; // type:object size:0xC +__vt__10cPartition = .data:0x80547688; // type:object size:0xC lbl_80547698 = .data:0x80547698; // type:object size:0x7C data:4byte LiquidTextures = .data:0x80547714; // type:object size:0x14 data:4byte SKY_KEEP_ROOMS = .data:0x80547728; // type:object size:0x20 data:4byte lbl_80547748 = .data:0x80547748; // type:object size:0x18 lbl_80547760 = .data:0x80547760; // type:object size:0x18 data:string -CollisionContext__vtable = .data:0x80547778; // type:object size:0x18 -lbl_80547790 = .data:0x80547790; // type:object size:0x10 -lbl_805477A0 = .data:0x805477A0; // type:object size:0x14 -cBgS_ChkElm__vtable = .data:0x805477B4; // type:object size:0xC -lbl_805477C0 = .data:0x805477C0; // type:object size:0x24 -lbl_805477E4 = .data:0x805477E4; // type:object size:0x24 -lbl_80547808 = .data:0x80547808; // type:object size:0x24 -lbl_8054782C = .data:0x8054782C; // type:object size:0x24 -lbl_80547850 = .data:0x80547850; // type:object size:0xC -lbl_8054785C = .data:0x8054785C; // type:object size:0xC -lbl_80547868 = .data:0x80547868; // type:object size:0x18 -lbl_80547880 = .data:0x80547880; // type:object size:0xC -lbl_8054788C = .data:0x8054788C; // type:object size:0xC -lbl_80547898 = .data:0x80547898; // type:object size:0x24 -lbl_805478BC = .data:0x805478BC; // type:object size:0x24 -lbl_805478E0 = .data:0x805478E0; // type:object size:0x24 -lbl_80547904 = .data:0x80547904; // type:object size:0x24 -lbl_80547928 = .data:0x80547928; // type:object size:0x24 -lbl_8054794C = .data:0x8054794C; // type:object size:0x24 -lbl_80547970 = .data:0x80547970; // type:object size:0x28 -lbl_80547998 = .data:0x80547998; // type:object size:0x10 -lbl_805479A8 = .data:0x805479A8; // type:object size:0x28 -lbl_805479D0 = .data:0x805479D0; // type:object size:0x28 -lbl_805479F8 = .data:0x805479F8; // type:object size:0x28 -lbl_80547A20 = .data:0x80547A20; // type:object size:0x28 -lbl_80547A48 = .data:0x80547A48; // type:object size:0x28 -lbl_80547A70 = .data:0x80547A70; // type:object size:0x28 -lbl_80547A98 = .data:0x80547A98; // type:object size:0x28 -lbl_80547AC0 = .data:0x80547AC0; // type:object size:0x28 -lbl_80547AE8 = .data:0x80547AE8; // type:object size:0x28 -lbl_80547B10 = .data:0x80547B10; // type:object size:0x28 -lbl_80547B38 = .data:0x80547B38; // type:object size:0x28 -lbl_80547B60 = .data:0x80547B60; // type:object size:0x28 -lbl_80547B88 = .data:0x80547B88; // type:object size:0x10 -lbl_80547B98 = .data:0x80547B98; // type:object size:0x30 -lbl_80547BC8 = .data:0x80547BC8; // type:object size:0x30 -lbl_80547BF8 = .data:0x80547BF8; // type:object size:0x30 -lbl_80547C28 = .data:0x80547C28; // type:object size:0x30 -lbl_80547C58 = .data:0x80547C58; // type:object size:0x30 -lbl_80547C88 = .data:0x80547C88; // type:object size:0x30 -lbl_80547CB8 = .data:0x80547CB8; // type:object size:0x30 -dBgW__vtable = .data:0x80547CE8; // type:object size:0x118 -cBgW__vtable = .data:0x80547E00; // type:object size:0x110 -dBgW_Base__vtable = .data:0x80547F10; // type:object size:0x108 -RoomCollison__vtable = .data:0x80548018; // type:object size:0x108 -lbl_80548120 = .data:0x80548120; // type:object size:0x118 -lbl_80548238 = .data:0x80548238; // type:object size:0x108 +__vt__4dBgS = .data:0x80547778; // type:object size:0x14 +__vt__14MapLineSegment = .data:0x80547790; // type:object size:0x10 +__vt__4cBgS = .data:0x805477A0; // type:object size:0x14 +__vt__11cBgS_ChkElm = .data:0x805477B4; // type:object size:0xC +__vt__13dBgS_BombAcch = .data:0x805477C0; // type:object size:0x24 +__vt__13dBgS_LinkAcch = .data:0x805477E4; // type:object size:0x24 +__vt__12dBgS_ObjAcch = .data:0x80547808; // type:object size:0x24 +__vt__9dBgS_Acch = .data:0x8054782C; // type:object size:0x24 +__vt__12dBgS_AcchCir = .data:0x80547850; // type:object size:0xC +__vt__8cM3dGCir = .data:0x8054785C; // type:object size:0xC +__vt__8dBgS_Chk = .data:0x80547868; // type:object size:0x18 +__vt__15cBgS_GrpPassChk = .data:0x80547880; // type:object size:0xC +__vt__16cBgS_PolyPassChk = .data:0x8054788C; // type:object size:0xC +__vt__18dBgS_CamGndChk_Wtr = .data:0x80547898; // type:object size:0x24 +__vt__14dBgS_CamGndChk = .data:0x805478BC; // type:object size:0x24 +__vt__18dBgS_ObjGndChk_All = .data:0x805478E0; // type:object size:0x24 +__vt__18dBgS_ObjGndChk_Wtr = .data:0x80547904; // type:object size:0x24 +__vt__14dBgS_ObjGndChk = .data:0x80547928; // type:object size:0x24 +__vt__15dBgS_LinkGndChk = .data:0x8054794C; // type:object size:0x24 +__vt__11dBgS_GndChk = .data:0x80547970; // type:object size:0x24 +__vt__15dBgS_GrpPassChk = .data:0x80547998; // type:object size:0xC +__vt__14dBgS_WtrLinChk = .data:0x805479A8; // type:object size:0x28 +__vt__15dBgS_WhipLinChk = .data:0x805479D0; // type:object size:0x28 +__vt__22dBgS_GustBellowsLinChk = .data:0x805479F8; // type:object size:0x28 +__vt__19dBgS_ClawshotLinChk = .data:0x80547A20; // type:object size:0x28 +__vt__17dBgS_BeetleLinChk = .data:0x80547A48; // type:object size:0x28 +__vt__16dBgS_ArrowLinChk = .data:0x80547A70; // type:object size:0x28 +__vt__15dBgS_BombLinChk = .data:0x80547A98; // type:object size:0x28 +__vt__15dBgS_LinkLinChk = .data:0x80547AC0; // type:object size:0x28 +__vt__14dBgS_ObjLinChk = .data:0x80547AE8; // type:object size:0x28 +__vt__21dBgS_CamLinChk_NorWtr = .data:0x80547B10; // type:object size:0x28 +__vt__14dBgS_CamLinChk = .data:0x80547B38; // type:object size:0x28 +__vt__11dBgS_LinChk = .data:0x80547B60; // type:object size:0x28 +__vt__16dBgS_PolyPassChk = .data:0x80547B88; // type:object size:0xC +__vt__16dBgS_LinkRoofChk = .data:0x80547B98; // type:object size:0x30 +__vt__15dBgS_ObjRoofChk = .data:0x80547BC8; // type:object size:0x30 +__vt__12dBgS_RoofChk = .data:0x80547BF8; // type:object size:0x30 +__vt__14dBgS_CamSphChk = .data:0x80547C28; // type:object size:0x30 +__vt__11dBgS_SphChk = .data:0x80547C58; // type:object size:0x30 +__vt__14dBgS_SplGrpChk = .data:0x80547C88; // type:object size:0x30 +__vt__11dBgS_WtrChk = .data:0x80547CB8; // type:object size:0x30 +__vt__4dBgW = .data:0x80547CE8; // type:object size:0x114 +__vt__4cBgW = .data:0x80547E00; // type:object size:0x110 +__vt__9dBgW_Base = .data:0x80547F10; // type:object size:0x108 +__vt__8dBgWKCol = .data:0x80548018; // type:object size:0x108 +__vt__6dBgWSv = .data:0x80548120; // type:object size:0x114 +__vt__8dBgWTime = .data:0x80548238; // type:object size:0x108 __vt__9dCcD_Aabb = .data:0x80548340; // type:object size:0x7C __vt__8dCcD_Sph = .data:0x805483C0; // type:object size:0x70 __vt__8dCcD_Cyl = .data:0x80548430; // type:object size:0x70 @@ -40396,16 +40396,16 @@ lbl_80575CE0 = .sbss:0x80575CE0; // type:object size:0x4 data:4byte lbl_80575CE4 = .sbss:0x80575CE4; // type:object size:0x4 data:4byte lbl_80575CE8 = .sbss:0x80575CE8; // type:object size:0x4 data:4byte lbl_80575CEC = .sbss:0x80575CEC; // type:object size:0x4 data:4byte -COLLISION_CHECK_CONTEXT = .sbss:0x80575CF0; // type:object size:0x8 data:4byte -FLOOR_HEIGHTMaybe = .sbss:0x80575CF8; // type:object size:0x8 data:float -lbl_80575D00 = .sbss:0x80575D00; // type:object size:0x8 data:float -lbl_80575D08 = .sbss:0x80575D08; // type:object size:0x8 data:float -lbl_80575D10 = .sbss:0x80575D10; // type:object size:0x1 data:byte -lbl_80575D11 = .sbss:0x80575D11; // type:object size:0x1 data:byte -lbl_80575D12 = .sbss:0x80575D12; // type:object size:0x1 data:byte -lbl_80575D13 = .sbss:0x80575D13; // type:object size:0x1 data:byte -lbl_80575D14 = .sbss:0x80575D14; // type:object size:0x1 data:byte -lbl_80575D15 = .sbss:0x80575D15; // type:object size:0x1 data:byte +spInstance__4dBgS = .sbss:0x80575CF0; // type:object size:0x8 data:4byte +sGroundHeight__14dBgS_ObjGndChk = .sbss:0x80575CF8; // type:object size:0x4 data:float +sRoofHeight__15dBgS_ObjRoofChk = .sbss:0x80575D00; // type:object size:0x4 data:float +sWaterHeight__11dBgS_WtrChk = .sbss:0x80575D08; // type:object size:0x4 data:float +sLineCheck__4cBgW = .sbss:0x80575D10; // type:object size:0x1 data:byte +sGndCheck__4cBgW = .sbss:0x80575D11; // type:object size:0x1 data:byte +sWallCheck__4cBgW = .sbss:0x80575D12; // type:object size:0x1 data:byte +sRoofCheck__4cBgW = .sbss:0x80575D13; // type:object size:0x1 data:byte +sSplGrpCheck__4cBgW = .sbss:0x80575D14; // type:object size:0x1 data:byte +sSphCheck__4cBgW = .sbss:0x80575D15; // type:object size:0x1 data:byte l_start = .sbss:0x80575D18; // type:object size:0x4 data:4byte l_wcsbuf_num = .sbss:0x80575D1C; // type:object size:0x4 data:4byte COLLIDER_MANAGER = .sbss:0x80575D20; // type:object size:0x8 data:4byte @@ -46031,7 +46031,7 @@ lbl_8057CFB8 = .sdata2:0x8057CFB8; // type:object size:0x4 data:float lbl_8057CFC0 = .sdata2:0x8057CFC0; // type:object size:0x4 data:float lbl_8057CFC4 = .sdata2:0x8057CFC4; // type:object size:0x4 data:float lbl_8057CFC8 = .sdata2:0x8057CFC8; // type:object size:0x8 data:float -EPSILON = .sdata2:0x8057CFD0; // type:object size:0x4 data:float +G_CM3D_F_ABS_MIN = .sdata2:0x8057CFD0; // type:object size:0x4 data:float lbl_8057CFD4 = .sdata2:0x8057CFD4; // type:object size:0x4 data:float lbl_8057CFD8 = .sdata2:0x8057CFD8; // type:object size:0x4 data:float lbl_8057CFDC = .sdata2:0x8057CFDC; // type:object size:0x4 data:float @@ -46055,9 +46055,9 @@ lbl_8057D020 = .sdata2:0x8057D020; // type:object size:0x4 data:float lbl_8057D028 = .sdata2:0x8057D028; // type:object size:0x8 data:double lbl_8057D030 = .sdata2:0x8057D030; // type:object size:0x4 data:float lbl_8057D034 = .sdata2:0x8057D034; // type:object size:0x4 data:float -lbl_8057D038 = .sdata2:0x8057D038; // type:object size:0x8 data:float -lbl_8057D040 = .sdata2:0x8057D040; // type:object size:0x8 data:float -lbl_8057D048 = .sdata2:0x8057D048; // type:object size:0x8 data:float +lbl_8057D038 = .sdata2:0x8057D038; // type:object size:0x4 data:float +lbl_8057D040 = .sdata2:0x8057D040; // type:object size:0x4 data:float +lbl_8057D048 = .sdata2:0x8057D048; // type:object size:0x4 data:float lbl_8057D050 = .sdata2:0x8057D050; // type:object size:0x4 data:float lbl_8057D054 = .sdata2:0x8057D054; // type:object size:0x4 data:float lbl_8057D058 = .sdata2:0x8057D058; // type:object size:0x4 data:float @@ -46088,7 +46088,7 @@ lbl_8057D0E0 = .sdata2:0x8057D0E0; // type:object size:0x8 data:double lbl_8057D0E8 = .sdata2:0x8057D0E8; // type:object size:0x8 data:double lbl_8057D0F0 = .sdata2:0x8057D0F0; // type:object size:0x4 data:float lbl_8057D0F4 = .sdata2:0x8057D0F4; // type:object size:0x4 data:float -lbl_8057D0F8 = .sdata2:0x8057D0F8; // type:object size:0x8 data:float +lbl_8057D0F8 = .sdata2:0x8057D0F8; // type:object size:0x4 data:float lbl_8057D100 = .sdata2:0x8057D100; // type:object size:0x4 data:float lbl_8057D104 = .sdata2:0x8057D104; // type:object size:0x4 data:float lbl_8057D108 = .sdata2:0x8057D108; // type:object size:0x4 data:float @@ -46103,16 +46103,16 @@ lbl_8057D128 = .sdata2:0x8057D128; // type:object size:0x4 data:float lbl_8057D12C = .sdata2:0x8057D12C; // type:object size:0x4 data:float lbl_8057D130 = .sdata2:0x8057D130; // type:object size:0x4 data:float lbl_8057D134 = .sdata2:0x8057D134; // type:object size:0x4 data:float -lbl_8057D138 = .sdata2:0x8057D138; // type:object size:0x8 data:float -lbl_8057D140 = .sdata2:0x8057D140; // type:object size:0x8 data:float +lbl_8057D138 = .sdata2:0x8057D138; // type:object size:0x4 data:float +lbl_8057D140 = .sdata2:0x8057D140; // type:object size:0x4 data:float lbl_8057D148 = .sdata2:0x8057D148; // type:object size:0x4 data:float lbl_8057D14C = .sdata2:0x8057D14C; // type:object size:0x4 data:float lbl_8057D150 = .sdata2:0x8057D150; // type:object size:0x4 data:float lbl_8057D154 = .sdata2:0x8057D154; // type:object size:0x4 data:float -lbl_8057D158 = .sdata2:0x8057D158; // type:object size:0x8 data:float +lbl_8057D158 = .sdata2:0x8057D158; // type:object size:0x4 data:float lbl_8057D160 = .sdata2:0x8057D160; // type:object size:0x4 data:float lbl_8057D164 = .sdata2:0x8057D164; // type:object size:0x4 data:float -lbl_8057D168 = .sdata2:0x8057D168; // type:object size:0x8 data:float +lbl_8057D168 = .sdata2:0x8057D168; // type:object size:0x4 data:float lbl_8057D170 = .sdata2:0x8057D170; // type:object size:0x4 data:float lbl_8057D174 = .sdata2:0x8057D174; // type:object size:0x4 data:float lbl_8057D178 = .sdata2:0x8057D178; // type:object size:0x4 data:float @@ -49235,19 +49235,20 @@ lbl_805D00F8 = .bss:0x805D00F8; // type:object size:0x30 m_virtual_center__14dCcD_ShapeAttr = .bss:0x805D0128; // type:object size:0xC data:float lbl_805D0138 = .bss:0x805D0138; // type:object size:0x7C data:4byte lbl_805D01B4 = .bss:0x805D01B4; // type:object size:0x14 data:4byte -lbl_805D01C8 = .bss:0x805D01C8; // type:object size:0x10 -BG_CHECKER = .bss:0x805D01D8; // type:object size:0x90 -lbl_805D0268 = .bss:0x805D0268; // type:object size:0x10 -lbl_805D0278 = .bss:0x805D0278; // type:object size:0xA8 -lbl_805D0320 = .bss:0x805D0320; // type:object size:0x98 -lbl_805D03B8 = .bss:0x805D03B8; // type:object size:0x10 -lbl_805D03C8 = .bss:0x805D03C8; // type:object size:0x90 data:4byte -lbl_805D0458 = .bss:0x805D0458; // type:object size:0x10 -lbl_805D0468 = .bss:0x805D0468; // type:object size:0x98 data:4byte -lbl_805D0500 = .bss:0x805D0500; // type:object size:0x10 data:float -l_wcsbug = .bss:0x805D0510; // type:object size:0x540 -lbl_805D0A50 = .bss:0x805D0A50; // type:object size:0x540 -lbl_805D0F90 = .bss:0x805D0F90; // type:object size:0x28 data:float +lbl_805D01C8 = .bss:0x805D01C8; // type:object size:0xC +sInstance__14dBgS_ObjGndChk = .bss:0x805D01D8; // type:object size:0x90 +lbl_805D0268 = .bss:0x805D0268; // type:object size:0xC +sInstance__14dBgS_ObjLinChk = .bss:0x805D0278; // type:object size:0x98 +lbl_805D0310 = .bss:0x805D0310; // type:object size:0xC +sInstance__14dBgS_WtrLinChk = .bss:0x805D0320; // type:object size:0x98 +lbl_805D03B8 = .bss:0x805D03B8; // type:object size:0xC +sInstance__15dBgS_ObjRoofChk = .bss:0x805D03C8; // type:object size:0x90 data:4byte +lbl_805D0458 = .bss:0x805D0458; // type:object size:0xC +sInstance__11dBgS_WtrChk = .bss:0x805D0468; // type:object size:0x98 data:4byte +sWallCorrectPos__4dBgW = .bss:0x805D0500; // type:object size:0x10 data:float +l_wcsbuf = .bss:0x805D0510; // type:object size:0x540 scope:local +l_wcsbuf = .bss:0x805D0A50; // type:object size:0x540 scope:local +lbl_805D0F90 = .bss:0x805D0F90; // type:object size:0x24 data:float lbl_805D0FB8 = .bss:0x805D0FB8; // type:object size:0x30 data:float lbl_805D0FE8 = .bss:0x805D0FE8; // type:object size:0x10 lbl_805D0FF8 = .bss:0x805D0FF8; // type:object size:0x10 data:float diff --git a/configure.py b/configure.py index 0ab83407..3c481c37 100644 --- a/configure.py +++ b/configure.py @@ -363,11 +363,6 @@ config.libs = [ Object(Matching, "toBeSorted/counters/slingshot_seed_counter.cpp"), Object(Matching, "toBeSorted/counters/key_piece_counter.cpp"), Object(Matching, "toBeSorted/counters/extra_wallet_counter.cpp"), - Object(NonMatching, "toBeSorted/cc/d_cc_d.cpp"), - Object(NonMatching, "toBeSorted/cc/d_cc_m3d.cpp"), - Object(NonMatching, "toBeSorted/cc/d_cc_m3d_g_cyl.cpp"), - Object(NonMatching, "toBeSorted/cc/d_cc_m3d_g_sph.cpp"), - Object(Matching, "toBeSorted/cc/d_cc_shape_colliders.cpp"), Object(NonMatching, "d/lyt/d_structd.cpp"), Object(NonMatching, "d/lyt/d2d.cpp"), Object(NonMatching, "d/lyt/d_textbox.cpp"), @@ -387,6 +382,53 @@ config.libs = [ Object(Matching, "DynamicLink.cpp"), ], }, + { + "lib": "collision", + "mw_version": "Wii/1.5", + "cflags": cflags_framework + ["-str reuse,readonly"], + "progress_category": "game", + "host": False, + "objects": [ + Object(Matching, "d/col/c/c_bg_s_chk.cpp"), + Object(Matching, "d/col/c/c_bg_s_gnd_chk.cpp"), + Object(Matching, "d/col/c/c_bg_s_lin_chk.cpp"), + Object(Matching, "d/col/c/c_bg_s_poly_info.cpp"), + Object(NonMatching, "d/col/c/c_bg_s_shdw_draw.cpp"), + Object(Matching, "d/col/c/c_bg_w.cpp"), + Object(NonMatching, "d/col/c/c_cc_d.cpp"), + Object(NonMatching, "d/col/c/c_m2d.cpp"), + Object(NonMatching, "d/col/c/c_m3d.cpp"), + Object(Matching, "d/col/c/c_m3d_g_aab.cpp"), + Object(NonMatching, "d/col/c/c_m3d_g_cir.cpp"), + Object(Matching, "d/col/c/c_m3d_g_cps.cpp"), + Object(Matching, "d/col/c/c_m3d_g_cyl.cpp"), + Object(Matching, "d/col/c/c_m3d_g_lin.cpp"), + Object(NonMatching, "d/col/c/c_m3d_g_pla.cpp"), + Object(Matching, "d/col/c/c_m3d_g_sph.cpp"), + Object(Matching, "d/col/c/c_m3d_g_tri.cpp"), + Object(Matching, "d/col/c/c_m3d_g_unk.cpp"), + Object(NonMatching, "d/col/c/c_partition.cpp"), + Object(Matching, "d/col/bg/d_bg_pc.cpp"), + Object(Matching, "d/col/bg/d_bg_plc.cpp"), + Object(NonMatching, "d/col/bg/d_bg_s.cpp"), + Object(NonMatching, "d/col/bg/d_bg_s_acch.cpp"), + Object(Matching, "d/col/bg/d_bg_s_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_gnd_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_grp_pass_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_lin_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_poly_pass_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_roof_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_sph_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_spl_grp_chk.cpp"), + Object(Matching, "d/col/bg/d_bg_s_wtr_chk.cpp"), + Object(NonMatching, "d/col/bg/d_bg_w.cpp"), + Object(Matching, "d/col/bg/d_bg_w_base.cpp"), + Object(NonMatching, "d/col/bg/d_bg_w_kcol.cpp"), + Object(Matching, "d/col/bg/d_bg_w_sv.cpp"), + Object(NonMatching, "d/col/bg/d_bg_w_time.cpp"), + Object(Matching, "d/col/cc/d_cc_shape_colliders.cpp"), + ], + }, { "lib": "clib", "mw_version": "Wii/1.6", diff --git a/include/d/a/d_a_base.h b/include/d/a/d_a_base.h index 52a15a81..043f5205 100644 --- a/include/d/a/d_a_base.h +++ b/include/d/a/d_a_base.h @@ -22,8 +22,7 @@ struct SoundInfo { dAcBase_c *actor; SoundSource *sound_source; mVec3_c *obj_pos; - SoundInfo *next; - SoundInfo *prev; + TListNode mLink; }; /** @@ -59,6 +58,9 @@ public: T *get() { return static_cast(p_owner); } + const T *get() const { + return static_cast(p_owner); + } }; // Ghidra: ActorBase @@ -68,7 +70,7 @@ class dAcBase_c : public dBase_c { public: /* 0x68 */ mHeapAllocator_c heap_allocator; /* 0x84 */ ObjInfo *obj_info; - /* 0x88 */ TList sound_list; + /* 0x88 */ TList sound_list; /* 0x94 */ SoundSource *sound_source; /* 0x98 */ mVec3_c *obj_pos; /* 0x9C */ mVec3_c pos_copy; @@ -80,7 +82,7 @@ public: /* 0xB6 */ u8 subtype; /* 0xB8 */ mAng3_c rotation; /* 0xC0 */ mVec3_c position; - /* 0xCC */ mVec3_c scale; + /* 0xCC */ mVec3_c mScale; /* 0xD8 */ u32 actor_properties; /* 0xDC */ dAcRef_c actor_node; /* 0xE8 */ u32 field_0xe8; @@ -118,7 +120,7 @@ public: position = r; } void SetScale(const mVec3_c &r) { - scale = r; + mScale = r; } void SetRotation(const mAng3_c &r) { rotation = r; @@ -127,13 +129,17 @@ public: void copyPosition() { pos_copy = position; } - - const mVec3_c &GetPostion() const { - return position; - } void copyRotation() { rot_copy = rotation; } + + mVec3_c &GetPostion() { + return position; + } + mAng3_c &GetRotation() { + return rotation; + } + mVec3_c GetPostionDifference(const dAcBase_c &other) { return position - other.position; } @@ -151,10 +157,16 @@ public: return roomid; } + bool ChkProperty_0x40000000() const { + return actor_properties & 0x40000000; + } + public: // funcs found in TU - /* 8002c650 */ static void setTempCreateParams(mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, - dAcBase_c *parent, u8 subtype, s16 unkFlag, u8 viewClipIdx, ObjInfo *objInfo); + /* 8002c650 */ static void setTempCreateParams( + mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, s16 unkFlag, + u8 viewClipIdx, ObjInfo *objInfo + ); /* 8002c690 */ SoundSource *FUN_8002c690(); /* 8002c710 */ int initAllocatorWork1Heap(int size, char *name, int align); @@ -177,11 +189,13 @@ public: // returns true if under the distThresh, False if not. the actual distance is returned in outDist /* 8002d1d0 */ bool getDistanceToActor(dAcBase_c *actor, f32 distThresh, f32 *outDist); // same concept as above - /* 8002d290 */ bool getDistanceAndAngleToActor(dAcBase_c *actor, f32 distThresh, s16 yAngle, s16 xAngle, - f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX); + /* 8002d290 */ bool getDistanceAndAngleToActor( + dAcBase_c *actor, f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX + ); /* 8002d3e0 */ bool isWithinPlayerRadius(f32 radius) const; - /* 8002d440 */ bool getDistanceAndAngleToPlayer(f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, - s16 *outDiffAngleY, s16 *outDiffAngleX); + /* 8002d440 */ bool getDistanceAndAngleToPlayer( + f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX + ); /* 8002d470 */ f32 getDistToPlayer(); /* 8002d4a0 */ f32 getSquareDistToPlayer(); /* 8002d4b0 */ void updateRoomId(f32 yOffs); @@ -213,11 +227,15 @@ public: /* 8002d940 */ void changeLoadedEntitiesWithSet(); /* 8002d960 */ void changeLoadedEntitiesNoSet(); - /* 8002d980 */ dAcBase_c *createActor(ProfileName actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, - u32 params2, s32 roomId, dBase_c *ref); + /* 8002d980 */ dAcBase_c *createActor( + ProfileName actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, s32 roomId, + dBase_c *ref + ); - /* 8002da80 */ dAcBase_c *createActorStage(ProfileName actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, - mVec3_c *scale, u32 params2, s32 roomId, dBase_c *ref); + /* 8002da80 */ dAcBase_c *createActorStage( + ProfileName actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, s32 roomId, + dBase_c *ref + ); /* 8002dc20 */ void FUN_8002dc20(s16 *, s16 *); /* 8002dc50 */ void incrementKillCounter(); diff --git a/include/d/a/d_a_bomb.h b/include/d/a/d_a_bomb.h new file mode 100644 index 00000000..95b91897 --- /dev/null +++ b/include/d/a/d_a_bomb.h @@ -0,0 +1,50 @@ +#ifndef D_A_BOMB_H +#define D_A_BOMB_H + +#include "d/a/obj/d_a_obj_base.h" + +#include +#include +#include +#include +#include +#include +#include + +class dAcBomb_c : public dAcObjBase_c { +public: + dAcBomb_c(); + virtual ~dAcBomb_c(); + + /* vt 0x08 */ virtual int create() override; + /* vt 0x14 */ virtual int doDelete() override; + /* vt 0x2C */ virtual int draw() override; + /* vt 0x44 */ virtual bool createHeap() override; + /* vt 0x54 */ virtual int actorExecute() override; + /* vt 0x5C */ virtual void unkVirtFunc_0x5C() override; + /* vt 0x68 */ virtual void *getCurrentEventActor() override; + /* vt 0x6C */ virtual void unkVirtFunc_0x6C() override; + + STATE_FUNC_DECLARE(dAcBomb_c, Wait); + STATE_FUNC_DECLARE(dAcBomb_c, FlowerWait); + STATE_FUNC_DECLARE(dAcBomb_c, Explode); + STATE_FUNC_DECLARE(dAcBomb_c, Carry); + STATE_FUNC_DECLARE(dAcBomb_c, WindCarry); + +private: + /* 0x330 */ nw4r::g3d::ResFile mBrres; + /* 0x334 */ m3d::smdl_c mMdl; + /* 0x350 */ u8 _0[0x358 - 0x350]; + /* 0x358 */ dBgS_BombAcch mAcch; + /* 0x708 */ dBgS_AcchCir mAcchCir; + /* 0x764 */ dCcD_Sph mCcDSph; + /* 0x8B4 */ mMtx_c mMtx; + /* 0x8E4 */ dBgS_BombLinChk mLinChk; + /* 0x97C */ u8 _1[0x9D4 - 0x97C]; + /* 0x9D4 */ EffectsStruct mEffect1; + /* 0xA08 */ EffectsStruct mEffect2; + /* 0xA3C */ u8 _2[0xA9C - 0xA3C]; + /* 0xA9C */ STATE_MGR_DECLARE(dAcBomb_c); +}; + +#endif diff --git a/include/d/a/d_a_player.h b/include/d/a/d_a_player.h index 719ebe4c..cc81aa3a 100644 --- a/include/d/a/d_a_player.h +++ b/include/d/a/d_a_player.h @@ -1,7 +1,49 @@ #include class dAcPy_c : public dAcObjBase_c { + // See Below for some info + // https://github.com/lepelog/skywardsword-tools/wiki/Player-Actor public: + // These Flags are named under general guesses. Very likely may need some changes + // Correspond to mActionFlags + enum dAcPy_FLG0 { + FLG0_ON_FOOT = 0x80000000, + FLG0_USE_ITEM_0 = 0x40000000, + FLG0_USE_ITEM_1 = 0x20000000, + FLG0_UNK_GEN_MOVE = 0x10000000, + FLG0_ATTACK_MOVE = 0x8000000, + FLG0_USE_ITEM_2 = 0x4000000, + FLG0_RECOVER_ELEC = 0x2000000, + FLG0_CRAWLING = 0x1000000, + FLG0_TIGHT_ROPE = 0x800000, + FLG0_SWING_ROPE = 0x400000, + FLG0_PUSHPULL = 0x200000, + FLG0_UNK_100000 = 0x100000, + FLG0_UNK_80000 = 0x80000, + FLG0_IN_WATER = 0x40000, + FLG0_ON_LADDDER = 0x20000, + FLG0_ON_VINES = 0x10000, + FLG0_UNK_0x8000 = 0x8000, + FLG0_UNK_0x4000 = 0x4000, + FLG0_INTERATION = 0x2000, + FLG0_BASIC_ACTION = 0x1000, + FLG0_HANGING_ITEM = 0x800, + FLG0_EXTERN_CONTROL = 0x400, + FLG0_ATTACK_RELATED = 0x200, + FLG0_UNK_0x100 = 0x100, + FLG0_UNK_0x80 = 0x80, + FLG0_HANGING_LEDGE = 0x40, + FLG0_UNK_0x20 = 0x20, + FLG0_UNK_0x10 = 0x10, + FLG0_DAMAGED = 0x8, + FLG0_UNK_0x4 = 0x4, + FLG0_IN_AIR = 0x2, + FLG0_STATIONARY = 0x1, + + FLG0_FLY = FLG0_TIGHT_ROPE | FLG0_SWING_ROPE | FLG0_IN_WATER | FLG0_ON_LADDDER | FLG0_ON_VINES | + FLG0_HANGING_ITEM | FLG0_HANGING_LEDGE | FLG0_UNK_0x10 | FLG0_IN_AIR, + }; + dAcPy_c(); virtual ~dAcPy_c(); @@ -190,5 +232,9 @@ public: return (someFlags_0x350 & mask) != 0; } + bool CheckPlayerFly() const { + return mActionFlags & FLG0_FLY; + } + static dAcPy_c *LINK; }; diff --git a/include/d/a/d_a_t_wood_area.h b/include/d/a/d_a_t_wood_area.h index baad4400..5f07ceef 100644 --- a/include/d/a/d_a_t_wood_area.h +++ b/include/d/a/d_a_t_wood_area.h @@ -24,13 +24,13 @@ public: bool attachObject(dAcObjBase_c *obj); f32 getAttachRadius() { - return scale.x * scaleX; + return mScale.x * scaleX; } f32 getAttachRadiusSquare() { return getAttachRadius() * getAttachRadius(); } f32 getAttachHeight() { - return scale.y * scaleY; + return mScale.y * scaleY; } static const f32 scaleX; diff --git a/include/d/a/obj/d_a_obj_appear_bridge.h b/include/d/a/obj/d_a_obj_appear_bridge.h index 388929d6..f48819a6 100644 --- a/include/d/a/obj/d_a_obj_appear_bridge.h +++ b/include/d/a/obj/d_a_obj_appear_bridge.h @@ -2,12 +2,12 @@ #define D_A_OBJ_APPEAR_BRIDGE_H #include +#include #include #include #include #include #include -#include #include #include @@ -32,7 +32,7 @@ private: m3d::smdl_c mModel; m3d::anmTexSrt_c mSrtAnm; m3d::anmMatClr_c mClrAnm; - ActorCollision mCollision; + dBgW mCollision; STATE_MGR_DECLARE(dAcOappearBridge_c); ActorEventRelated mActorEvent; diff --git a/include/d/a/obj/d_a_obj_bamboo_island.h b/include/d/a/obj/d_a_obj_bamboo_island.h index 9c93ec35..2d85e099 100644 --- a/include/d/a/obj/d_a_obj_bamboo_island.h +++ b/include/d/a/obj/d_a_obj_bamboo_island.h @@ -2,8 +2,8 @@ #define D_A_OBJ_BAMBOO_ISLAND_H #include +#include #include -#include class dAcObambooIsland_c : public dAcObjBase_c { public: @@ -19,11 +19,11 @@ private: static const f32 unusedFloat1; static const f32 unusedFloat2; - static void interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *interactor); + static void rideCallback(dBgW *unknown, dAcObjBase_c *actor, dAcObjBase_c *interactor); m3d::smdl_c mModels[2]; nw4r::g3d::ResFile mBrres; - ActorCollision mCollision; + dBgW mCollision; }; #endif diff --git a/include/d/a/obj/d_a_obj_base.h b/include/d/a/obj/d_a_obj_base.h index 5f5d1298..857bcd09 100644 --- a/include/d/a/obj/d_a_obj_base.h +++ b/include/d/a/obj/d_a_obj_base.h @@ -2,14 +2,14 @@ #define D_A_OBJ_BASE_H #include "d/a/d_a_base.h" +#include "d/col/cc/d_cc_d.h" +#include "m/m3d/m_shadow.h" +#include "m/m3d/m_smdl.h" #include "m/m_angle.h" #include "m/m_mtx.h" -#include "m/m3d/m_smdl.h" -#include "m/m3d/m_shadow.h" #include "m/m_vec.h" #include "m/types_m.h" #include "nw4r/g3d/g3d_resfile.h" -#include "toBeSorted/cc/d_cc_d.h" // Size: 0xA8 struct ActorCarryStruct { @@ -33,45 +33,61 @@ struct ActorCarryStruct { } }; +// Ghidra has it as `unk_ActorObjectBase` +struct LightingInfo { + /* 0x00 */ u8 mField_0x00[0x60 - 0x00]; + /* 0x60 */ u8 mLightingCode; + /* 0x61 */ u8 mField_0x61[0x70 - 0x61]; +}; + // Ghidra: ActorObjectBase // size: 0x330 // vtable: 0x805015b8 // non-official name class dAcObjBase_c : public dAcBase_c { public: - // Data Members - f32 yoffset; - char _0[4]; - f32 unkfloat; - char _1[12]; - u16 targetFiTextId; - u8 unkByteTargetFiRelated; - mVec3_c poscopy1; - mVec3_c poscopy2; - mVec3_c poscopy3; - mAng3_c rotcopy1; - f32 forwardSpeed; - f32 forwardAccel; - f32 forwardMaxSpeed; - mVec3_c velocity; - /* 0x15C */ mMtx_c worldMatrix; - nw4r::math::AABB boundingBox; + /* 0x0FC */ f32 yoffset; + /* 0x100 */ char _0[4]; + /* 0x104 */ f32 unkfloat; + /* 0x108 */ char _1[12]; + /* 0x114 */ u16 targetFiTextId; + /* 0x116 */ u8 unkByteTargetFiRelated; + /* 0x118 */ mVec3_c mOldPosition; + /* 0x124 */ mVec3_c poscopy2; + /* 0x130 */ mVec3_c poscopy3; + /* 0x13C */ mAng3_c angle; + /* 0x144 */ f32 forwardSpeed; + /* 0x148 */ f32 forwardAccel; + /* 0x14C */ f32 forwardMaxSpeed; + /* 0x150 */ mVec3_c velocity; + /* 0x15C */ mMtx_c mWorldMtx; + /* 0x18C */ nw4r::math::AABB boundingBox; /* 0x1A4 */ f32 mCullingDistance; /* 0x1A8 */ f32 field_0x1A8; /* 0x1AC */ u32 mObjectActorFlags; - u8 unk_0x1B0[0x1C0 - 0x1B0]; + /* 0x1B0 */ u8 unk_0x1B0[0x1C0 - 0x1B0]; /* 0x1C0 */ UnkCCDStruct mCCdStruct; - mVec3_c mStartingPos; - mAng3_c mStartingRot; - + /* 0x1FC */ mVec3_c mStartingPos; + /* 0x208 */ mAng3_c mStartingRot; /* 0x210 */ ActorCarryStruct mActorCarryInfo; - - u8 unk_0x1EC[0x330 - 0x2B8]; + /* 0x2B8 */ u32 mField_0x2B8; + /* 0x2BC */ LightingInfo mLightingInfo; + /* 0x32C */ u32 mField_0x32C; public: + mVec3_c &GetOldPosition() { + return mOldPosition; + } + mVec3_c &GetVelocity() { + return velocity; + } + mAng3_c &GetAngle() { + return angle; + } + // could be their own thing? /* 8002de40 */ static void *getOarcFile(const char *oarcName, const char *fileName); /* 8002de60 */ static void *getOarcSubEntry(const char *oarcName, const char *fileName); @@ -94,12 +110,16 @@ public: /* 8002ea20 */ virtual bool drop(); public: - /* 8002e630 */ static dAcObjBase_c *create(fProfile::PROFILE_NAME_e actorId, s8 roomId, u32 params1, mVec3_c *pos, - mAng3_c *rot, mVec3_c *scale, u32 params2); - /* 8002e6d0 */ static dAcObjBase_c *create(char *name, u32 roomId, u32 params1, mVec3_c *pos, mAng3_c *rot, - mVec3_c *scale, u32 params2, u16 id, s8 viewclipId); - /* 8002e770 */ static dAcObjBase_c *findObject(fProfile::PROFILE_NAME_e actorId, fLiNdBa_c *refList, - dAcObjBase_c *parent); + /* 8002e630 */ static dAcObjBase_c *create( + fProfile::PROFILE_NAME_e actorId, s8 roomId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, + u32 params2 + ); + /* 8002e6d0 */ static dAcObjBase_c *create( + char *name, u32 roomId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, u16 id, + s8 viewclipId + ); + /* 8002e770 */ static dAcObjBase_c * + findObject(fProfile::PROFILE_NAME_e actorId, fLiNdBa_c *refList, dAcObjBase_c *parent); /* 8002e7f0 */ static dAcObjBase_c *getNextObject(fLiNdBa_c *ref, dAcObjBase_c *parent); /* 8002e850 */ bool isPlayer(); /* 8002e870 */ void calcVelocity(mVec3_c &pos, f32 speed); @@ -115,23 +135,36 @@ public: // Disabling make Lava and other objects Disappear /* 8002ecd0 */ void drawModel2(); /* 8002ed20 */ void fn_8002ed20(); - /* 8002edb0 */ void fn_8002edb0(m3d::mShadowCircle_c& shadow, m3d::smdl_c& smdl, const mQuat_c *rot, s32, s32, f32); - /* 8002ee40 */ void drawShadow(m3d::mShadowCircle_c& shadow, void*, const mMtx_c &mtx, const mQuat_c *rot, s32, s32, s32, s32, s32, f32); - /* 8002ef40 */ void createChildAttached(fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, - mVec3_c *scale, u32 params2, u32 roomId); - /* 8002ef40 */ void createChildNonAttached(fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, - mAng3_c *rot, mVec3_c *scale, u32 params2, u32 roomId); + /* 8002edb0 */ void fn_8002edb0(m3d::mShadowCircle_c &shadow, m3d::smdl_c &smdl, const mQuat_c *rot, s32, s32, f32); + /* 8002ee40 */ void drawShadow( + m3d::mShadowCircle_c &shadow, void *, const mMtx_c &mtx, const mQuat_c *rot, s32, s32, s32, s32, s32, f32 + ); + /* 8002ef40 */ void createChildAttached( + fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, + u32 roomId + ); + /* 8002ef40 */ void createChildNonAttached( + fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, + u32 roomId + ); /* 8002efa0 */ void fn_8002efa0(); /* 8002eff0 */ bool fn_8002eff0(f32 *, s16 *, UnkCollider *, f32 *, f32 *); - /* 8002f190 */ void createChildAttached2(fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, - mVec3_c *scale, u32 params2, u32 roomId); + /* 8002f190 */ void createChildAttached2( + fProfile::PROFILE_NAME_e actorId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, + u32 roomId + ); // These may not belong here - /* 8002f1c0 */ static dAcBase_c *createActorUnkGroup3(fProfile::PROFILE_NAME_e actorId, u32 roomId, u32 params1, - mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2); - /* 8002f260 */ static dAcBase_c *createActorUnkGroup3(char *name, u32 roomId, u32 params1, mVec3_c *pos, - mAng3_c *rot, mVec3_c *scale, u32 params2, u16 id, u8 viewclipId); + /* 8002f1c0 */ static dAcBase_c *createActorUnkGroup3( + fProfile::PROFILE_NAME_e actorId, u32 roomId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, + u32 params2 + ); + /* 8002f260 */ static dAcBase_c *createActorUnkGroup3( + char *name, u32 roomId, u32 params1, mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, u32 params2, u16 id, + u8 viewclipId + ); protected: + // TODO May be cM3dGAab (has a very similar set func) inline void setBoundingBox(mVec3_c min, mVec3_c max) { boundingBox.min = min; boundingBox.max = max; @@ -139,8 +172,18 @@ protected: }; // Actors' createHeap functions often have patterns that can be matched with this macro -#define TRY_CREATE(thing) do { bool result = (thing); if (!result) return result; } while (0) +#define TRY_CREATE(thing) \ + do { \ + bool result = (thing); \ + if (!result) \ + return result; \ + } while (0) // Use this in actors' createHeap functions -#define CREATE_ALLOCATOR(className) do { if (!initAllocatorWork1Heap(-1, #className "::m_allocator", 0x20)) { return FAILED; } } while (0) +#define CREATE_ALLOCATOR(className) \ + do { \ + if (!initAllocatorWork1Heap(-1, #className "::m_allocator", 0x20)) { \ + return FAILED; \ + } \ + } while (0) #endif diff --git a/include/d/a/obj/d_a_obj_spike.h b/include/d/a/obj/d_a_obj_spike.h index 779e8501..8a81d4ea 100644 --- a/include/d/a/obj/d_a_obj_spike.h +++ b/include/d/a/obj/d_a_obj_spike.h @@ -2,13 +2,12 @@ #define D_A_O_SPIKE_H #include +#include #include #include #include #include #include -#include - class dAcOspike_c : public dAcObjBase_c { public: diff --git a/include/d/a/obj/d_a_obj_switch.h b/include/d/a/obj/d_a_obj_switch.h index 335517ec..66eae621 100644 --- a/include/d/a/obj/d_a_obj_switch.h +++ b/include/d/a/obj/d_a_obj_switch.h @@ -2,13 +2,12 @@ #define D_A_OBJ_SWITCH_H #include +#include #include #include #include -#include #include - // OBJ_VSD? class dAcOScatterSand_tmp : public dAcObjBase_c { public: @@ -18,7 +17,7 @@ public: /* 0x6E4 */ bool field_0x6E4; inline f32 getSomeScale() { - return scale.y * 41.65f / 100.0f; + return mScale.y * 41.65f / 100.0f; } }; @@ -62,11 +61,11 @@ public: STATE_FUNC_DECLARE(dAcOsw_c, Off); STATE_FUNC_DECLARE(dAcOsw_c, None); - static void interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *interactor); + static void rideCallback(dBgW *unknown, dAcObjBase_c *actor, dAcObjBase_c *interactor); private: /* 0x330 */ m3d::mdl_c mModel; - /* 0x354 */ ActorCollision mCollision; + /* 0x354 */ dBgW mCollision; /* 0x564 */ STATE_MGR_DECLARE(dAcOsw_c); /* 0x5A0 */ TimeAreaStruct field_0x5A0; /* 0x5AC */ dAcRef_c mObjRef; diff --git a/include/d/a/obj/d_a_obj_toD3_stone_figure.h b/include/d/a/obj/d_a_obj_toD3_stone_figure.h index efbeab47..75d3a126 100644 --- a/include/d/a/obj/d_a_obj_toD3_stone_figure.h +++ b/include/d/a/obj/d_a_obj_toD3_stone_figure.h @@ -3,12 +3,11 @@ #include #include +#include #include #include #include #include -#include - class dAcOtoD3StoneFigure_c : public dAcObjBase_c { public: diff --git a/include/d/a/obj/d_a_obj_triforce.h b/include/d/a/obj/d_a_obj_triforce.h index 2b036536..c582ee9d 100644 --- a/include/d/a/obj/d_a_obj_triforce.h +++ b/include/d/a/obj/d_a_obj_triforce.h @@ -3,11 +3,11 @@ #include #include +#include #include #include #include #include -#include #include class dAcOtriforce_c : public dAcObjBase_c { diff --git a/include/d/col/bg/d_bg_pc.h b/include/d/col/bg/d_bg_pc.h new file mode 100644 index 00000000..d5d9306b --- /dev/null +++ b/include/d/col/bg/d_bg_pc.h @@ -0,0 +1,156 @@ +#ifndef D_BG_PC_H +#define D_BG_PC_H + +#include + +struct sBgPc { // Size: 0x14 + /* 0x00 */ u32 code0; + /* 0x04 */ u32 code1; + /* 0x08 */ u32 code2; // Always 0xFFFF_FF00 + /* 0x0C */ u32 code3; // Only 0x0000_03FF used + /* 0x10 */ u32 code4; // Always 0x0000_0000 +}; + +enum dBgPc_ECode { + /* 0x00004000 */ CODE_OBJ_THRU = 0x4000, + /* 0x00008000 */ CODE_CAM_THRU = 0x8000, + /* 0x00010000 */ CODE_LINK_THRU = 0x10000, + /* 0x00020000 */ CODE_ARROW_THRU = 0x20000, + /* 0x00040000 */ CODE_SLINGSHOT_THRU = 0x40000, + /* 0x00080000 */ CODE_BEETLE_THRU = 0x80000, + /* 0x00100000 */ CODE_CLAWSHOT_THRU = 0x100000, + /* 0x00200000 */ CODE_TARGET_THRU = 0x200000, + /* 0x00400000 */ CODE_SHDW_THRU = 0x400000, + /* 0x00800000 */ CODE_BOMB_THRU = 0x800000, + /* 0x01000000 */ CODE_WHIP_THRU = 0x1000000, + /* 0x40000000 */ CODE_UNDERWATER_ROOF = 0x40000000, + /* 0x80000000 */ CODE_UNUSED_8000_0000 = 0x80000000, +}; + +class dBgPc { +public: + void setCode(sBgPc &); + bool getWtr() const; + + u32 getObjThrough() { + return m_code.code0 & CODE_OBJ_THRU; + } + u32 getCamThrough() { + return m_code.code0 & CODE_CAM_THRU; + } + u32 getLinkThrough() { + return m_code.code0 & CODE_LINK_THRU; + } + u32 getObjThrough() const { + return m_code.code0 & CODE_OBJ_THRU; + } + u32 getCamThrough() const { + return m_code.code0 & CODE_CAM_THRU; + } + u32 getLinkThrough() const { + return m_code.code0 & CODE_LINK_THRU; + } + u32 getArrowThrough() const { + return m_code.code0 & CODE_ARROW_THRU; + } + u32 getClawshotThrough() const { + return m_code.code0 & CODE_CLAWSHOT_THRU; + } + u32 getSlingshotThrough() const { + return m_code.code0 & CODE_SLINGSHOT_THRU; + } + u32 getBeetleThrough() const { + return m_code.code0 & CODE_BEETLE_THRU; + } + bool getTargetThrough() const { + return m_code.code0 & CODE_TARGET_THRU; + } + bool getShdwThrough() const { + return m_code.code0 & CODE_SHDW_THRU; + } + u32 getBombThrough() const { + return m_code.code0 & CODE_BOMB_THRU; + } + u32 getWhipThrough() const { + return m_code.code0 & CODE_WHIP_THRU; + } + u32 getUnderwaterRoof() const { + return m_code.code0 & CODE_UNDERWATER_ROOF; + } + bool getCode0_0x80000000() const { + return m_code.code0 & CODE_UNUSED_8000_0000; + } + + s32 getWallCode() const { + return m_code.code1 >> 0x8 & 0xF; + } + u32 getCode1_0x02000000() const { + return m_code.code1 & 0x02000000; + } + u32 getCode1_0x04000000() const { + return m_code.code1 & 0x04000000; + } + u32 getCode1_0x08000000() const { + return m_code.code1 & 0x08000000; + } + + u32 getGroundCode() const { + return m_code.code1 >> 20 & 0x1F; + } + u32 getLightingCode() const { + return m_code.code1 >> 28; + } + u32 getSpecialCode() const { + return m_code.code3 & 0x1F; + } + + u32 getAtt0Code() const { + return m_code.code3 >> 5 & 0x3F; + } + u32 getAtt1Code() const { + return m_code.code1 >> 17 & 0x7; + } + + u8 getGrpRoomIdx() const { + return m_code.code0 & 0x3F; + } + + u8 getExitId() const { + return m_code.code0 >> 6; + } + + u32 getCode0_0x30000000() const { + return m_code.code0 >> 0x1C & 3; + } + + u8 getLinkNo() const { + return m_code.code1; + } + + u8 getCamMoveBG() const { + return m_code.code2; + } + u8 getRoomCam() const { + return m_code.code2 >> 8; + } + u8 getRoomPath() const { + return m_code.code2 >> 0x10; + } + u8 getRoomPathPnt() const { + return m_code.code2 >> 0x18; + } + + u8 getRoomInf() const { + return m_code.code4; + } + u8 getSnd() const { + return m_code.code4 >> 0xB; + } + u32 maskNrm() { + return m_code.code4 & 0x100; + } + + /* 0x0 */ sBgPc m_code; +}; + +#endif diff --git a/include/d/col/bg/d_bg_plc.h b/include/d/col/bg/d_bg_plc.h new file mode 100644 index 00000000..c7e5d5fc --- /dev/null +++ b/include/d/col/bg/d_bg_plc.h @@ -0,0 +1,38 @@ +#ifndef D_BG_PLC_H +#define D_BG_PLC_H + +#include "d/col/bg/d_bg_pc.h" + +enum { + ZELDA_CODE_SIZE = 0x14 +}; + +struct PLC { + /* 0x0 */ u32 magic; + /* 0x4 */ u16 m_code_size; + /* 0x6 */ u16 m_num; + /* 0x8 */ sBgPc field_0x8[0]; +}; + +class dBgPlc { +public: + dBgPlc() : mBase(nullptr) {} + void setBase(void *); + + const sBgPc *getCode(int idx) const { + sBgPc *rv = mBase->field_0x8; + rv += idx; + return rv; + } + + const dBgPc *GetDBgPc(int idx) const { + return (const dBgPc *)getCode(idx); + } + + u32 getGrpCode(int idx) const; + +private: + /* 0x00 */ PLC *mBase; +}; + +#endif diff --git a/include/d/col/bg/d_bg_s.h b/include/d/col/bg/d_bg_s.h new file mode 100644 index 00000000..780e3832 --- /dev/null +++ b/include/d/col/bg/d_bg_s.h @@ -0,0 +1,281 @@ +#ifndef D_BG_S_H +#define D_BG_S_H + +#include "common.h" +#include "d/a/d_a_base.h" +#include "d/a/obj/d_a_obj_base.h" +#include "d/a/obj/d_a_obj_bg.h" +#include "d/col/bg/d_bg_w.h" +#include "d/col/bg/d_bg_w_base.h" +#include "d/col/bg/d_bg_w_kcol.h" +#include "egg/gfx/eggCpuTexture.h" +#include "toBeSorted/tlist.h" + +class dBgW; + +class cBgS_ChkElm { +public: + /* 0x00 */ dBgW_Base *mpBgW; + /* 0x04 */ dAcRef_c mObj; + /* 0x10 vtable */ + +public: + cBgS_ChkElm(); + virtual ~cBgS_ChkElm(); + void Init(); + void Release(); + + void Regist2(dBgW_Base *, dAcObjBase_c *); + + bool ChkUsed() const { + if (mpBgW == nullptr) { + return false; + } + const dAcObjBase_c *pObj = mObj.get(); + return !(pObj && pObj->ChkProperty_0x40000000()); + } + + // ??? Template seems bad + template + bool CheckAll(const T *other) const { + bool check = ChkUsed(); + if (check) { + const cPartition &part = mpBgW->GetPartition(); + if ((part.mX & other->mPartition.mX) && (part.mZ & other->mPartition.mZ) && + (part.mY & other->mPartition.mY)) { + check = true; + } else { + check = false; + } + } + if (check) { + check = !other->ChkSameActorPid(mObj.get()); + } + if (check) { + check = !(other->mField_0x0C & mpBgW->GetField_0x20()); + } + if (check) { + check = (other->mField_0x0E & mpBgW->GetField_0x22()); + } + return check; + } +}; + +class cBgS { +public: + /* 0x0000 */ cBgS_ChkElm mChkElem[BG_ID_MAX]; + /* 0x2EE0 */ s32 mSetCounter; + /* 0x2EE4 vtable */ + virtual ~cBgS(); + virtual void Ct(); + virtual void Dt(); + + /* 0x2EE8 */ dBgWKCol *mpBgKCol; + /* 0x2EEC */ dAcRef_c mAcOBg; + +public: + cBgS(); + static void fn_80339de0(dBgW_Base *); + bool Regist(dBgW_Base *, dAcObjBase_c *); + bool Release(dBgW_Base *); + static void ConvDzb(void *); + bool LineCross(cBgS_LinChk *); + f32 GroundCross(cBgS_GndChk *); + void ShdwDraw(cBgS_ShdwDraw *); + void fn_8033a1e0(); + bool RegistKCol(dBgWKCol *, dAcObg_c *); + bool ReleaseKCol(dBgWKCol *); + + const dAcObjBase_c *GetActorPointer(int) const; + dBgW_Base *GetBgWBasePointer(cBgS_PolyInfo const &) const; + bool ChkPolySafe(cBgS_PolyInfo const &) const; + s32 GetGrpRoomId(cBgS_PolyInfo const &) const; + bool GetTriPla(cBgS_PolyInfo const &, cM3dGPla *) const; + bool GetTriPnt(cBgS_PolyInfo const &, mVec3_c *, mVec3_c *, mVec3_c *) const; + u32 GetGrpInf(cBgS_PolyInfo const &) const; + + const dAcObjBase_c *GetActorPointer(const cBgS_PolyInfo &info) const; + +}; // Size: 0x2EFC + +class dBgS_Acch; + +u8 dKy_pol_sound_get(cBgS_PolyInfo const *param_0); + +struct dMapGradation { + dMapGradation() + : mHasDifferingGrad(false), mGradHigh(0.0f), mGradLow(0.0f), mHasGradation(false), mColorR(0), mColorG(0), + mColorB(0), mColorA(0) {} + /* 0x00 */ bool mHasDifferingGrad; + /* 0x04 */ f32 mGradHigh; + /* 0x08 */ f32 mGradLow; + /* 0x0C */ bool mHasGradation; + /* 0x0D */ u8 mColorR; + /* 0x0E */ u8 mColorG; + /* 0x0F */ u8 mColorB; + /* 0x10 */ u8 mColorA; +}; + +struct MapSrollText_t { + /* 0x00 */ u8 _0[0x0E - 0x00]; + /* 0x0E */ s16 mField_0x0E; + /* 0x10 */ s16 mField_0x10; + /* 0x12 */ u8 _1[0x1C - 0x12]; +}; + +struct MapLineSegment { + MapLineSegment(); + virtual ~MapLineSegment(); + virtual void Draw(int, mMtx_c *, bool, int); + + void fn_8033e9a0(); + void Dt(); + void fn_8033e9c0(); + void Append(); + void Remove(); + + /* 0x4 */ bool bShow; + /* 0x8 */ TListNode mLink; +}; + +class dBgS : public cBgS { +private: + static dBgS *spInstance; + static const void *spSolidMatTex[31]; + static const void *spScrollMapTex[5]; + typedef TList MapLineList; + +public: + /* 0x2EF8 */ EGG::CpuTexture *mMapTexture; + /* 0x2EFC */ dBgW_Base *mColllisionTbl[BG_ID_MAX]; + /* 0x385C */ s32 mColllisionTblLen; + /* 0x3860 */ bool mInSkyKeep; + /* 0x3864 */ s32 mField_0x3864[5]; + /* 0x3878 */ s32 mField_0x3878[5]; + /* 0x388C */ MapLineList mList_0x388C; + /* 0x3894 */ dMapGradation mMapGradation; + + dBgS(); + ~dBgS(); + void Ct(); + void Dt(); + void ClrMoveFlag(); + void Move(); + void Regist(dBgW_Base *, int); + static dBgS *GetInstance(); + bool Regist(dBgW_Base *, dAcObjBase_c *); // Registers Actor to Bg + bool RegistBg(dBgW_Base *, dAcObjBase_c *); // Registers Bg + bool UnRegist(dBgW_Base *); + bool ChkMoveBG(cBgS_PolyInfo const &, bool); + u32 ChkShadowThrough(cBgS_PolyInfo const &); + int GetSpecialCode(cBgS_PolyInfo const &); + s32 GetWallCode(cBgS_PolyInfo const &); + // s32 GetExitId(cBgS_PolyInfo const &); + static int GetMapCode(int, int, bool); + int GetPolyMaterial(cBgS_PolyInfo const &); + int GetPolyAtt0(cBgS_PolyInfo const &); + int GetPolyAtt1(cBgS_PolyInfo const &); + int GetLightingCode(cBgS_PolyInfo const &); + int GetGroundCode(cBgS_PolyInfo const &); + int GetCode1_0x02000000(cBgS_PolyInfo const &); + s32 GetRoomCamId(cBgS_PolyInfo const &); + s32 GetRoomId(cBgS_PolyInfo const &); + + bool GetPolyObjectThrough(cBgS_PolyInfo const &); + bool GetPolyCameraThrough(cBgS_PolyInfo const &); + bool GetPolyShadowThrough(cBgS_PolyInfo const &); + bool GetPolyLinkThrough(cBgS_PolyInfo const &); + bool GetPolyArrowThrough(cBgS_PolyInfo const &); + bool GetPolyBombThrough(cBgS_PolyInfo const &); + bool GetPolyBeetleThrough(cBgS_PolyInfo const &); + bool GetPolyClawshotThrough(cBgS_PolyInfo const &); + bool GetPolyThrough_Code1_0x04000000(cBgS_PolyInfo const &); + bool GetPolyThrough_Code1_0x08000000(cBgS_PolyInfo const &); + bool GetPolyWhipThrough(cBgS_PolyInfo const &); + bool GetPolySlingshotThrough(cBgS_PolyInfo const &); + + void WallCorrect(dBgS_Acch *, bool); + f32 RoofChk(dBgS_RoofChk *); + bool SplGrpChk(dBgS_SplGrpChk *); + bool SphChk(dBgS_SphChk *, void *); + // void MoveBgCrrPos( + // cBgS_PolyInfo const &, bool param_1, mVec3_c *i_pos, mAng3_c *i_angle, mAng3_c *i_shapeAngle, + // bool param_5, bool param_6 + // ); + // MoveBgTransPos(cBgS_PolyInfo const &i_poly, bool param_1, mVec3_c *i_pos, mAng3_c *i_angle, mAng3_c + // *i_shapeAngle) + + // u32 GetUnderwaterRoofCode(cBgS_PolyInfo const &); + // s32 GetCamMoveBG(cBgS_PolyInfo const &); + // s32 GetRoomPathId(cBgS_PolyInfo const &); + // s32 GetRoomPathPntNo(cBgS_PolyInfo const &); + // int GetGrpSoundId(cBgS_PolyInfo const &); + // u32 ChkGrpInf(cBgS_PolyInfo const &, u32); + // bool GetPolyAttackThrough(cBgS_PolyInfo const &); + // u32 ChkPolyHSStick(cBgS_PolyInfo const &); + // void WallCorrectSort(dBgS_Acch *); + // void MoveBgMatrixCrrPos(cBgS_PolyInfo const &, bool, mVec3_c *, mAng3_c *, mAng3_c *); + + void MoveBgCrrPos(cBgS_PolyInfo const &, bool, mVec3_c *, mAng3_c *, mAng3_c *, bool, bool); + void MoveBgTransPos(cBgS_PolyInfo const &, bool, mVec3_c *, mAng3_c *, mAng3_c *); + + void RideCallBack(cBgS_PolyInfo const &, dAcObjBase_c *); + void ArrowStickCallBack(cBgS_PolyInfo const &, dAcObjBase_c *, mVec3_c &); + bool UnkCallback(cBgS_PolyInfo const &, dAcObjBase_c *); + dAcObjBase_c *PushPullCallBack(cBgS_PolyInfo const &, dAcObjBase_c *, dBgW_Base::PushPullLabel); + + void UpdateScrollTex(); + void SetupMapGX(mMtx_c *); + void SetupMapMaterial(int matIdx, bool, s32 roomId); + UNKTYPE *GetMapAccessor(); + void DrawMap(u8 roomId, mMtx_c *, bool bColor, int); + void SetupScrollGX(); + void SetupScrollMaterial(int matIdx, s32, bool); + void DrawMapScroll(u8 roomId, mMtx_c *, bool bColor, int); + void DrawSkyKeepMap(mMtx_c *, int); + bool ConfigureMapTexture(EGG::Heap *); + + void InitMapParts(); + void AppendMapSegment(MapLineSegment *); + void RemoveMapSegment(MapLineSegment *); + void DrawMapSegments(int, mMtx_c *, bool, int); + void ClearMapSegments(); + + void SetLightingCode(dAcObjBase_c *, const cBgS_PolyInfo &); + f32 SetLightingCode(dAcObjBase_c *, f32); + int GetLightingCode(const mVec3_c *); + bool GetPolyPreventObjOnly(const cBgS_PolyInfo &); + bool GetMapGradationColor(GXColor *); + + bool WaterChk(dBgS_SplGrpChk *chk) { + return SplGrpChk(chk); + } +}; + +void dBgS_MoveBGProc_Trans( + dBgW *i_bgw, void *i_actor_ptr, cBgS_PolyInfo const &i_poly, bool param_3, mVec3_c *i_pos, mAng3_c *i_angle, + mAng3_c *i_shapeAngle +); + +void dBgS_MoveBGProc_Typical( + dBgW *param_0, void *param_1, cBgS_PolyInfo const ¶m_2, bool param_3, mVec3_c *param_4, mAng3_c *param_5, + mAng3_c *param_6 +); + +void dBgS_MoveBGProc_RotY( + dBgW *param_0, void *param_1, cBgS_PolyInfo const ¶m_2, bool param_3, mVec3_c *param_4, mAng3_c *param_5, + mAng3_c *param_6 +); + +void dBgS_MoveBGProc_TypicalRotY( + dBgW *param_0, void *param_1, cBgS_PolyInfo const ¶m_2, bool param_3, mVec3_c *param_4, mAng3_c *param_5, + mAng3_c *param_6 +); + +bool dBgS_CheckBWallPoly(cBgS_PolyInfo const &); +bool dBgS_CheckBGroundPoly(cBgS_PolyInfo const &); +bool dBgS_CheckBRoofPoly(cBgS_PolyInfo const &); +f32 dBgS_GetNY(cBgS_PolyInfo const &poly); +mVec3_c dBgS_GetN(cBgS_PolyInfo const &); + +#endif /* D_BG_D_BG_S_H */ diff --git a/include/d/col/bg/d_bg_s_acch.h b/include/d/col/bg/d_bg_s_acch.h new file mode 100644 index 00000000..15b6325d --- /dev/null +++ b/include/d/col/bg/d_bg_s_acch.h @@ -0,0 +1,553 @@ +#ifndef D_BG_S_ACCH_H +#define D_BG_S_ACCH_H + +#include "d/a/obj/d_a_obj_base.h" +#include "d/col/bg/d_bg_s_gnd_chk.h" +#include "d/col/bg/d_bg_s_roof_chk.h" +#include "d/col/bg/d_bg_s_sph_chk.h" +#include "d/col/bg/d_bg_s_wtr_chk.h" +#include "d/col/c/c_m3d_g_cir.h" +#include "d/col/c/c_m3d_g_cyl.h" +#include "d/col/c/c_m3d_g_lin.h" +#include "d/col/c/c_m3d_g_pla.h" + +class dBgS_AcchCir : public cBgS_PolyInfo { +private: + /* 0x2C */ cM3dGCir m_cir; + /* 0x40 */ f32 mWallRR; + /* 0x44 */ f32 mField_0x44; + /* 0x48 */ f32 mWallH; + /* 0x4C */ f32 mWallR; + /* 0x50 */ f32 mWallHDirect; + /* 0x54 */ s16 mWallAngleY; + /* 0x56 */ u8 mFlags; + +public: + enum { + /* 0x02 */ WALL_HIT = 2, + /* 0x04 */ WALL_H_DIRECT = 4, + /* 0x08 */ UNK_0x8 = 8, + /* 0x10 */ UNK_0x10 = 0x10, + }; + + dBgS_AcchCir(); + virtual ~dBgS_AcchCir(); + + bool ChkWallHit() const; + + void ClrWallHit() { + mFlags &= ~WALL_HIT; + } + + void SetWallR(f32); + void CalcWallRR(); + void SetWall(f32, f32); + void SetWallHDirect(f32 f) { + mFlags |= WALL_H_DIRECT; + mWallHDirect = f; + } + + f32 GetWallH() { + return mWallH; + } + f32 GetWallR() { + return mWallR; + } + void SetWallH(f32 h) { + mWallH = h; + } + void ClrWallHDirect() { + mFlags &= ~WALL_H_DIRECT; + } + // bool ChkWallHit() { + // return mFlags & WALL_HIT; + // } + bool ChkUnk0x8() { + return mFlags & UNK_0x8; + } + bool ChkUnk0x10() { + return mFlags & UNK_0x10; + } + s16 GetWallAngleY() { + return mWallAngleY; + } + bool ChkWallHDirect() { + return mFlags & WALL_H_DIRECT; + } + f32 GetWallHDirect() { + return mWallHDirect; + } + f32 GetWallRR() { + return mWallRR; + } + void SetWallHit() { + mFlags |= WALL_HIT; + } + void SetUnk0x8() { + mFlags |= UNK_0x8; + } + void SetUnk0x10() { + mFlags |= UNK_0x10; + } + void SetWallAngleY(s16 i_angle) { + mWallAngleY = i_angle; + } + cM3dGCir *GetCirP() { + return &m_cir; + } + + void SetCir(mVec3_c &pos) { + m_cir.Set(pos.x, pos.z, pos.y + GetWallH(), mWallR); + } +}; + +// TODO: Needs to be relocated when Known +struct dBgS_Acch_0x1A8 { + u8 mField_0x00; + mVec3_c mField_0x04; + mVec3_c mField_0x10; + + dBgS_Acch_0x1A8(); + + void Init(); + void CalcPos(mVec3_c *); +}; + +class dBgS; +class dBgS_Acch : public cBgS_Chk, public dBgS_Chk { +public: + enum { + /* 0x 0000 0001 */ ACCH_FLAG_0x1 = (1 << 0), + /* 0x 0000 0002 */ GRND_NONE = (1 << 1), + /* 0x 0000 0004 */ WALL_NONE = (1 << 2), + /* 0x 0000 0008 */ ROOF_NONE = (1 << 3), + /* 0x 0000 0010 */ WALL_HIT = (1 << 4), + /* 0x 0000 0020 */ GROUND_HIT = (1 << 5), + /* 0x 0000 0040 */ GROUND_FIND = (1 << 6), + /* 0x 0000 0080 */ GROUND_LANDING = (1 << 7), + /* 0x 0000 0100 */ GROUND_AWAY = (1 << 8), + /* 0x 0000 0200 */ ROOF_HIT = (1 << 9), + /* 0x 0000 0400 */ WATER_NONE = (1 << 10), + /* 0x 0000 0800 */ WATER_HIT = (1 << 11), + /* 0x 0000 1000 */ WATER_IN = (1 << 12), + /* 0x 0000 2000 */ LINE_CHECK = (1 << 13), + /* 0x 0000 4000 */ LINE_CHECK_NONE = (1 << 14), + /* 0x 0000 8000 */ CLR_SPEED_Y = (1 << 15), + /* 0x 0001 0000 */ LINE_CHECK_HIT = (1 << 16), + /* 0x 0002 0000 */ ACCH_FLAG_0x20000 = (1 << 17), + /* 0x 0010 0000 */ MOVE_BG_ONLY = (1 << 20), + /* 0x 0020 0000 */ GND_THIN_CELLING_OFF = (1 << 21), + /* 0x 0040 0000 */ WALL_SORT = (1 << 22), + /* 0x 0080 0000 */ LINE_DOWN = (1 << 23), + + /* 0x 0200 0000 */ ACCH_FLAG_0x2000000 = (1 << 25), + /* 0x 0400 0000 */ ACCH_FLAG_0x4000000 = (1 << 26), + /* 0x 0800 0000 */ ACCH_FLAG_0x8000000 = (1 << 27), + /* 0x 1000 0000 */ ACCH_FLAG_0x10000000 = (1 << 28), + /* 0x 2000 0000 */ ACCH_FLAG_0x20000000 = (1 << 29), + /* 0x 8000 0000 */ ACCH_FLAG_0x80000000 = (1 << 31), + }; + + dBgS_Acch(); + + void Init() { + mField_0x394 = 0; + ClrGroundAway(); + ClrWallHit(); + ClrGroundLanding(); + i_ClrGroundHit(); + int i = 0; + do { + mpAcchCir[i].ClrWallHit(); + mpAcchCir[i].ClearPi(); + mpAcchCir[i].ClrWallHDirect(); + ++i; + } while (i < mTblSize); + } + + void Set(mVec3_c *, mVec3_c *, dAcObjBase_c *, int, dBgS_AcchCir *, mVec3_c *, mAng3_c *, mAng3_c *); + void Set(dAcObjBase_c *, int, dBgS_AcchCir *); + bool fn_8033f5b0(mVec3_c *, mVec3_c *, f32); + void LineCheck(dBgS &); + void SphCheck(); + void GroundCheckInit(dBgS &) { + if (!(mFlags & GRND_NONE)) { + mGroundHeight = -1e9f; + mGnd.SetExtChk(*this); + + if (i_ChkGroundHit()) { + Set_0x4000000(); + } else { + Clr_0x4000000(); + } + } + } + void GroundCheck(dBgS &, bool); + void RoofCheck(dBgS &); + void GroundRoofProc(dBgS &, bool); + void CrrPos(dBgS &); + f32 GetWallAllR(); + void SetWallCir(); + void CalcWallBmdCyl(); + void SetGroundUpY(f32); + + bool fn_80340ca0(cBgS_PolyInfo &info) const; + void Draw(dBgS &); // Name Assumed, no info + + void SetMoveBGOnly(); + void ClrMoveBGOnly(); + + bool ChkGndHit() const; + bool ChkRoofHit() const; + bool ChkWallHit(int *) const; + + void SetGndThinCellingOff(); + void ClrGndThinCellingOff(); + void Set_0x2000000(); + void Clr_0x2000000(); + void OnWallSort(); + dBgS_AcchCir &GetCir(int idx); + void fn_80340f70(const mVec3_c *); + void fn_80341000(); + + f32 GetWallAllLowH(); // is inline + f32 GetWallAllLowH_R(); // is inline + f32 GetWallAddY(Vec &); + void SetNowActorInfo(int, void *, unsigned int); + void SetWallPolyIndex(int, int); + void CalcMovePosWork(); + void CalcWallRR(); + bool ChkGndThinCellingOff(); + bool ChkWallSort(); + bool ChkLineDown(); + void ClrGroundHit(); + + virtual ~dBgS_Acch(); + + f32 GetSpeedY() { + if (mpSpeed) { + return mpSpeed->y; + } + return 0.0f; + } + + mVec3_c *GetPos() { + return mpPos; + } + mVec3_c *GetOldPos() { + return mpOldPos; + } + f32 GetGroundH() const { + return mGroundHeight; + } + f32 GetRoofHeight() const { + return mRoofHeight; + } + int GetTblSize() { + return mTblSize; + } + void SetLin() { + mLine.SetStartEnd(*mpOldPos, *mpPos); + } + bool ChkGroundFind() { + return mFlags & GROUND_FIND; + } + bool ChkGroundHit() { + return mFlags & GROUND_HIT; + } + bool ChkGroundLanding() { + return mFlags & GROUND_LANDING; + } + void ClrGroundLanding() { + mFlags &= ~GROUND_LANDING; + } + void ClrGroundAway() { + mFlags &= ~GROUND_AWAY; + } + void ClrWallHit() { + mFlags &= ~WALL_HIT; + } + void SetRoofNone() { + mFlags |= ROOF_NONE; + } + void SetRoofHit() { + mFlags |= ROOF_HIT; + } + void SetWaterNone() { + mFlags |= WATER_NONE; + } + bool ChkWallHit() { + return mFlags & WALL_HIT; + } + void OffLineCheckHit() { + mFlags &= ~LINE_CHECK_HIT; + } + void OffLineCheck() { + mFlags &= ~LINE_CHECK; + } + bool ChkLineCheckNone() { + return mFlags & LINE_CHECK_NONE; + } + bool ChkLineCheck() { + return mFlags & LINE_CHECK; + } + bool Chk_0x4000000() const { + return mFlags & ACCH_FLAG_0x4000000; + } + void Set_0x4000000() { + mFlags |= ACCH_FLAG_0x4000000; + } + void Clr_0x4000000() { + mFlags &= ~ACCH_FLAG_0x4000000; + } + void Clr_0x10000000() { + mFlags &= ~ACCH_FLAG_0x10000000; + } + void Set_0x10000000() { + mFlags |= ACCH_FLAG_0x10000000; + } + bool Chk_0x10000000() { + return mFlags & ACCH_FLAG_0x10000000; + } + void Clr_0x80000000() { + mFlags &= ~ACCH_FLAG_0x80000000; + } + void Set_0x80000000() { + mFlags |= ACCH_FLAG_0x80000000; + } + bool Chk_0x80000000() { + return mFlags & ACCH_FLAG_0x80000000; + } + void Clr_0x8000000() { + mFlags &= ~ACCH_FLAG_0x8000000; + } + void Set_0x8000000() { + mFlags |= ACCH_FLAG_0x8000000; + } + bool Chk_0x8000000() { + return mFlags & ACCH_FLAG_0x8000000; + } + + void ClrRoofHit() { + mFlags &= ~ROOF_HIT; + } + void ClrWaterHit() { + mFlags &= ~WATER_HIT; + } + void SetWaterHit() { + mFlags |= WATER_HIT; + } + void ClrWaterIn() { + mFlags &= ~WATER_IN; + } + void SetWaterIn() { + mFlags |= WATER_IN; + } + const u32 MaskWaterIn() { + return mFlags & WATER_IN; + } + const bool ChkWaterIn() { + return MaskWaterIn(); + } + void ClrGroundFind() { + mFlags &= ~GROUND_FIND; + } + u32 MaskRoofHit() { + return mFlags & ROOF_HIT; + } + bool ChkRoofHit() { + return MaskRoofHit(); + } + void OffClrSpeedY() { + mFlags |= CLR_SPEED_Y; + } + bool ChkClrSpeedY() { + return !(mFlags & CLR_SPEED_Y); + } + void SetGroundFind() { + mFlags |= GROUND_FIND; + } + void SetGroundHit() { + mFlags |= GROUND_HIT; + } + void SetGroundLanding() { + mFlags |= GROUND_LANDING; + } + void SetGroundAway() { + mFlags |= GROUND_AWAY; + } + const u32 MaskWaterHit() { + return mFlags & WATER_HIT; + } + const bool ChkWaterHit() { + return MaskWaterHit(); + } + void ClrWaterNone() { + mFlags &= ~WATER_NONE; + } + // void SetWaterCheckOffset(f32 offset) { + // m_wtr_chk_offset = offset; + // } + void OnLineCheck() { + mFlags |= LINE_CHECK; + } + void ClrRoofNone() { + mFlags &= ~ROOF_NONE; + } + bool CheckGroundHitPlus() { + return mFlags & ACCH_FLAG_0x4000000; + } + // void SetRoofCrrHeight(f32 height) { + // m_roof_crr_height = height; + // } + // void SetWtrChkMode(int mode) { + // m_wtr_mode = mode; + // } + void SetGrndNone() { + mFlags |= GRND_NONE; + } + void ClrGrndNone() { + mFlags &= ~GRND_NONE; + } + bool ChkMoveBGOnly() const { + return mFlags & MOVE_BG_ONLY; + } + void SetWallHit() { + mFlags |= WALL_HIT; + } + void ClrWallNone() { + mFlags &= ~WALL_NONE; + } + void OnLineCheckNone() { + mFlags |= LINE_CHECK_NONE; + } + void OffLineCheckNone() { + mFlags &= ~LINE_CHECK_NONE; + } + void SetWallNone() { + mFlags |= WALL_NONE; + } + void OnLineCheckHit() { + mFlags |= LINE_CHECK_HIT; + } + cM3dGCyl *GetWallBmdCylP() { + return &mWallCyl; + } + dAcObjBase_c *GetMyObj() { + return mpMyObj; + } + + cM3dGCir *GetWallCirP(int index) { + // JUT_ASSERT(index <= mTblSize); + return mpAcchCir[index].GetCirP(); + } + + f32 GetWallH(int i_no) { + return mpAcchCir[i_no].GetWallH(); + } + f32 GetWallR(int i_no) { + return mpAcchCir[i_no].GetWallR(); + } + bool ChkWallHDirect(int i_no) { + return mpAcchCir[i_no].ChkWallHDirect(); + } + f32 GetWallHDirect(int i_no) { + return mpAcchCir[i_no].GetWallHDirect(); + } + void SetWallHDirect(int i_no, f32 f) { + mpAcchCir[i_no].SetWallHDirect(f); + } + f32 GetWallRR(int i_no) { + return mpAcchCir[i_no].GetWallRR(); + } + void SetWallCirHit(int i_no) { + mpAcchCir[i_no].SetWallHit(); + } + void SetWallAngleY(int i_no, s16 i_angle) { + mpAcchCir[i_no].SetWallAngleY(i_angle); + } + bool ChkCirUnk0x8(int i_no) { + return mpAcchCir[i_no].ChkUnk0x8(); + } + bool ChkCirUnk0x10(int i_no) { + return mpAcchCir[i_no].ChkUnk0x10(); + } + + f32 GetCx() const { + return mpPos->x; + } + f32 GetCz() const { + return mpPos->z; + } + + // inline dupe + void i_ClrGroundHit() { + mFlags &= ~GROUND_HIT; + } + bool i_ChkGroundHit() const { + return mFlags & GROUND_HIT; + } + +public: + /* 0x040 */ u32 mFlags; + /* 0x044 */ mVec3_c *mpPos; + /* 0x048 */ mVec3_c *mpOldPos; + /* 0x04C */ mVec3_c mSpeed; + /* 0x058 */ mVec3_c *mpSpeed; + /* 0x05C */ mAng3_c *mpAngle; + /* 0x060 */ mAng3_c *mpShapeAngle; + /* 0x064 */ cM3dGLin mLine; + /* 0x07C */ cM3dGCyl mWallCyl; + /* 0x090 */ int mBgIndex; + /* 0x094 */ void *mField_0x094; + /* 0x098 */ u32 mField_0x098; + /* 0x09C */ dAcObjBase_c *mpMyObj; + /* 0x0A0 */ int mTblSize; + /* 0x0A4 */ dBgS_AcchCir *mpAcchCir; + /* 0x0A8 */ f32 mField_0x0A8; + /* 0x0AC */ f32 mField_0x0AC; + /* 0x0B0 */ f32 mGroundHeight; + /* 0x0B4 */ f32 mField_0x0B4; + /* 0x0B8 */ cM3dGPla mPlane_0x0B8; + /* 0x0C8 */ f32 mField_0x0C8; + /* 0x0CC */ f32 mField_0x0CC; + /* 0x0D0 */ f32 mRoofHeight; + /* 0x0D4 */ f32 mField_0x0D4; + /* 0x0D8 */ f32 mField_0x0D8; + /* 0x0DC */ cBgS_PolyInfo *mpOutPolyInfo; + /* 0x0E0 */ f32 mRoofH_0x0E0; + /* 0x0E4 */ f32 mGroundH_0x0E4; + /* 0x0E8 */ f32 mField_0x0E8; + /* 0x0EC */ dBgS_SphChk mSph; + /* 0x1A8 */ dBgS_Acch_0x1A8 mField_0x1A8; + /* 0x1C4 */ u8 _0[0x1D0 - 0x1C4]; + /* 0x1D0 */ f32 mField_0x1D0; + /* 0x1D4 */ dBgS_GndChk mGnd; + /* 0x264 */ dBgS_RoofChk mRoof; + /* 0x2F4 */ f32 mField_0x2F4; + /* 0x2F8 */ dBgS_WtrChk mWtr; + /* 0x390 */ u8 mField_0x390; + /* 0x394 */ s32 mField_0x394; + /* 0x398 */ mVec3_c mField_0x398; + /* 0x3A4 */ mVec3_c mField_0x3A4; +}; + +class dBgS_ObjAcch : public dBgS_Acch { +public: + dBgS_ObjAcch(); + virtual ~dBgS_ObjAcch(); +}; + +class dBgS_LinkAcch : public dBgS_Acch { +public: + dBgS_LinkAcch(); + virtual ~dBgS_LinkAcch(); +}; + +class dBgS_BombAcch : public dBgS_Acch { +public: + dBgS_BombAcch(); + virtual ~dBgS_BombAcch(); +}; + +#endif diff --git a/include/d/col/bg/d_bg_s_cap_poly.h b/include/d/col/bg/d_bg_s_cap_poly.h new file mode 100644 index 00000000..a6784896 --- /dev/null +++ b/include/d/col/bg/d_bg_s_cap_poly.h @@ -0,0 +1,20 @@ +#ifndef D_BG_S_CAPT_POLY_H +#define D_BG_S_CAPT_POLY_H + +#include "d/col/bg/d_bg_s_chk.h" + +struct dBgS_CaptPoly; + +typedef void (*CaptPolyCallback)(dBgS_CaptPoly &, cBgD_Vtx_t *, u16, u16, u16, cM3dGPla *); + +struct dBgS_CaptPoly : public cBgS_Chk, public dBgS_Chk { +public: + cM3dGAab *GetBndP() { + return &mBnd; + } + + /* 0x40 */ cM3dGAab mBnd; + /* 0x58 */ UNKWORD mField_0x58; + /* 0x5C */ CaptPolyCallback mCallback; +}; +#endif diff --git a/include/d/col/bg/d_bg_s_chk.h b/include/d/col/bg/d_bg_s_chk.h new file mode 100644 index 00000000..de76d735 --- /dev/null +++ b/include/d/col/bg/d_bg_s_chk.h @@ -0,0 +1,19 @@ +#ifndef D_BG_S_CHK_H +#define D_BG_S_CHK_H + +// Include order matters here +// clang-format off +#include "d/col/bg/d_bg_s_poly_pass_chk.h" +#include "d/col/bg/d_bg_s_grp_pass_chk.h" +// clang-format on + +class dBgS_Chk : public dBgS_PolyPassChk, public dBgS_GrpPassChk { +public: + dBgS_Chk(); + cBgS_GrpPassChk *GetGrpPassChkInfo(); + cBgS_PolyPassChk *GetPolyPassChkInfo(); + + virtual ~dBgS_Chk(); +}; + +#endif diff --git a/include/d/col/bg/d_bg_s_gnd_chk.h b/include/d/col/bg/d_bg_s_gnd_chk.h new file mode 100644 index 00000000..b9677e27 --- /dev/null +++ b/include/d/col/bg/d_bg_s_gnd_chk.h @@ -0,0 +1,84 @@ +#ifndef D_BG_S_GND_CHK_H +#define D_BG_S_GND_CHK_H + +#include "d/col/bg/d_bg_s_chk.h" +#include "d/col/c/c_bg_s_gnd_chk.h" +#include "d/col/c/c_m3d_g_pla.h" + +class dBgS_GndChk : public cBgS_GndChk, public dBgS_Chk { +public: + dBgS_GndChk(); + virtual ~dBgS_GndChk(); + + void Set(const mVec3_c *pos, u32 *id); +}; + +class dBgS_LinkGndChk : public dBgS_GndChk { +public: + dBgS_LinkGndChk(); + virtual ~dBgS_LinkGndChk(); +}; + +class dBgS_ObjGndChk : public dBgS_GndChk { +public: + dBgS_ObjGndChk(); + virtual ~dBgS_ObjGndChk(); + + static dBgS_ObjGndChk &GetInstance() { + return sInstance; + } + static f32 GetGroundHeight() { + return sGroundHeight; + } + + static void ClearInstance(); + static bool CheckPos(const mVec3_c *); + static int GetMaterial(); + static int GetPolyAtt1(); + static bool GetTriPlane(cM3dGPla *); + static s32 GetRoomID(); + static bool ChkMoveBG(); + static int GetLightingCode(); + static int GetSpecialCode(); + +private: + static dBgS_ObjGndChk sInstance; + static f32 sGroundHeight; +}; + +class dBgS_ObjGndChk_Wtr : public dBgS_ObjGndChk { +public: + dBgS_ObjGndChk_Wtr(); + + virtual ~dBgS_ObjGndChk_Wtr(); +}; + +class dBgS_ObjGndChk_Spl : public dBgS_ObjGndChk { +public: + dBgS_ObjGndChk_Spl(); + + virtual ~dBgS_ObjGndChk_Spl(); +}; + +class dBgS_ObjGndChk_All : public dBgS_ObjGndChk { +public: + virtual ~dBgS_ObjGndChk_All(); + + dBgS_ObjGndChk_All(); +}; + +class dBgS_CamGndChk : public dBgS_GndChk { +public: + dBgS_CamGndChk(); + + virtual ~dBgS_CamGndChk(); +}; + +class dBgS_CamGndChk_Wtr : public dBgS_CamGndChk { +public: + dBgS_CamGndChk_Wtr(); + + virtual ~dBgS_CamGndChk_Wtr(); +}; + +#endif diff --git a/include/d/col/bg/d_bg_s_grp_pass_chk.h b/include/d/col/bg/d_bg_s_grp_pass_chk.h new file mode 100644 index 00000000..6516b826 --- /dev/null +++ b/include/d/col/bg/d_bg_s_grp_pass_chk.h @@ -0,0 +1,46 @@ +#ifndef D_BG_S_GRP_PASS_CHK_H +#define D_BG_S_GRP_PASS_CHK_H + +#include "d/col/c/c_bg_s_chk.h" + +class dBgS_GrpPassChk : public cBgS_GrpPassChk { +public: + enum { + /* 0x1 */ NORMAL_GRP = 1, + /* 0x2 */ WATER_GRP, + /* 0x3 */ FULL_GRP + }; + + dBgS_GrpPassChk(); + + virtual ~dBgS_GrpPassChk(); + + void OnWaterGrp() { + mGrp |= WATER_GRP; + } + void OnSpl() { + mGrp |= WATER_GRP; + } + void OnNormalGrp() { + mGrp |= NORMAL_GRP; + } + void OffNormalGrp() { + mGrp &= ~NORMAL_GRP; + } + void OffFullGrp() { + mGrp &= ~FULL_GRP; + } + void OnAll() { + mGrp |= FULL_GRP; + } + u32 MaskNormalGrp() const { + return mGrp & 1; + } + u32 MaskWaterGrp() const { + return mGrp & 2; + } + +private: + /* 0x4 */ u32 mGrp; +}; +#endif diff --git a/include/d/col/bg/d_bg_s_lin_chk.h b/include/d/col/bg/d_bg_s_lin_chk.h new file mode 100644 index 00000000..11431812 --- /dev/null +++ b/include/d/col/bg/d_bg_s_lin_chk.h @@ -0,0 +1,126 @@ +#ifndef D_BG_S_LIN_CHK_H +#define D_BG_S_LIN_CHK_H + +#include "d/col/bg/d_bg_s_chk.h" +#include "d/col/c/c_bg_s_lin_chk.h" +#include "d/col/c/c_m3d_g_pla.h" +#include "m/m_angle.h" + +class dAcObjBase_c; + +class dBgS_LinChk : public cBgS_LinChk, public dBgS_Chk { +public: + dBgS_LinChk(); + void Set(mVec3_c const *pStart, mVec3_c const *pEnd, dAcObjBase_c const *pObj); + + virtual ~dBgS_LinChk(); + + /* 0x00 cBgS_LinChk */; + /* 0x58 dBgS_Chk */; +}; + +class dBgS_CamLinChk : public dBgS_LinChk { +public: + dBgS_CamLinChk(); + + virtual ~dBgS_CamLinChk(); +}; + +class dBgS_CamLinChk_NorWtr : public dBgS_CamLinChk { +public: + dBgS_CamLinChk_NorWtr(); + + virtual ~dBgS_CamLinChk_NorWtr(); +}; + +class dBgS_ObjLinChk : public dBgS_LinChk { +public: + dBgS_ObjLinChk(); + + virtual ~dBgS_ObjLinChk(); + virtual void SetEnd(const mVec3_c *) override; + + static dBgS_ObjLinChk &GetInstance() { + return sInstance; + } + + static void ClearInstance(); + static bool LineCross(mVec3_c const *pStart, mVec3_c const *pEnd, dAcObjBase_c const *pObj); + static mAng GetAngle(); + static bool GetTriPla(cM3dGPla *); + static int GetMaterial(); + static bool ChkMoveBG(); + static bool ChkGround(); + static bool ChkWall(); + static bool ChkRoof(); + +private: + static dBgS_ObjLinChk sInstance; +}; + +class dBgS_LinkLinChk : public dBgS_LinChk { +public: + dBgS_LinkLinChk(); + + virtual ~dBgS_LinkLinChk(); +}; + +class dBgS_BombLinChk : public dBgS_LinChk { +public: + dBgS_BombLinChk(); + + virtual ~dBgS_BombLinChk(); +}; + +class dBgS_ArrowLinChk : public dBgS_LinChk { +public: + dBgS_ArrowLinChk(); + + virtual ~dBgS_ArrowLinChk(); +}; + +class dBgS_BeetleLinChk : public dBgS_LinChk { +public: + dBgS_BeetleLinChk(); + + virtual ~dBgS_BeetleLinChk(); +}; + +class dBgS_ClawshotLinChk : public dBgS_LinChk { +public: + dBgS_ClawshotLinChk(); + + virtual ~dBgS_ClawshotLinChk(); +}; + +class dBgS_GustBellowsLinChk : public dBgS_LinChk { +public: + dBgS_GustBellowsLinChk(); + + virtual ~dBgS_GustBellowsLinChk(); +}; + +class dBgS_WhipLinChk : public dBgS_LinChk { +public: + dBgS_WhipLinChk(); + + virtual ~dBgS_WhipLinChk(); +}; + +class dBgS_WtrLinChk : public dBgS_LinChk { +public: + dBgS_WtrLinChk(); + virtual ~dBgS_WtrLinChk(); + virtual void SetEnd(const mVec3_c *) override; + + static dBgS_WtrLinChk &GetInstance() { + return sInstance; + } + static void ClearInstance(); + static bool SetIsWater(mVec3_c const *pStart, mVec3_c const *pEnd, dAcObjBase_c const *pObj); + +private: + static dBgS_WtrLinChk sInstance; +}; + +#endif diff --git a/include/d/col/bg/d_bg_s_poly_pass_chk.h b/include/d/col/bg/d_bg_s_poly_pass_chk.h new file mode 100644 index 00000000..8c207334 --- /dev/null +++ b/include/d/col/bg/d_bg_s_poly_pass_chk.h @@ -0,0 +1,133 @@ +#ifndef D_BG_S_POLY_PASS_CHK_H +#define D_BG_S_POLY_PASS_CHK_H + +class cBgS_PolyPassChk { +public: + cBgS_PolyPassChk(); + virtual ~cBgS_PolyPassChk(); +}; + +class dBgS_PolyPassChk : public cBgS_PolyPassChk { +public: + dBgS_PolyPassChk(); + virtual ~dBgS_PolyPassChk(); + + bool ChkObj() { + return mObject; + } + bool ChkCam() { + return mCamera; + } + bool ChkLink() { + return mLink; + } + bool ChkArrow() { + return mArrow; + } + bool ChkBomb() { + return mBomb; + } + bool ChkWhip() { + return mWhip; + } + bool ChkBeetle() { + return mBeetle; + } + bool ChkClawshot() { + return mClawshot; + } + bool ChkUnderwaterRoof() { + return mUnderwaterRoof; + } + bool Chk0xD() { + return mBellows; + } + bool Chk0xE() { + return mField_0xE; + } + + void ClrObj() { + mObject = false; + } + void ClrCam() { + mCamera = false; + } + void ClrLink() { + mLink = false; + } + void ClrArrow() { + mArrow = false; + } + void ClrBomb() { + mBomb = false; + } + void ClrWhip() { + mWhip = false; + } + void ClrBeetle() { + mBeetle = false; + } + void ClrClawshot() { + mClawshot = false; + } + void ClrUnderwaterRoof() { + mUnderwaterRoof = false; + } + void ClrBellows() { + mBellows = false; + } + void Clr0xE() { + mField_0xE = false; + } + + void SetObj() { + mObject = true; + } + void SetCam() { + mCamera = true; + } + void SetLink() { + mLink = true; + } + void SetArrow() { + mArrow = true; + } + void SetBomb() { + mBomb = true; + } + void SetWhip() { + mWhip = true; + } + void SetBeetle() { + mBeetle = true; + } + void SetClawshot() { + mClawshot = true; + } + void SetUnderwaterRoof() { + mUnderwaterRoof = true; + } + void SetBellows() { + mBellows = true; + } + void Set0xE() { + mField_0xE = true; + } + + void SetPassChkInfo(dBgS_PolyPassChk &chk); + +private: + /* 0x4 */ bool mObject; + /* 0x5 */ bool mCamera; + /* 0x6 */ bool mLink; + /* 0x7 */ bool mArrow; + /* 0x8 */ bool mBomb; + /* 0x9 */ bool mWhip; + /* 0xA */ bool mBeetle; + /* 0xB */ bool mClawshot; + /* 0xC */ bool mUnderwaterRoof; + /* 0xD */ bool mBellows; + /* 0xE */ bool mField_0xE; +}; + +#endif diff --git a/include/d/col/bg/d_bg_s_roof_chk.h b/include/d/col/bg/d_bg_s_roof_chk.h new file mode 100644 index 00000000..214cef0b --- /dev/null +++ b/include/d/col/bg/d_bg_s_roof_chk.h @@ -0,0 +1,70 @@ +#ifndef D_BG_S_ROOF_CHK_H +#define D_BG_S_ROOF_CHK_H + +#include "d/col/bg/d_bg_s_chk.h" +#include "d/col/c/c_bg_s_poly_info.h" +#include "m/m_vec.h" + +class dBgS_RoofChk : public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk { +public: + /* 0x6C */ mVec3_c mPos; + /* 0x78 */ f32 mNowY; + /* 0x7C */ u8 mField_0x7C; + /* 0x80 */ mVec3_c mPosCopy; + + dBgS_RoofChk(); + + virtual ~dBgS_RoofChk(); + + void Init() { + SetNowY(1000000000.0f); + ClearPi(); + } + + void SetPos(mVec3_c const *); + + void SetNowY(f32 y) { + mNowY = y; + } + void i_SetPos(mVec3_c const &pos) { + mPos = pos; + } + f32 GetNowY() { + return mNowY; + } + mVec3_c *GetPosP() { + return &mPos; + } + + void CopyPos() { + mPosCopy = mPos; + } +}; + +class dBgS_ObjRoofChk : public dBgS_RoofChk { +public: + dBgS_ObjRoofChk(); + + virtual ~dBgS_ObjRoofChk(); + + static dBgS_ObjRoofChk &GetInstance() { + return sInstance; + } + static f32 GetRoofHeight() { + return sRoofHeight; + } + static void ClearInstance(); + static bool CheckPos(const mVec3_c *); + +private: + static dBgS_ObjRoofChk sInstance; + static f32 sRoofHeight; +}; + +class dBgS_LinkRoofChk : public dBgS_RoofChk { +public: + dBgS_LinkRoofChk(); + + virtual ~dBgS_LinkRoofChk(); +}; +#endif diff --git a/include/d/col/bg/d_bg_s_sph_chk.h b/include/d/col/bg/d_bg_s_sph_chk.h new file mode 100644 index 00000000..765dd331 --- /dev/null +++ b/include/d/col/bg/d_bg_s_sph_chk.h @@ -0,0 +1,39 @@ +#ifndef D_BG_S_SPH_CHK_H +#define D_BG_S_SPH_CHK_H + +#include "d/col/bg/d_bg_s_chk.h" +#include "d/col/c/c_bg_s_poly_info.h" +#include "d/col/c/c_m3d_g_sph.h" + +struct cBgD_Vtx_t; + +class dBgS_SphChk; +typedef void *(*SphChk_Callback)(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *, void *); + +class dBgS_SphChk : public cM3dGSph, public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk { +public: + /* 0x80 */ f32 mField_0x80; + /* 0x84 */ mVec3_c mField_0x84; + /* 0x90 */ cM3dGAab mAabb; + /* 0xA8 */ u32 mField_0xA8; + /* 0xAC */ void *mField_0xAC; + /* 0xB0 */ u32 mField_0xB0; + /* 0xB4 */ SphChk_Callback mCallback; + + void SetInfo(int i, void *pV, int a) { + mField_0xA8 = i; + mField_0xAC = pV; + mField_0xB0 = a; + } + + dBgS_SphChk(); + virtual ~dBgS_SphChk(); +}; + +class dBgS_CamSphChk : public dBgS_SphChk { +public: + dBgS_CamSphChk(); + virtual ~dBgS_CamSphChk(); +}; + +#endif diff --git a/include/d/col/bg/d_bg_s_spl_grp_chk.h b/include/d/col/bg/d_bg_s_spl_grp_chk.h new file mode 100644 index 00000000..d4d47f25 --- /dev/null +++ b/include/d/col/bg/d_bg_s_spl_grp_chk.h @@ -0,0 +1,72 @@ +#ifndef D_BG_S_SPL_GRP_CHK_H +#define D_BG_S_SPL_GRP_CHK_H + +#include "d/col/bg/d_bg_s_chk.h" +#include "d/col/c/c_bg_s_poly_info.h" +#include "m/m_vec.h" + +class dBgS_SplGrpChk : public cBgS_PolyInfo, public cBgS_Chk, public dBgS_Chk { +public: + /* 0x6C */ mVec3_c mGnd; + /* 0x78 */ f32 mRoof; + /* 0x7C */ f32 mHeight; + /* 0x80 */ f32 mGroundH; + /* 0x84 */ u32 mFlags; + /* 0x88 */ mVec3_c mGroundCopy; + + enum { + /* 0x1 */ FIND = 1, + /* 0x2 */ IN = 2, + /* 0x4 */ MOVE_BG_ONLY = 4 + }; + + void Set(mVec3_c &, f32); + dBgS_SplGrpChk(); + + void Init() { + OffIn(); + OffFind(); + + mGroundH = -1000000000.0f; + SetHeight(mGnd.y); + ClearPi(); + } + + virtual ~dBgS_SplGrpChk(); + + void OffFind() { + mFlags &= ~FIND; + } + void OffIn() { + mFlags &= ~IN; + } + void OffMoveBGOnly() { + mFlags &= ~MOVE_BG_ONLY; + } + void OnMoveBGOnly() { + mFlags |= MOVE_BG_ONLY; + } + void OnFind() { + mFlags |= FIND; + } + bool ChkMoveBGOnly() { + return mFlags & MOVE_BG_ONLY; + } + void SetHeight(f32 height) { + mHeight = height; + } + f32 GetHeight() { + return mHeight; + } + mVec3_c &GetPosP() { + return mGnd; + } + f32 GetRoof() const { + return mRoof; + } + void CopyGnd() { + mGroundCopy = mGnd; + } +}; + +#endif diff --git a/include/d/col/bg/d_bg_s_wtr_chk.h b/include/d/col/bg/d_bg_s_wtr_chk.h new file mode 100644 index 00000000..844c9f81 --- /dev/null +++ b/include/d/col/bg/d_bg_s_wtr_chk.h @@ -0,0 +1,28 @@ +#ifndef D_BG_S_WTR_CHK_H +#define D_BG_S_WTR_CHK_H + +#include "d/col/bg/d_bg_s_spl_grp_chk.h" + +class dBgS_WtrChk : public dBgS_SplGrpChk { +public: + dBgS_WtrChk(); + + virtual ~dBgS_WtrChk(); + + static dBgS_WtrChk &GetInstance() { + return sInstance; + } + static f32 GetWaterHeight() { + return sWaterHeight; + } + + static void ClearInstance(); + static bool CheckPos(const mVec3_c *, bool, f32, f32); + static int GetMaterial(); + +private: + static dBgS_WtrChk sInstance; + static f32 sWaterHeight; +}; + +#endif diff --git a/include/d/col/bg/d_bg_w.h b/include/d/col/bg/d_bg_w.h new file mode 100644 index 00000000..5317b182 --- /dev/null +++ b/include/d/col/bg/d_bg_w.h @@ -0,0 +1,403 @@ +#ifndef D_BG_W_H +#define D_BG_W_H + +#include +#include +#include +#include +#include +#include + +class cBgS_GrpPassChk; +class cBgS_PolyPassChk; +class fBase_c; +struct cBgD_Vtx_t; +struct dBgS_CaptPoly; + +class cBgW_TriElm : public cM3dGPla { +public: +}; + +struct _RwgElm_t { + u16 mNext; +}; + +class cBgW_RwgElm : public _RwgElm_t { +public: + cBgW_RwgElm() {} +}; + +class cBgW_NodeTree : public cM3dGAab {}; + +class cBgW_GrpElm { +public: + cM3dGAab mAab; +}; + +// Odd +struct _BlkElm_t { + /* 0x0 */ u16 mRoofIdx; + /* 0x2 */ u16 mWallIdx; + /* 0x4 */ u16 mGndIdx; +}; + +class cBgW_BlkElm : public _BlkElm_t { +public: + cBgW_BlkElm() {} +}; // Size: 0x6 + +struct cBgD_Tri_t { + /* 0x0 */ u16 mVtxIdx0; + /* 0x2 */ u16 mVtxIdx1; + /* 0x4 */ u16 mVtxIdx2; + /* 0x6 */ u16 mId; + /* 0x8 */ u16 mGrp; +}; // Size: 0xA + +struct cBgD_Ti_t { + /* 0x0 */ u32 m_info0; + /* 0x4 */ u32 m_info1; + /* 0x8 */ u32 m_info2; + /* 0xC */ u32 m_passFlag; +}; + +class cBgD_Blk_t { +public: + /* 0x0 */ u16 field_0x0; + cBgD_Blk_t(); +}; + +struct cBgD_Tree_t { + /* 0x0 */ u16 mFlag; + /* 0x2 */ u16 m_parent_id; + /* 0x4 */ u16 mId[8]; + +}; // Size: 0x14 + +struct cBgD_Grp_t { + /* 0x00 */ char *mpName; + /* 0x04 */ mVec3_c mScale; + /* 0x10 */ mAng3_c mRotation; + /* 0x18 */ mVec3_c mTranslation; + /* 0x24 */ u16 mParent; + /* 0x26 */ u16 mNextSibling; + /* 0x28 */ u16 mFirstChild; + /* 0x2A */ u16 mRoomId; + /* 0x2C */ u16 mFirstVtxIdx; + /* 0x2E */ u16 mTreeIdx; + /* 0x30 */ u32 mInfo; +}; // Size: 0x34 + +struct cBgD_t { + /* 0x00 */ int mVtxNum; // vertex num + /* 0x04 */ cBgD_Vtx_t *mVtxTbl; // vertex table + /* 0x08 */ int mTriNum; // triangle num + /* 0x0C */ cBgD_Tri_t *mTriTbl; // triangle table + /* 0x10 */ int mBlkNum; + /* 0x14 */ cBgD_Blk_t *mBlkTbl; + /* 0x18 */ int mTreeNum; + /* 0x1C */ cBgD_Tree_t *mTreeTbl; + /* 0x20 */ int mGrpNum; + /* 0x24 */ cBgD_Grp_t *mGrpTbl; + /* 0x28 */ int mTiNum; + /* 0x2C */ cBgD_Ti_t *mTiTbl; + /* 0x30 */ u32 mFlags; +}; + +class cBgW : public dBgW_Base { +public: + enum Flags_e { + MOVE_BG_e = 0x1, + NO_CALC_VTX_e = 0x2, + NO_VTX_TBL_e = 0x10, + GLOBAL_e = 0x20, + CBGW_UNK_FLAG_40 = 0x40, + LOCK_e = 0x80, + ROOF_REGIST_e = 0x200, + }; + + cBgW(); + void FreeArea(); + + u32 GetOldInvMtx(mMtx_c *m); + void UpdateMtx(); + void GlobalVtx(); + bool SetVtx(); + bool SetTri(); + + void BlckConnect(u16 *, int *, int); + void MakeBlckTransMinMax(mVec3_c *, mVec3_c *); + void MakeBlckMinMax(int, mVec3_c *, mVec3_c *); + void MakeBlckBnd(int, mVec3_c *, mVec3_c *); + + void MakeNodeTreeRp(int); + void MakeNodeTreeGrpRp(int); + void MakeNodeTree(); + + bool Set(cBgD_t *pDzb, PLC *pPlc, u32 flags, mMtx_c *pMdlMtx, mVec3_c *pScale); + + void LineCheckGrpRp(cBgS_LinChk *, int); + void LineCheckRp(cBgS_LinChk *, int); + void RwgLineCheck(int, cBgS_LinChk *); + + void GroundCrossGrpRp(cBgS_GndChk *, int); + void GroundCrossRp(cBgS_GndChk *, int); + void RwgGroundCheckCommon(f32, u16, cBgS_GndChk *) { + // Is Inlined + } + void RwgGroundCheckGnd(u16, cBgS_GndChk *); + void RwgGroundCheckWall(u16, cBgS_GndChk *); + + void Lock(); + void CopyOldMtx(); + void Move(); + + void ShdwDrawGrpRp(cBgS_ShdwDraw *, int); + void ShdwDrawRp(cBgS_ShdwDraw *, int); + void RwgShdwDraw(int, cBgS_ShdwDraw *); + + void GetTriPla(int idx, cM3dGPla *); + + void GetTrans(mVec3_c *) const; + int GetPolyInfId(int) const; + u32 GetPolyInf0(int, u32, u32) const; + u32 GetMaskPolyInf0_NoShift(int, u32) const; + u32 GetPolyInf1(int, u32, u32) const; + u32 GetMaskPolyInf1_NoShift(int, u32) const; + u32 GetPolyInf2(int, u32, u32) const; + int GetTriGrp(int) const; + + /* vt at 0x08 */ + /* 0x008 */ virtual ~cBgW(); + /* 0x00C */ virtual bool ChkMemoryError() override; + /* 0x014 */ virtual void GetTopUnder(f32 *pOutTop, f32 *pOutUnder) const override; + /* 0x018 */ virtual bool ChkNotReady() const override; + /* 0x01C */ virtual bool ChkLock() const override; + /* 0x020 */ virtual bool ChkMoveBg() const override; + /* 0x024 */ virtual u32 ChkMoveFlag() const override = 0; + /* 0x028 */ virtual void GetTriPla(cBgS_PolyInfo const &, cM3dGPla *) const override; + /* 0x02C */ virtual bool GetTriPnt(cBgS_PolyInfo const &, mVec3_c *, mVec3_c *, mVec3_c *) const override; + /* 0x030 */ virtual const cM3dGAab *GetBnd() const override; + /* 0x034 */ virtual u32 GetGrpInf(cBgS_PolyInfo const &) const override; + /* 0x038 */ virtual void OffMoveFlag() override = 0; + /* 0x03C */ virtual void vt_0x3C() override = 0; + /* 0x040 */ virtual bool LineCheck(cBgS_LinChk *) override; + /* 0x044 */ virtual bool GroundCross(cBgS_GndChk *) override; + /* 0x048 */ virtual void ShdwDraw(cBgS_ShdwDraw *) override; + /* 0x04C */ virtual void CaptPoly(dBgS_CaptPoly &) override = 0; + /* 0x050 */ virtual bool WallCorrect(dBgS_Acch *) override = 0; + /* 0x054 */ virtual bool WallCorrectSort(dBgS_Acch *) override = 0; + /* 0x058 */ virtual bool RoofChk(dBgS_RoofChk *) override = 0; + /* 0x05C */ virtual bool SplGrpChk(dBgS_SplGrpChk *) override = 0; + /* 0x060 */ virtual bool SphChk(dBgS_SphChk *, void *) override = 0; + /* 0x064 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const &) const override = 0; + /* 0x068 */ virtual s32 GetExitId(cBgS_PolyInfo const &) override = 0; + /* 0x06C */ virtual s32 GetZTargetThrough(cBgS_PolyInfo const &) override = 0; + /* 0x070 */ virtual int GetSpecialCode(cBgS_PolyInfo const &) override = 0; + /* 0x074 */ virtual int GetSpecialCode(int) override = 0; + /* 0x078 */ virtual int GetCode0_0x30000000(cBgS_PolyInfo const &) override = 0; + /* 0x07C */ virtual u32 GetPolyObjThrough(int) override = 0; + /* 0x080 */ virtual u32 GetPolyCamThrough(int) override = 0; + /* 0x084 */ virtual u32 GetPolyLinkThrough(int) override = 0; + /* 0x088 */ virtual u32 GetPolyArrowThrough(int) override = 0; + /* 0x08C */ virtual u32 GetPolySlingshotThrough(int) override = 0; + /* 0x090 */ virtual u32 GetPolyBeetleThrough(int) override = 0; + /* 0x094 */ virtual u32 GetPolyClawshotThrough(int) override = 0; + /* 0x098 */ virtual u32 GetPolyBombThrough(int) override = 0; + /* 0x09C */ virtual u32 GetPolyWhipThrough(int) override = 0; + /* 0x0A0 */ virtual u32 GetShdwThrough(int) override = 0; + /* 0x0A4 */ virtual u32 GetUnderwaterRoofCode(int) override = 0; + /* 0x0A8 */ virtual int GetCode0_0x80000000(cBgS_PolyInfo const &) override = 0; + /* 0x0AC */ virtual int GetLinkNo(cBgS_PolyInfo const &) override = 0; + /* 0x0B0 */ virtual s32 GetWallCode(cBgS_PolyInfo const &) override = 0; + /* 0x0B4 */ virtual int GetPolyAtt0Material(cBgS_PolyInfo const &) override = 0; + /* 0x0B8 */ virtual int GetPolyAtt0(cBgS_PolyInfo const &) override; + /* 0x0Bc */ virtual int GetPolyAtt1(cBgS_PolyInfo const &) override = 0; + /* 0x0C0 */ virtual int GetGroundCode(cBgS_PolyInfo const &) override = 0; + /* 0x0C4 */ virtual u32 GetCode1_0x02000000(int) override = 0; + /* 0x0C8 */ virtual u32 GetCode1_0x04000000(int) override = 0; + /* 0x0CC */ virtual u32 GetCode1_0x08000000(int) override = 0; + /* 0x0D0 */ virtual u32 GetLightingCode(cBgS_PolyInfo const &) override = 0; + /* 0x0D4 */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const &) override = 0; + /* 0x0D8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const &) override = 0; + /* 0x0DC */ virtual s32 GetRoomPathId(cBgS_PolyInfo const &) override = 0; + /* 0x0E0 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const &) override = 0; + /* 0x0E4 */ virtual void CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override = 0; + /* 0x0E8 */ virtual void + TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override = 0; + /* 0x0EC */ virtual void + MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override = 0; + /* 0x100 */ virtual bool GetIsDraw(int) override = 0; + /* 0x104 */ virtual void DrawOnMap(int, bool) override = 0; + /* 0x108 */ virtual void CalcPlane(); + /* 0x10C */ virtual void ClassifyPlane(); + + // MtxP GetBaseMtxP() { return pm_base; } + + bool ChkNoCalcVtx() { + return mFlags & NO_CALC_VTX_e; + } + void SetNoCalcVtx() { + mFlags |= NO_CALC_VTX_e; + } + void ClrNoCalcVtx() { + mFlags &= ~NO_CALC_VTX_e; + } + void SetLock() { + mFlags |= LOCK_e; + } + cBgD_Vtx_t *GetVtxTbl() const { + return mpVtxTbl; + } + int GetVtxNum() const { + return mpBgd->mVtxNum; + } + bool ChkRoofRegist() { + return mFlags & ROOF_REGIST_e; + } + +public: + /* 0x12C */ mMtx_c *mpMdlMtx; // Model Matrix + /* 0x130 */ mMtx_c mInvMtx; + /* 0x160 */ mMtx_c mMtx; + /* 0x190 */ mMtx_c mMtxUnk; + /* 0x1C0 */ mVec3_c mTransVel; + /* 0x1CC */ mVec3_c *mpScale; + /* 0x1D0 */ u16 mFlags; + /* 0x1D2 */ u16 mRootGroupIdx; + /* 0x1D4 */ cBgW_TriElm *mpTri; + /* 0x1D8 */ cBgW_RwgElm *mpRwg; + /* 0x1DC */ cBgD_Vtx_t *mpVtxTbl; + /* 0x1E0 */ cBgD_t *mpBgd; + /* 0x1E4 */ cBgW_BlkElm *mpBlk; + /* 0x1E8 */ cBgW_GrpElm *mpGrp; + /* 0x1EC */ cBgW_NodeTree *mpNodeTree; + /* 0x1F0 */ dBgPlc mpPolyCodes; + /* 0x1F4 */ bool mNeedsFullTransform; + + static bool sLineCheck; + static bool sGndCheck; + static bool sWallCheck; + static bool sRoofCheck; + static bool sSplGrpCheck; + static bool sSphCheck; +}; + +class dBgW; +class dAcObjBase_c; +typedef void (*dBgW_RideCallback)(dBgW *, dAcObjBase_c *, dAcObjBase_c *); +typedef void (*dBgW_ArrowStickCallback)(dBgW *, dAcObjBase_c *, dAcObjBase_c *, mVec3_c &); +typedef bool (*dBgW_UnkCallback)(dBgW *, dAcObjBase_c *, dAcObjBase_c *); +typedef void (*dBgW_CrrFunc)(dBgW *, void *, cBgS_PolyInfo const &, bool, mVec3_c *, mAng3_c *, mAng3_c *); + +class dBgW : public cBgW { +public: + dBgW(); + void Move(); + void positionWallCorrect(dBgS_Acch *, f32, cM3dGPla &, mVec3_c *pUpperPos, f32); + + void RwgWallCorrect(dBgS_Acch *, u16); + void WallCorrectRp(dBgS_Acch *, int); + void WallCorrectGrpRp(dBgS_Acch *, int); + + void RwgWallCorrectSort(dBgS_Acch *, u16); + void WallCorrectRpSort(dBgS_Acch *, int); + void WallCorrectGrpRpSort(dBgS_Acch *, int); + + void RwgRoofChk(u16, dBgS_RoofChk *, f32); + void RwgRoofChkRoof(u16, dBgS_RoofChk *); + void RwgRoofChkWall(u16, dBgS_RoofChk *); + void RoofChkRp(dBgS_RoofChk *, int); + void RoofChkGrpRp(dBgS_RoofChk *, int); + + void RwgSplGrpChk(u16, dBgS_SplGrpChk *); + void SplGrpChkRp(dBgS_SplGrpChk *, int); + void SplGrpChkGrpRp(dBgS_SplGrpChk *, int); + + void RwgCaptPoly(u16, dBgS_CaptPoly &); + void CaptPolyRp(dBgS_CaptPoly &, int); + void CaptPolyGrpRp(dBgS_CaptPoly &, int); + + void RwgSphChk(u16, dBgS_SphChk *, void *); + void SphChkRp(dBgS_SphChk *, void *, int); + void SphChkGrpRp(dBgS_SphChk *, void *, int); + + bool GetMapCode(int polyIdx, int *pOut); + + /* vt at 0x08 */ + /* 0x008 */ virtual ~dBgW(); + /* 0x024 */ virtual u32 ChkMoveFlag() const override; + /* 0x038 */ virtual void OffMoveFlag() override; + /* 0x03C */ virtual void vt_0x3C() override; + /* 0x04C */ virtual void CaptPoly(dBgS_CaptPoly &) override; + /* 0x050 */ virtual bool WallCorrect(dBgS_Acch *) override; + /* 0x054 */ virtual bool WallCorrectSort(dBgS_Acch *) override; + /* 0x058 */ virtual bool RoofChk(dBgS_RoofChk *) override; + /* 0x05C */ virtual bool SplGrpChk(dBgS_SplGrpChk *) override; + /* 0x060 */ virtual bool SphChk(dBgS_SphChk *, void *) override; + /* 0x064 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const &) const override; + /* 0x068 */ virtual s32 GetExitId(cBgS_PolyInfo const &) override; + /* 0x06C */ virtual s32 GetZTargetThrough(cBgS_PolyInfo const &) override; + /* 0x070 */ virtual int GetSpecialCode(cBgS_PolyInfo const &) override; + /* 0x074 */ virtual int GetSpecialCode(int) override; + /* 0x078 */ virtual int GetCode0_0x30000000(cBgS_PolyInfo const &) override; + /* 0x07C */ virtual u32 GetPolyObjThrough(int) override; + /* 0x080 */ virtual u32 GetPolyCamThrough(int) override; + /* 0x084 */ virtual u32 GetPolyLinkThrough(int) override; + /* 0x088 */ virtual u32 GetPolyArrowThrough(int) override; + /* 0x08C */ virtual u32 GetPolySlingshotThrough(int) override; + /* 0x090 */ virtual u32 GetPolyBeetleThrough(int) override; + /* 0x094 */ virtual u32 GetPolyClawshotThrough(int) override; + /* 0x098 */ virtual u32 GetPolyBombThrough(int) override; + /* 0x09C */ virtual u32 GetPolyWhipThrough(int) override; + /* 0x0A0 */ virtual u32 GetShdwThrough(int) override; + /* 0x0A4 */ virtual u32 GetUnderwaterRoofCode(int) override; + /* 0x0A8 */ virtual int GetCode0_0x80000000(cBgS_PolyInfo const &) override; + /* 0x0AC */ virtual int GetLinkNo(cBgS_PolyInfo const &) override; + /* 0x0B0 */ virtual s32 GetWallCode(cBgS_PolyInfo const &) override; + /* 0x0B4 */ virtual int GetPolyAtt0Material(cBgS_PolyInfo const &) override; + /* 0x0B8 */ virtual int GetPolyAtt0(cBgS_PolyInfo const &) override; + /* 0x0Bc */ virtual int GetPolyAtt1(cBgS_PolyInfo const &) override; + /* 0x0C0 */ virtual int GetGroundCode(cBgS_PolyInfo const &) override; + /* 0x0C4 */ virtual u32 GetCode1_0x02000000(int) override; + /* 0x0C8 */ virtual u32 GetCode1_0x04000000(int) override; + /* 0x0CC */ virtual u32 GetCode1_0x08000000(int) override; + /* 0x0D0 */ virtual u32 GetLightingCode(cBgS_PolyInfo const &) override; + /* 0x0D4 */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const &) override; + /* 0x0D8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const &) override; + /* 0x0DC */ virtual s32 GetRoomPathId(cBgS_PolyInfo const &) override; + /* 0x0E0 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const &) override; + /* 0x0E4 */ virtual void CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0E8 */ virtual void TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0EC */ virtual void + MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0F0 */ virtual void CallRideCallback(dAcObjBase_c *, dAcObjBase_c *) override; + /* 0x0F4 */ virtual void CallArrowStickCallback(dAcObjBase_c *, dAcObjBase_c *, mVec3_c &) override; + /* 0x0F8 */ virtual bool CallUnkCallback(dAcObjBase_c *, dAcObjBase_c *) override; + /* 0x0FC */ virtual bool UpdateDraw(mAllocator_c *) override; + /* 0x100 */ virtual bool GetIsDraw(int) override; + /* 0x104 */ virtual void DrawOnMap(int, bool) override; + /* 0x110 */ virtual u32 GetWallAtt(int); + + void SetCrrFunc(dBgW_CrrFunc func) { + mpCrrFunc = func; + } + void SetRideCallback(dBgW_RideCallback func) { + mpRide_cb = func; + } + void OnMoveFlag() { + mFlags |= 1; + } + +private: + /* 0x1F8 */ u32 mField_0x1F8; + /* 0x1FC */ dBgW_CrrFunc mpCrrFunc; + /* 0x200 */ dBgW_RideCallback mpRide_cb; + /* 0x204 */ dBgW_ArrowStickCallback mpArrowStick_cb; + /* 0x208 */ dBgW_UnkCallback mpUnk_cb; + /* 0x20C */ u8 mFlags; + + static mVec3_c sWallCorrectPos; +}; + +#endif diff --git a/include/d/col/bg/d_bg_w_base.h b/include/d/col/bg/d_bg_w_base.h new file mode 100644 index 00000000..8ce3cdf6 --- /dev/null +++ b/include/d/col/bg/d_bg_w_base.h @@ -0,0 +1,225 @@ +#ifndef D_BG_W_BASE_H +#define D_BG_W_BASE_H + +#include "d/a/d_a_base.h" +#include "d/col/c/c_bg_s_poly_info.h" +#include "d/col/c/c_bg_w.h" +#include "d/col/c/c_m3d_g_aab.h" +#include "d/col/c/c_m3d_g_pla.h" +#include "d/col/c/c_partition.h" +#include "m/m_allocator.h" +#include "m/m_math.h" + +class cBgS_GndChk; +class cBgS_LinChk; +class cBgS_ShdwDraw; +class dBgS_Acch; +struct dBgS_CaptPoly; +class dBgS_RoofChk; +class dBgS_SphChk; +class dBgS_SplGrpChk; + +class dAcObjBase_c; + +// TODO +class dBgW_Base_0x18 { +public: + /* 0x00 */ u8 field_0x00; + dBgW_Base_0x18(); + /* vt at 0x04 */ + virtual ~dBgW_Base_0x18(); +}; + +// TODO +class dBgW_Base_MapRelated { +public: + void Clear() { + mpIdx = nullptr; + mCount = 0; + } + /* 0x0 */ int *mpIdx; + /* 0x4 */ int mCount; +}; + +class dBgW_Base : public cBgW_BgId { +public: + enum PushPullLabel { + PPLABEL_NONE = 0, + PPLABEL_PUSH = 1, + PPLABEL_PULL = 2, + PPLABEL_4 = 4, + PPLABEL_HEAVY = 8, + }; + + enum PRIORITY { + PRIORITY_0, + }; + + typedef dAcObjBase_c *(*PushPull_CallBack)(dAcObjBase_c *, dAcObjBase_c *, dBgW_Base::PushPullLabel); + + dBgW_Base(); + void ClrDBgWBase(); + void CalcDiffShapeAngleY(s16); + bool InitMapStuff(mAllocator_c *pAllocator); + bool fn_8034AD70() const; + bool fn_8034ADA0() const; + void RegistBg(int id); + void UnRegistBg(); + bool ChkReady() const; + void Set0x2F(u8); + + /* vt at 0x08 */ + /* 0x008 */ virtual ~dBgW_Base(); + /* 0x00C */ virtual bool ChkMemoryError(); + /* 0x010 */ virtual void SetOldShapeAngleY(s16); + /* 0x014 */ virtual void GetTopUnder(f32 *pOutTop, f32 *pOutUnder) const = 0; // ? + /* 0x018 */ virtual bool ChkNotReady() const = 0; + /* 0x01C */ virtual bool ChkLock() const = 0; + /* 0x020 */ virtual bool ChkMoveBg() const = 0; + /* 0x024 */ virtual u32 ChkMoveFlag() const = 0; + /* 0x028 */ virtual void GetTriPla(cBgS_PolyInfo const &, cM3dGPla *) const = 0; + /* 0x02C */ virtual bool GetTriPnt(cBgS_PolyInfo const &, mVec3_c *, mVec3_c *, mVec3_c *) const = 0; + /* 0x030 */ virtual const cM3dGAab *GetBnd() const = 0; + /* 0x034 */ virtual u32 GetGrpInf(cBgS_PolyInfo const &) const = 0; + /* 0x038 */ virtual void OffMoveFlag() = 0; + /* 0x03C */ virtual void vt_0x3C() = 0; + /* 0x040 */ virtual bool LineCheck(cBgS_LinChk *) = 0; + /* 0x044 */ virtual bool GroundCross(cBgS_GndChk *) = 0; + /* 0x048 */ virtual void ShdwDraw(cBgS_ShdwDraw *) = 0; + /* 0x04C */ virtual void CaptPoly(dBgS_CaptPoly &) = 0; + /* 0x050 */ virtual bool WallCorrect(dBgS_Acch *) = 0; + /* 0x054 */ virtual bool WallCorrectSort(dBgS_Acch *) = 0; + /* 0x058 */ virtual bool RoofChk(dBgS_RoofChk *) = 0; + /* 0x05C */ virtual bool SplGrpChk(dBgS_SplGrpChk *) = 0; + /* 0x060 */ virtual bool SphChk(dBgS_SphChk *, void *) = 0; + /* 0x064 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const &) const = 0; + /* 0x068 */ virtual s32 GetExitId(cBgS_PolyInfo const &) = 0; + /* 0x06C */ virtual s32 GetZTargetThrough(cBgS_PolyInfo const &) = 0; + /* 0x070 */ virtual int GetSpecialCode(cBgS_PolyInfo const &) = 0; + /* 0x074 */ virtual int GetSpecialCode(int) = 0; + /* 0x078 */ virtual int GetCode0_0x30000000(cBgS_PolyInfo const &) = 0; + /* 0x07C */ virtual u32 GetPolyObjThrough(int) = 0; + /* 0x080 */ virtual u32 GetPolyCamThrough(int) = 0; + /* 0x084 */ virtual u32 GetPolyLinkThrough(int) = 0; + /* 0x088 */ virtual u32 GetPolyArrowThrough(int) = 0; + /* 0x08C */ virtual u32 GetPolySlingshotThrough(int) = 0; + /* 0x090 */ virtual u32 GetPolyBeetleThrough(int) = 0; + /* 0x094 */ virtual u32 GetPolyClawshotThrough(int) = 0; + /* 0x098 */ virtual u32 GetPolyBombThrough(int) = 0; + /* 0x09C */ virtual u32 GetPolyWhipThrough(int) = 0; + /* 0x0A0 */ virtual u32 GetShdwThrough(int) = 0; + /* 0x0A4 */ virtual u32 GetUnderwaterRoofCode(int) = 0; + /* 0x0A8 */ virtual int GetCode0_0x80000000(cBgS_PolyInfo const &) = 0; + /* 0x0AC */ virtual int GetLinkNo(cBgS_PolyInfo const &) = 0; + /* 0x0B0 */ virtual s32 GetWallCode(cBgS_PolyInfo const &) = 0; + /* 0x0B4 */ virtual int GetPolyAtt0Material(cBgS_PolyInfo const &) = 0; + /* 0x0B8 */ virtual int GetPolyAtt0(cBgS_PolyInfo const &) = 0; + /* 0x0Bc */ virtual int GetPolyAtt1(cBgS_PolyInfo const &) = 0; + /* 0x0C0 */ virtual int GetGroundCode(cBgS_PolyInfo const &) = 0; + /* 0x0C4 */ virtual u32 GetCode1_0x02000000(int) = 0; + /* 0x0C8 */ virtual u32 GetCode1_0x04000000(int) = 0; + /* 0x0CC */ virtual u32 GetCode1_0x08000000(int) = 0; + /* 0x0D0 */ virtual u32 GetLightingCode(cBgS_PolyInfo const &) = 0; + /* 0x0D4 */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const &) = 0; + /* 0x0D8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const &) = 0; + /* 0x0DC */ virtual s32 GetRoomPathId(cBgS_PolyInfo const &) = 0; + /* 0x0E0 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const &) = 0; + /* 0x0E4 */ virtual void CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) = 0; + /* 0x0E8 */ virtual void TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) = 0; + /* 0x0EC */ virtual void MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) = 0; + /* 0x0F0 */ virtual void CallRideCallback(dAcObjBase_c *, dAcObjBase_c *); + /* 0x0F4 */ virtual void CallArrowStickCallback(dAcObjBase_c *, dAcObjBase_c *, mVec3_c &); + /* 0x0F8 */ virtual bool CallUnkCallback(dAcObjBase_c *, dAcObjBase_c *); + /* 0x0FC */ virtual bool UpdateDraw(mAllocator_c *); + /* 0x100 */ virtual bool GetIsDraw(int) = 0; + /* 0x104 */ virtual void DrawOnMap(int, bool) = 0; + + u16 GetRegistId() const { + return mRegistId; + } + + PushPull_CallBack GetPushPullCallback() const { + return mpPushPull_cb; + } + s16 GetDiffShapeAngleY() { + return mDiffShapeAngleY; + } + int GetRoomId() { + return mRoomId; + } + + void ClearMap() { + for (int i = 0; i < 31; i++) { + mMapRelated[i].Clear(); + } + } + void ClearMapCount() { + for (int i = 0; i < 31; i++) { + mMapRelated[i].mCount = 0; + } + } + void SetMapCount(int c) { + for (int i = 0; i < 31; i++) { + mMapRelated[i].mCount = c; + } + } + + void SetPushPullCallback(PushPull_CallBack i_callBack) { + mpPushPull_cb = i_callBack; + } + void SetRoomId(int id) { + mRoomId = id; + } + bool ChkPriority(int prio) { + return mPriority == prio; + } + void SetPriority(PRIORITY priority) { + mPriority = priority; + } + void OnStickWall() { + field_0x24 |= 1; + } + void OnStickRoof() { + field_0x24 |= 2; + } + + cPartition &GetPartition() { + return mPartitionInfo; + } + + u16 GetField_0x20() const { + return field_0x20; + } + u16 GetField_0x22() const { + return field_0x22; + } + + bool ChkStickWall() const { + return field_0x24 & 1; + } + bool ChkStickRoof() const { + return field_0x24 & 2; + } + + bool Chk0x24_0x20() const { + return field_0x24 & 0x20; + } + + // private: + /* 0x08 */ cPartition mPartitionInfo; + /* 0x18 */ dBgW_Base_0x18 mField_0x18; + /* 0x20 */ u16 field_0x20; + /* 0x22 */ u16 field_0x22; + /* 0x24 */ u16 field_0x24; + /* 0x26 */ s16 mOldShapeAngleY; + /* 0x28 */ s16 mDiffShapeAngleY; + /* 0x2A */ u16 mRegistId; + /* 0x2C */ u8 mPriority; + /* 0x2D */ u8 mRoomId; + /* 0x2E */ u8 field_0x2E; + /* 0x2F */ s8 field_0x2F; + /* 0x30 */ PushPull_CallBack mpPushPull_cb; + /* 0x34 */ dBgW_Base_MapRelated mMapRelated[31]; +}; // Size: 0x12C + +#endif diff --git a/include/d/col/bg/d_bg_w_kcol.h b/include/d/col/bg/d_bg_w_kcol.h new file mode 100644 index 00000000..29b38db7 --- /dev/null +++ b/include/d/col/bg/d_bg_w_kcol.h @@ -0,0 +1,174 @@ +#ifndef D_BG_W_KCOL_H +#define D_BG_W_KCOL_H + +#include "d/col/bg/d_bg_plc.h" +#include "d/col/bg/d_bg_w_base.h" +#include "d/col/c/c_bg_s_chk.h" +#include "d/col/c/c_m3d_g_aab.h" + +class cBgS_GrpPassChk; +class cBgS_PolyPassChk; +struct dBgPc; +struct dBgS_CaptPoly; + +struct KC_PrismData { + /* 0x0 */ f32 mHeight; + /* 0x4 */ u16 mPosIdx; + /* 0x6 */ u16 mFaceNrmIdx; + /* 0x8 */ u16 mEdgeNrmIdx1; + /* 0xA */ u16 mEdgeNrmIdx2; + /* 0xC */ u16 mEdgeNrmIdx3; + /* 0xE */ u16 mAttribute; +}; // Size: 0x10 + +struct pkcdata { + /* 0x00 */ mVec3_c *mpPositionData; + /* 0x04 */ mVec3_c *mpNormalData; + /* 0x08 */ KC_PrismData *mpPrismData; + /* 0x0C */ u32 *mpBlockData; + /* 0x10 */ u8 field_0x10[4]; + /* 0x14 */ mVec3_c mAreaMinPos; + /* 0x20 */ u32 mAreaWidthMaskX; + /* 0x24 */ u32 mAreaWidthMaskY; + /* 0x28 */ u32 mAreaWidthMaskZ; + /* 0x2C */ u32 mShiftBlockWidth; + /* 0x30 */ u32 mShiftY; + /* 0x34 */ u32 mShiftZ; +}; + +struct KCol_Header { + /* 0x0 */ u32 pos_data_offset; + /* 0x4 */ u32 nrm_data_offset; + /* 0x8 */ u32 prism_data_offset; + /* 0xC */ u32 block_data_offset; +}; + +// Made up? +struct KC_Tri { + mVec3_c mA; + mVec3_c mB; + mVec3_c mC; +}; + +class dBgWKCol : public dBgW_Base { +public: + dBgWKCol(); + static void initKCollision(void *); + void Set(void *pprism, void *plc); + void GetTriNrm(KC_PrismData *, mVec3_c **) const; + cM3dGPla GetTriPla(int) const; + bool GetTriPnt(KC_PrismData const *, mVec3_c *, mVec3_c *, mVec3_c *) const; + bool GetTriPnt(int, mVec3_c *, mVec3_c *, mVec3_c *) const; + void GetPolyCode(int, dBgPc *) const; + + // These two functions are similar, first one checks roof, second doesnt. Idk a good name + static bool ChkPolyThrough(int id, dBgPc *, cBgS_Chk *); + static bool ChkPolyThroughGnd(int id, dBgPc *, cBgS_Chk *); + + bool ChkShdwDrawThrough(dBgPc *); + + int GetMapCode(KC_PrismData *prism, int *pOut); + void DrawMapSection(int, f32, f32, f32); + int GetPrismIdx(const KC_PrismData *); + + /* vt at 0x08 */ + /* 0x008 */ virtual ~dBgWKCol() override; + /* 0x014 */ virtual void GetTopUnder(f32 *pOutTop, f32 *pOutUnder) const override; + /* 0x018 */ virtual bool ChkNotReady() const override; + /* 0x01C */ virtual bool ChkLock() const override; + /* 0x020 */ virtual bool ChkMoveBg() const override; + /* 0x024 */ virtual u32 ChkMoveFlag() const override; + /* 0x028 */ virtual void GetTriPla(cBgS_PolyInfo const &, cM3dGPla *) const override; + /* 0x02C */ virtual bool GetTriPnt(cBgS_PolyInfo const &, mVec3_c *, mVec3_c *, mVec3_c *) const override; + /* 0x030 */ virtual const cM3dGAab *GetBnd() const override; + /* 0x034 */ virtual u32 GetGrpInf(cBgS_PolyInfo const &) const override; + /* 0x038 */ virtual void OffMoveFlag() override; + /* 0x03C */ virtual void vt_0x3C() override; + /* 0x040 */ virtual bool LineCheck(cBgS_LinChk *) override; + /* 0x044 */ virtual bool GroundCross(cBgS_GndChk *) override; + /* 0x048 */ virtual void ShdwDraw(cBgS_ShdwDraw *) override; + /* 0x04C */ virtual void CaptPoly(dBgS_CaptPoly &) override; + /* 0x050 */ virtual bool WallCorrect(dBgS_Acch *) override; + /* 0x054 */ virtual bool WallCorrectSort(dBgS_Acch *) override; + /* 0x058 */ virtual bool RoofChk(dBgS_RoofChk *) override; + /* 0x05C */ virtual bool SplGrpChk(dBgS_SplGrpChk *) override; + /* 0x060 */ virtual bool SphChk(dBgS_SphChk *, void *) override; + /* 0x064 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const &) const override; + /* 0x068 */ virtual s32 GetExitId(cBgS_PolyInfo const &) override; + /* 0x06C */ virtual s32 GetZTargetThrough(cBgS_PolyInfo const &) override; + /* 0x070 */ virtual int GetSpecialCode(cBgS_PolyInfo const &) override; + /* 0x074 */ virtual int GetSpecialCode(int) override; + /* 0x078 */ virtual int GetCode0_0x30000000(cBgS_PolyInfo const &) override; + /* 0x07C */ virtual u32 GetPolyObjThrough(int) override; + /* 0x080 */ virtual u32 GetPolyCamThrough(int) override; + /* 0x084 */ virtual u32 GetPolyLinkThrough(int) override; + /* 0x088 */ virtual u32 GetPolyArrowThrough(int) override; + /* 0x08C */ virtual u32 GetPolySlingshotThrough(int) override; + /* 0x090 */ virtual u32 GetPolyBeetleThrough(int) override; + /* 0x094 */ virtual u32 GetPolyClawshotThrough(int) override; + /* 0x098 */ virtual u32 GetPolyBombThrough(int) override; + /* 0x09C */ virtual u32 GetPolyWhipThrough(int) override; + /* 0x0A0 */ virtual u32 GetShdwThrough(int) override; + /* 0x0A4 */ virtual u32 GetUnderwaterRoofCode(int) override; + /* 0x0A8 */ virtual int GetCode0_0x80000000(cBgS_PolyInfo const &) override; + /* 0x0AC */ virtual int GetLinkNo(cBgS_PolyInfo const &) override; + /* 0x0B0 */ virtual s32 GetWallCode(cBgS_PolyInfo const &) override; + /* 0x0B4 */ virtual int GetPolyAtt0Material(cBgS_PolyInfo const &) override; + /* 0x0B8 */ virtual int GetPolyAtt0(cBgS_PolyInfo const &) override; + /* 0x0Bc */ virtual int GetPolyAtt1(cBgS_PolyInfo const &) override; + /* 0x0C0 */ virtual int GetGroundCode(cBgS_PolyInfo const &) override; + /* 0x0C4 */ virtual u32 GetCode1_0x02000000(int) override; + /* 0x0C8 */ virtual u32 GetCode1_0x04000000(int) override; + /* 0x0CC */ virtual u32 GetCode1_0x08000000(int) override; + /* 0x0D0 */ virtual u32 GetLightingCode(cBgS_PolyInfo const &) override; + /* 0x0D4 */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const &) override; + /* 0x0D8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const &) override; + /* 0x0DC */ virtual s32 GetRoomPathId(cBgS_PolyInfo const &) override; + /* 0x0E0 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const &) override; + /* 0x0E4 */ virtual void CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0E8 */ virtual void TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0EC */ virtual void + MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0FC */ virtual bool UpdateDraw(mAllocator_c *) override; + /* 0x100 */ virtual bool GetIsDraw(int) override; + /* 0x104 */ virtual void DrawOnMap(int, bool) override; + + KC_PrismData *GetPrismData(int poly_index) const { + return &mpKCHead->mpPrismData[poly_index]; + } + mVec3_c *GetTriPos(const KC_PrismData *pd) const { + return &mpKCHead->mpPositionData[pd->mPosIdx]; + } + mVec3_c *GetTriNrm(const KC_PrismData *pd) const { + return &mpKCHead->mpNormalData[pd->mFaceNrmIdx]; + } + mVec3_c *GetEdgeNrm1(const KC_PrismData *pd) const { + return &mpKCHead->mpNormalData[pd->mEdgeNrmIdx1]; + } + mVec3_c *GetEdgeNrm2(const KC_PrismData *pd) const { + return &mpKCHead->mpNormalData[pd->mEdgeNrmIdx2]; + } + mVec3_c *GetEdgeNrm3(const KC_PrismData *pd) const { + return &mpKCHead->mpNormalData[pd->mEdgeNrmIdx3]; + } + + const dBgPc *GetPolyCode(int polyIdx) const { + return mCode.GetDBgPc(mpKCHead->mpPrismData[polyIdx].mAttribute); + } + + KC_Tri *GetTri(int idx) { + return &mpTri[idx]; + } + +private: + /* 0x12C */ pkcdata *mpKCHead; + /* 0x130 */ dBgPlc mCode; + /* 0x134 */ cM3dGAab mBnd; + /* 0x14C */ u32 mNumPrism; + /* 0x150 */ u32 mAreaWidthMaskX; + /* 0x154 */ u32 mAreaWidthMaskY; + /* 0x158 */ u32 mAreaWidthMaskZ; + /* 0x15C */ KC_Tri *mpTri; +}; + +#endif /* D_BG_D_BG_W_KCOL_H */ diff --git a/include/d/col/bg/d_bg_w_sv.h b/include/d/col/bg/d_bg_w_sv.h new file mode 100644 index 00000000..7fa38b15 --- /dev/null +++ b/include/d/col/bg/d_bg_w_sv.h @@ -0,0 +1,30 @@ +#ifndef D_BG_W_SV_H +#define D_BG_W_SV_H + +#include "d/col/bg/d_bg_w.h" + +class dBgWSv : public dBgW { +public: + dBgWSv(); + + bool Set(cBgD_t *pDzb, PLC *pPlc, u32 p3, bool p4); + void CopyBackVtx(); + bool CrrPosWork(mVec3_c *, int, int, int); + bool TransPosWork(mVec3_c *, int, int, int); + void ApplyMtx(mMtx_c *); + + void SetTriHeight(int, f32); + nw4r::math::VEC3 *GetTri(int); + + virtual ~dBgWSv(); + /* 0x0E4 */ virtual void CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0E8 */ virtual void TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0EC */ virtual void + MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + +private: + /* 0x210 */ nw4r::math::VEC3 *mpVtx; + /* 0x214 */ u32 mField_0x214; +}; + +#endif diff --git a/include/d/col/bg/d_bg_w_time.h b/include/d/col/bg/d_bg_w_time.h new file mode 100644 index 00000000..18e72081 --- /dev/null +++ b/include/d/col/bg/d_bg_w_time.h @@ -0,0 +1,82 @@ +#ifndef D_BG_W_TIME_H +#define D_BG_W_TIME_H + +#include "d/col/bg/d_bg_w_base.h" +#include "d/col/c/c_bg_s_chk.h" +#include "d/col/c/c_m3d_g_cyl.h" + +class dBgWTime : public dBgW_Base { +public: + dBgWTime(); + + bool fn_803537a0(mVec3_c *, cBgS_Chk *); + void fn_80353a00(cBgS_PolyInfo *, mVec3_c *); + + /* vt at 0x08 */ + /* 0x008 */ virtual ~dBgWTime(); + /* 0x014 */ virtual void GetTopUnder(f32 *pOutTop, f32 *pOutUnder) const override; + /* 0x018 */ virtual bool ChkNotReady() const override; + /* 0x01C */ virtual bool ChkLock() const override; + /* 0x020 */ virtual bool ChkMoveBg() const override; + /* 0x024 */ virtual u32 ChkMoveFlag() const override; + /* 0x028 */ virtual void GetTriPla(cBgS_PolyInfo const &, cM3dGPla *) const; + /* 0x02C */ virtual bool GetTriPnt(cBgS_PolyInfo const &, mVec3_c *, mVec3_c *, mVec3_c *) const override; + /* 0x030 */ virtual const cM3dGAab *GetBnd() const override; + /* 0x034 */ virtual u32 GetGrpInf(cBgS_PolyInfo const &) const override; + /* 0x038 */ virtual void OffMoveFlag() override; + /* 0x03C */ virtual void vt_0x3C() override; + /* 0x040 */ virtual bool LineCheck(cBgS_LinChk *) override; + /* 0x044 */ virtual bool GroundCross(cBgS_GndChk *) override; + /* 0x048 */ virtual void ShdwDraw(cBgS_ShdwDraw *) override; + /* 0x04C */ virtual void CaptPoly(dBgS_CaptPoly &) override; + /* 0x050 */ virtual bool WallCorrect(dBgS_Acch *) override; + /* 0x054 */ virtual bool WallCorrectSort(dBgS_Acch *) override; + /* 0x058 */ virtual bool RoofChk(dBgS_RoofChk *) override; + /* 0x05C */ virtual bool SplGrpChk(dBgS_SplGrpChk *) override; + /* 0x060 */ virtual bool SphChk(dBgS_SphChk *, void *) override; + /* 0x064 */ virtual s32 GetGrpRoomIndex(cBgS_PolyInfo const &) const override; + /* 0x068 */ virtual s32 GetExitId(cBgS_PolyInfo const &) override; + /* 0x06C */ virtual s32 GetZTargetThrough(cBgS_PolyInfo const &) override; + /* 0x070 */ virtual int GetSpecialCode(cBgS_PolyInfo const &) override; + /* 0x074 */ virtual int GetSpecialCode(int) override; + /* 0x078 */ virtual int GetCode0_0x30000000(cBgS_PolyInfo const &) override; + /* 0x07C */ virtual u32 GetPolyObjThrough(int) override; + /* 0x080 */ virtual u32 GetPolyCamThrough(int) override; + /* 0x084 */ virtual u32 GetPolyLinkThrough(int) override; + /* 0x088 */ virtual u32 GetPolyArrowThrough(int) override; + /* 0x08C */ virtual u32 GetPolySlingshotThrough(int) override; + /* 0x090 */ virtual u32 GetPolyBeetleThrough(int) override; + /* 0x094 */ virtual u32 GetPolyClawshotThrough(int) override; + /* 0x098 */ virtual u32 GetPolyBombThrough(int) override; + /* 0x09C */ virtual u32 GetPolyWhipThrough(int) override; + /* 0x0A0 */ virtual u32 GetShdwThrough(int) override; + /* 0x0A4 */ virtual u32 GetUnderwaterRoofCode(int) override; + /* 0x0A8 */ virtual int GetCode0_0x80000000(cBgS_PolyInfo const &) override; + /* 0x0AC */ virtual int GetLinkNo(cBgS_PolyInfo const &) override; + /* 0x0B0 */ virtual s32 GetWallCode(cBgS_PolyInfo const &) override; + /* 0x0B4 */ virtual int GetPolyAtt0Material(cBgS_PolyInfo const &) override; + /* 0x0B8 */ virtual int GetPolyAtt0(cBgS_PolyInfo const &) override; + /* 0x0Bc */ virtual int GetPolyAtt1(cBgS_PolyInfo const &) override; + /* 0x0C0 */ virtual int GetGroundCode(cBgS_PolyInfo const &) override; + /* 0x0C4 */ virtual u32 GetCode1_0x02000000(int) override; + /* 0x0C8 */ virtual u32 GetCode1_0x04000000(int) override; + /* 0x0CC */ virtual u32 GetCode1_0x08000000(int) override; + /* 0x0D0 */ virtual u32 GetLightingCode(cBgS_PolyInfo const &) override; + /* 0x0D4 */ virtual s32 GetCamMoveBG(cBgS_PolyInfo const &) override; + /* 0x0D8 */ virtual s32 GetRoomCamId(cBgS_PolyInfo const &) override; + /* 0x0DC */ virtual s32 GetRoomPathId(cBgS_PolyInfo const &) override; + /* 0x0E0 */ virtual s32 GetRoomPathPntNo(cBgS_PolyInfo const &) override; + /* 0x0E4 */ virtual void CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0E8 */ virtual void TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x0EC */ virtual void + MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) override; + /* 0x100 */ virtual bool GetIsDraw(int) override; + /* 0x104 */ virtual void DrawOnMap(int, bool) override; + + /* 0x12C */ cM3dGCyl mCyl; + /* 0x140 */ cM3dGAab mBnd; + + static cBgD_Vtx_t sVtx[3]; +}; + +#endif diff --git a/include/d/col/c/c_bg_s_chk.h b/include/d/col/c/c_bg_s_chk.h new file mode 100644 index 00000000..c7acf88f --- /dev/null +++ b/include/d/col/c/c_bg_s_chk.h @@ -0,0 +1,74 @@ +#ifndef C_BG_S_CHK_H +#define C_BG_S_CHK_H + +#include "d/col/bg/d_bg_w_base.h" +#include "d/col/c/c_partition.h" +#include "f/f_base.h" +#include "rvl/MTX.h" + +struct cBgD_Vtx_t : public nw4r::math::VEC3 {}; + +class cBgS_GrpPassChk { +public: + cBgS_GrpPassChk(); + virtual ~cBgS_GrpPassChk(); +}; + +class cBgS_PolyPassChk; + +class cBgS_Chk { +public: + /* 0x00 */ cBgS_PolyPassChk *mPolyPassChk; + /* 0x04 */ cBgS_GrpPassChk *mGrpPassChk; + /* 0x08 */ u32 mActorId; + /* 0x0C */ u16 mField_0x0C; + /* 0x0E */ u16 mField_0x0E; + /* 0x10 */ u8 mField_0x10; + /* 0x14 */ cPartition mPartition; + /* 0x24 */ // __vtable__ + +public: + cBgS_Chk(); + virtual ~cBgS_Chk(); + void SetActorID(u32 *); + + void SetPolyPassChk(cBgS_PolyPassChk *p_chk) { + mPolyPassChk = p_chk; + } + void SetGrpPassChk(cBgS_GrpPassChk *p_chk) { + mGrpPassChk = p_chk; + } + cBgS_PolyPassChk *GetPolyPassChk() const { + return mPolyPassChk; + } + cBgS_GrpPassChk *GetGrpPassChk() const { + return mGrpPassChk; + } + + int ChkSameActorPid(const fBase_c *pActor) const { + int id = pActor ? pActor->unique_ID : 0; + if (id == 0 || mActorId == 0 || mField_0x10 == 0) { + return false; + } + return mActorId == id ? 1 : 0; + } + + bool ChkField_0xC(const dBgW_Base *pBg) const { + return mField_0x0C & pBg->GetField_0x20(); + } + + bool ChkField_0xE(const dBgW_Base *pBg) const { + return mField_0x0E & pBg->GetField_0x22(); + } + + void SetExtChk(const cBgS_Chk &other) { + mPolyPassChk = other.mPolyPassChk; + mGrpPassChk = other.mGrpPassChk; + mActorId = other.mActorId; + mField_0x10 = other.mField_0x10; + mField_0x0C = other.mField_0x0C; + mField_0x0E = other.mField_0x0E; + } +}; + +#endif diff --git a/include/d/col/c/c_bg_s_gnd_chk.h b/include/d/col/c/c_bg_s_gnd_chk.h new file mode 100644 index 00000000..05e8489f --- /dev/null +++ b/include/d/col/c/c_bg_s_gnd_chk.h @@ -0,0 +1,41 @@ +#ifndef C_BG_S_GND_CHK_H +#define C_BG_S_GND_CHK_H + +#include "d/col/c/c_bg_s_chk.h" +#include "d/col/c/c_bg_s_poly_info.h" +#include "m/m_vec.h" + +class cBgS_GndChk : public cBgS_Chk, public cBgS_PolyInfo { +public: + /* 0x54 */ mVec3_c mPos; + /* 0x60 */ f32 mNowY; + /* 0x64 */ u8 unk0x64[0x68 - 0x64]; + /* 0x68 */ mVec3_c mField_0x68; + /* 0x74 */ u8 mField_0x74; + + cBgS_GndChk(); + virtual ~cBgS_GndChk(); + void SetPos(mVec3_c const &); + void SetPos(mVec3_c const *); + + f32 GetNowY() const { + return mNowY; + } + void SetNowY(f32 y) { + mNowY = y; + } + const mVec3_c &GetPointP() { + return mPos; + } + void SetField_0x68(const mVec3_c &other) { + mField_0x68 = other; + } + // u32 GetWallPrecheck() const { + // return mWallPrecheck; + // } + // void OffWall() { + // mFlags &= ~2; + // } +}; + +#endif diff --git a/include/d/col/c/c_bg_s_lin_chk.h b/include/d/col/c/c_bg_s_lin_chk.h new file mode 100644 index 00000000..4d5e8141 --- /dev/null +++ b/include/d/col/c/c_bg_s_lin_chk.h @@ -0,0 +1,65 @@ +#ifndef C_BG_S_LIN_CHK_H +#define C_BG_S_LIN_CHK_H + +#include "d/col/c/c_bg_s_chk.h" +#include "d/col/c/c_bg_s_poly_info.h" +#include "d/col/c/c_m3d_g_lin.h" + +class cBgS_LinChk : public cBgS_Chk, public cBgS_PolyInfo { +public: + /* 0x54 */ cM3dGLin mLin; + /* 0x6C */ mVec3_c mField_0x6C; + /* 0x78 */ bool mFrontFlag; + /* 0x79 */ bool mBackFlag; + /* 0x7A */ bool mHit; + /* 0x7B */ bool mPreRoofChk; + /* 0x7C */ bool mPreWallChk; + /* 0x7D */ bool mPreGroundChk; + + cBgS_LinChk(); + virtual ~cBgS_LinChk(); + virtual void SetEnd(const mVec3_c *); + + void Ct(); + void Set2(const mVec3_c &, const mVec3_c &, u32); + + bool ChkHit() const { + return mHit; + } + void ClrHit() { + mHit = false; + } + void SetHit() { + mHit = true; + } + bool ChkBackFlag() const { + return mBackFlag; + } + void OnBackFlag() { + mBackFlag = true; + } + bool ChkFrontFlag() const { + return mFrontFlag; + } + void OnFrontFlag() { + mFrontFlag = true; + } + bool GetPreWallChk() const { + return mPreWallChk; + } + bool GetPreGroundChk() const { + return mPreGroundChk; + } + bool GetPreRoofChk() const { + return mPreRoofChk; + } + + const mVec3_c &GetLinStart() const { + return mLin.mStart; + } + const mVec3_c &GetLinEnd() const { + return mLin.mEnd; + } +}; + +#endif diff --git a/include/d/col/c/c_bg_s_poly_info.h b/include/d/col/c/c_bg_s_poly_info.h new file mode 100644 index 00000000..7ab2943f --- /dev/null +++ b/include/d/col/c/c_bg_s_poly_info.h @@ -0,0 +1,62 @@ +#ifndef C_BG_S_POLY_INFO_H +#define C_BG_S_POLY_INFO_H + +#include "common.h" +#include "d/col/c/c_bg_w.h" +#include "d/col/c/c_m3d_g_pla.h" +#include "m/m_vec.h" + +class cBgS_PolyInfo { +private: + /* 0x00 */ int mPolyIndex; + /* 0x04 */ int mBgIndex; + /* 0x08 */ void *unk_0x04; // Collision Pointer? + /* 0x0C */ int mActorPId; // Matched the Unique Actor Id + /* 0x10 */ cM3dGPla mPla; + /* 0x20 */ mVec3_c mField_0x20; + +public: + cBgS_PolyInfo() { + ClearPi(); + } + bool ChkSetInfo() const; + void SetPolyInfo(const cBgS_PolyInfo &); + bool ChkSafe(const void *, s32) const; + void SetPolyIndex(int idx) { + mPolyIndex = idx; + } + bool ChkBgIndex() const; + mAng GetAngle(mAng) const; + + void SetActorInfo(int bgIndex, void *pData, u32 actor_pid) { + mBgIndex = bgIndex; + unk_0x04 = pData; + mActorPId = actor_pid; + } + + void ClearPi() { + mPolyIndex = 0xFFFF; + mBgIndex = BG_ID_MAX; + unk_0x04 = nullptr; + mActorPId = 0; + } + + u32 GetPolyIndex() const { + return mPolyIndex; + } + u32 GetBgIndex() const { + return mBgIndex; + } + const cM3dGPla &GetPlane() const { + return mPla; + } + cM3dGPla *GetPlaneP() { + return &mPla; + } + + const mVec3_c &GetField0x20() const { + return mField_0x20; + } +}; + +#endif diff --git a/include/d/col/c/c_bg_s_shdw_draw.h b/include/d/col/c/c_bg_s_shdw_draw.h new file mode 100644 index 00000000..2018d720 --- /dev/null +++ b/include/d/col/c/c_bg_s_shdw_draw.h @@ -0,0 +1,33 @@ +#ifndef C_BG_S_SHDW_DRAW_H +#define C_BG_S_SHDW_DRAW_H + +#include "common.h" +#include "d/col/c/c_bg_s_chk.h" +#include "d/col/c/c_m3d_g_lin.h" +#include "d/col/c/c_m3d_g_pla.h" +#include "d/col/c/c_m3d_g_tri.h" +#include "m/m_vec.h" + +class cBgS_ShdwDraw; +typedef void (*cBgS_ShdwDraw_Callback)(cBgS_ShdwDraw *, const mVec3_c &, const mVec3_c &, const mVec3_c &, const cM3dGTri &); + +class cBgS_ShdwDraw : public cBgS_Chk { +public: + /* 0x28 */ cM3dGAab mBnd; + /* 0x40 */ cM3dGPla *mpPla; + /* 0x44 */ cBgS_ShdwDraw_Callback mpCallback; + + cBgS_ShdwDraw(); + virtual ~cBgS_ShdwDraw(); + + void Set(const mVec3_c &, const mVec3_c &); + void SetCallback(cBgS_ShdwDraw_Callback); + void SetP(cM3dGPla *); + void Calc(cM3dGTri *, mVec3_c *, mVec3_c *, mVec3_c *); + + cM3dGAab *GetBndP() { + return &mBnd; + } +}; + +#endif diff --git a/include/d/col/c/c_bg_w.h b/include/d/col/c/c_bg_w.h new file mode 100644 index 00000000..54898265 --- /dev/null +++ b/include/d/col/c/c_bg_w.h @@ -0,0 +1,62 @@ +#ifndef C_BG_W_H +#define C_BG_W_H + +#include "common.h" + +enum { + BG_ID_MAX = 600 +}; + +class cBgW_BgId { +private: + /* 0x0 */ s16 m_id; + /* 0x4 vtable */ + +public: + cBgW_BgId(); + void Ct() { + m_id = BG_ID_MAX; + }; + + void Regist(int); + void Release(); + bool ChkUsed() const; + + virtual ~cBgW_BgId(); + + s16 GetId() const { + return m_id; + } +}; + +// Defines are required for these checks to not inline some float comp bool things +#if 1 + +#define cBgW_CheckBGround(f) (f > 0.5f) +#define cBgW_CheckBRoof(f) (f < (-4.0f / 5.0f)) + +inline bool cBgW_CheckBWall(f32 a1) { + if (!cBgW_CheckBGround(a1) && !cBgW_CheckBRoof(a1)) { + return true; + } + + return false; +} + +#else +inline bool cBgW_CheckBGround(f32 f) { + return f > 0.5f; +} +inline bool cBgW_CheckBRoof(f32 a1) { + return a1 <= (-4.0f / 5.0f); +} +inline bool cBgW_CheckBWall(f32 a1) { + if (!cBgW_CheckBGround(a1) && !cBgW_CheckBRoof(a1)) { + return true; + } + + return false; +} +#endif + +#endif diff --git a/include/d/col/c/c_cc_d.h b/include/d/col/c/c_cc_d.h new file mode 100644 index 00000000..be4685be --- /dev/null +++ b/include/d/col/c/c_cc_d.h @@ -0,0 +1,4 @@ +#ifndef C_CC_D_H +#define C_CC_D_H + +#endif diff --git a/include/d/col/c/c_cc_s.h b/include/d/col/c/c_cc_s.h new file mode 100644 index 00000000..9eccad82 --- /dev/null +++ b/include/d/col/c/c_cc_s.h @@ -0,0 +1,60 @@ +#ifndef C_CC_S_H +#define C_CC_S_H + +#include "d/col/c/c_cc_d.h" + +enum WeightType { + WeightType_0 = 0, + WeightType_1 = 1, + WeightType_2 = 2, +}; + +// class cCcS { +// public: +// /* 0x0000 */ cCcD_Obj *mpObjAt[0x100]; +// /* 0x0400 */ cCcD_Obj *mpObjTg[0x300]; +// /* 0x1000 */ cCcD_Obj *mpObjCo[0x100]; +// /* 0x1400 */ cCcD_Obj *mpObj[0x500]; +// /* 0x2800 */ u16 mObjAtCount; +// /* 0x2802 */ u16 mObjTgCount; +// /* 0x2804 */ u16 mObjCoCount; +// /* 0x2806 */ u16 mObjCount; +// /* 0x2808 */ cCcD_DivideArea mDivideArea; +// /* 0x2848 vtable */ + +// /* 80264A6C */ cCcS(); +// /* 80264A94 */ void Ct(); +// /* 80264B60 */ void Dt(); +// /* 80264B80 */ WeightType GetWt(u8) const; +// /* 80264BA8 */ void Set(cCcD_Obj *); +// /* 80264C5C */ void ClrCoHitInf(); +// /* 80264CF0 */ void ClrTgHitInf(); +// /* 80264D90 */ void ClrAtHitInf(); +// /* 80264E2C */ bool ChkNoHitAtTg(cCcD_Obj *, cCcD_Obj *); +// /* 80264F40 */ void ChkAtTg(); +// /* 8026515C */ bool ChkNoHitCo(cCcD_Obj *, cCcD_Obj *); +// /* 80265230 */ void ChkCo(); +// /* 802653A0 vt[2] */ virtual void CalcTgPlusDmg(cCcD_Obj *, cCcD_Obj *, cCcD_Stts *, cCcD_Stts *); +// /* 802653C8 */ void SetAtTgCommonHitInf(cCcD_Obj *, cCcD_Obj *, cXyz *); +// /* 802655E4 */ void SetCoCommonHitInf(cCcD_Obj *, cXyz *, cCcD_Obj *, cXyz *, f32); +// /* 80265750 vt[3]*/ virtual void SetPosCorrect(cCcD_Obj *, cXyz *, cCcD_Obj *, cXyz *, f32); +// /* 80265BB4 */ void CalcArea(); +// /* 80265CCC */ void Move(); +// /* 80265D30 */ void DrawClear(); +// /* 80265DF8 vt[4] */ virtual void +// SetCoGObjInf(bool, bool, cCcD_GObjInf *, cCcD_GObjInf *, cCcD_Stts *, cCcD_Stts *, cCcD_GStts *, cCcD_GStts *); +// /* 80265DFC vt[5] */ virtual void +// SetAtTgGObjInf(bool, bool, cCcD_Obj *, cCcD_Obj *, cCcD_GObjInf *, cCcD_GObjInf *, cCcD_Stts *, cCcD_Stts *, +// cCcD_GStts *, cCcD_GStts *, cXyz *); +// /* 80265E00 vt[6] */ virtual bool +// ChkNoHitGAtTg(cCcD_GObjInf const *, cCcD_GObjInf const *, cCcD_GStts *, cCcD_GStts *); +// /* 80265E08 vt[7] */ virtual bool +// ChkAtTgHitAfterCross(bool, bool, cCcD_GObjInf const *, cCcD_GObjInf const *, cCcD_Stts *, cCcD_Stts *, cCcD_GStts *, +// cCcD_GStts *); +// /* 80265E10 vt[8] */ virtual bool ChkNoHitGCo(cCcD_Obj *, cCcD_Obj *); +// /* 80030BDC vt[9] */ virtual ~cCcS() {} +// /* 80265E18 vt[10] */ virtual void MoveAfterCheck(); +// /* 80265DF4 vt[11] */ virtual void SetCoGCorrectProc(cCcD_Obj *, cCcD_Obj *); +// }; // Size = 0x284C + +#endif /* C_CC_S_H */ diff --git a/include/d/col/c/c_m2d.h b/include/d/col/c/c_m2d.h new file mode 100644 index 00000000..559f565c --- /dev/null +++ b/include/d/col/c/c_m2d.h @@ -0,0 +1,8 @@ +#ifndef C_M2D_H +#define C_M2D_H + +struct cM2dGCir; + +void cM2d_CrossCirLin(cM2dGCir &, float, float, float, float, float *, float *); + +#endif diff --git a/include/d/col/c/c_m3d.h b/include/d/col/c/c_m3d.h new file mode 100644 index 00000000..65a1cbf0 --- /dev/null +++ b/include/d/col/c/c_m3d.h @@ -0,0 +1,106 @@ +#ifndef C_M3D_H +#define C_M3D_H + +#include "nw4r/math.h" + +#include +#include + +class cM3dGAab; +class cM3dGCps; +class cM3dGCyl; +class cM3dGLin; +class cM3dGPla; +class cM3dGSph; +class cM3dGTri; +class cM3dGUnk; +class mAng3_c; +struct cM3d_Range; + +struct nw4r::math::VEC3; + +extern const f32 G_CM3D_F_ABS_MIN; + +bool cM3d_Len2dSqPntAndSegLine(f32, f32, f32, f32, f32, f32, f32 *, f32 *, f32 *); +bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin *, const nw4r::math::VEC3 *, nw4r::math::VEC3 *, f32 *, f32 *); +f32 cM3d_SignedLenPlaAndPos(const cM3dGPla *, const nw4r::math::VEC3 *); +void cM3d_CalcPla(const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, nw4r::math::VEC3 *, f32 *); +int cM3d_Check_LinLin(const cM3dGLin *, const cM3dGLin *, f32 *, f32 *); +bool cM3d_Cross_LinPla(const cM3dGLin *, const cM3dGPla *, nw4r::math::VEC3 *, bool, bool); +bool cM3d_Cross_MinMaxBoxLine(const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *); +bool cM3d_InclusionCheckPosIn3PosBox3d( + const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, f32 +); +bool cM3d_CrossX_Tri(const cM3dGTri *, const nw4r::math::VEC3 *, f32); +bool cM3d_CrossX_Tri(const cM3dGTri *, const nw4r::math::VEC3 *); +bool cM3d_CrossY_Tri(const cM3dGTri *, const nw4r::math::VEC3 *); +bool cM3d_CrossY_Tri_Front(const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 *); +bool cM3d_CrossY_Tri(const cM3dGTri *, const nw4r::math::VEC3 *, f32 *); +bool cM3d_CrossY_Tri(const cM3dGTri *, const nw4r::math::VEC3 *, f32); +bool cM3d_CrossY_Tri(const cM3dGTri *, const nw4r::math::VEC3 *, const cM3d_Range *, f32 *); +bool cM3d_CrossZ_Tri(const cM3dGTri *, const nw4r::math::VEC3 *, f32); +bool cM3d_CrossZ_Tri(const cM3dGTri *, const nw4r::math::VEC3 *); +bool cM3d_CrossZ_Tri(const cM3dGTri *, const nw4r::math::VEC3 *, f32 *); +bool cM3d_Cross_LinTri(const cM3dGLin *, const cM3dGTri *, nw4r::math::VEC3 *, bool, bool); +bool cM3d_Cross_LinTri( + const cM3dGLin *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, const cM3dGPla *, + nw4r::math::VEC3 *, bool, bool +); +bool cM3d_Cross_LinTri_Easy(const cM3dGTri *, const nw4r::math::VEC3 *); +bool cM3d_Cross_SphPnt(const cM3dGSph *, const nw4r::math::VEC3 *); +bool cM3d_Cross_LinSph(const cM3dGLin *, const cM3dGSph *, nw4r::math::VEC3 *); +bool cM3d_Cross_LinSph_CrossPos(const cM3dGSph &, const cM3dGLin &, nw4r::math::VEC3 *, nw4r::math::VEC3 *); +bool cM3d_Cross_CylSph(const cM3dGCyl *, const cM3dGSph *, f32 *); +bool cM3d_Cross_CylSph(const cM3dGCyl *, const cM3dGSph *, nw4r::math::VEC3 *, f32 *); +bool cM3d_Cross_SphSph(const cM3dGSph *, const cM3dGSph *, f32 *); +bool cM3d_Cross_SphSph(const cM3dGSph *, const cM3dGSph *, f32 *, f32 *); +bool cM3d_Cross_SphSph(const cM3dGSph *, const cM3dGSph *, nw4r::math::VEC3 *); +void cM3d_CalcSphVsTriCrossPoint(const cM3dGSph *, const cM3dGTri *, nw4r::math::VEC3 *); +bool cM3d_Cross_SphTri(const cM3dGSph *, const cM3dGTri *, nw4r::math::VEC3 *, f32 *, nw4r::math::VEC3 *); +bool cM3d_Cross_CylCyl(const cM3dGCyl *, const cM3dGCyl *, f32 *); +bool cM3d_Cross_CylCyl(const cM3dGCyl *, const cM3dGCyl *, nw4r::math::VEC3 *); +bool cM3d_Cross_CylTri(const cM3dGCyl *, const cM3dGTri *, nw4r::math::VEC3 *); +int cM3d_Cross_CylLin(const cM3dGCyl *, const cM3dGLin *, nw4r::math::VEC3 *, nw4r::math::VEC3 *); +int cM3d_Cross_CylPntPnt(const cM3dGCyl *, const nw4r::math::VEC3 *, const nw4r::math::VEC3 *, nw4r::math::VEC3 *, nw4r::math::VEC3 *); +bool cM3d_Cross_CylPnt(const cM3dGCyl *, const nw4r::math::VEC3 *); +bool cM3d_Cross_CpsSph_CrossPos(const cM3dGCps &, const cM3dGSph &, const nw4r::math::VEC3 &, nw4r::math::VEC3 *); +bool cM3d_Cross_CpsSph(const cM3dGCps &, const cM3dGSph &, nw4r::math::VEC3 *); +bool cM3d_Cross_TriTri(const cM3dGTri &, const cM3dGTri &, nw4r::math::VEC3 *); +bool cM3d_Cross_CpsTri(const cM3dGCps &, cM3dGTri, nw4r::math::VEC3 *); +void cM3d_CalcVecZAngle(const nw4r::math::VEC3 &, mAng3_c *); +void cM3d_PlaneCrossLineProcWork(f32, f32, f32, f32, f32, f32, f32, f32 *, f32 *); +int cM3d_2PlaneCrossLine(const cM3dGPla &, const cM3dGPla &, cM3dGLin *); +bool cM3d_3PlaneCrossPos(const cM3dGPla &, const cM3dGPla &, const cM3dGPla &, nw4r::math::VEC3 *); +f32 cM3d_lineVsPosSuisenCross(const cM3dGLin *, const nw4r::math::VEC3 *, nw4r::math::VEC3 *); +f32 cM3d_lineVsPosSuisenCross(const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, const nw4r::math::VEC3 &, nw4r::math::VEC3 *); + +bool fn_803354e0(cM3dGUnk *, cM3dGUnk *, nw4r::math::VEC3 *); +bool fn_80336110(cM3dGCyl *, cM3dGUnk *, nw4r::math::VEC3 *); +bool fn_803364e0(cM3dGCyl *, cM3dGUnk *, f32 *); +bool fn_80336d90(cM3dGCps *, cM3dGUnk *, nw4r::math::VEC3 *); +bool fn_80337690(cM3dGUnk *, cM3dGSph *, nw4r::math::VEC3 *); +bool fn_80337780(cM3dGUnk *, cM3dGSph *, f32 *); + +inline bool cM3d_IsZero(f32 f) { + return fabsf(f) < G_CM3D_F_ABS_MIN; +} +// this is the inline cM3d_IsZero but inverted. Sometimes this will get a match where the regular cM3d_IsZero inline +// won't +inline bool cM3d_IsZero_inverted(f32 param_0) { + return !(fabsf(param_0) < G_CM3D_F_ABS_MIN); +} + +inline void +cM3d_InDivPos1(const nw4r::math::VEC3 *pVecA, const nw4r::math::VEC3 *pVecB, f32 pF, nw4r::math::VEC3 *pOut) { + nw4r::math::VEC3 tmp; + VEC3Scale(&tmp, pVecB, pF); + VEC3Add(pOut, &tmp, pVecA); +} +inline void +cM3d_InDivPos2(const nw4r::math::VEC3 *pVecA, const nw4r::math::VEC3 *pVecB, f32 pF, nw4r::math::VEC3 *pOut) { + nw4r::math::VEC3 tmp; + VEC3Sub(&tmp, pVecB, pVecA); + cM3d_InDivPos1(pVecA, &tmp, pF, pOut); +} + +#endif diff --git a/include/d/col/c/c_m3d_g_aab.h b/include/d/col/c/c_m3d_g_aab.h new file mode 100644 index 00000000..b72425b9 --- /dev/null +++ b/include/d/col/c/c_m3d_g_aab.h @@ -0,0 +1,87 @@ +#ifndef C_M3D_G_AAB_H +#define C_M3D_G_AAB_H + +#include "d/col/c/c_m3d.h" +#include "d/col/c/c_m3d_g_lin.h" +#include "d/col/c/c_m3d_g_sph.h" + +#include + +// Axis aligned bounding box +class cM3dGAab { +private: +public: + /* 0x00 */ mVec3_c mMin; + /* 0x0C */ mVec3_c mMax; + + void SetBounds(const mVec3_c &, const mVec3_c &); + + void Set(const mVec3_c &min, const mVec3_c &max) { + mMin = min; + mMax = max; + } + bool CrossY(const mVec3_c &) const; + bool UnderPlaneYUnder(f32) const; + bool TopPlaneYUnder(f32) const; + void SetMinMax(const cM3dGAab &); + void SetMin(const mVec3_c &min); + void SetMax(const mVec3_c &max); + void CalcCenter(mVec3_c &) const; + void PlusR(f32); + void Clamp(const mVec3_c &, mVec3_c &) const; + void Set(const cM3dGSph &); + bool Cross(const mVec3_c &) const; + + void SetMinMax(const mVec3_c &minMax) { + SetMin(minMax); + SetMax(minMax); + } + + void ClearForMinMax(void) { + mMin.z = 1000000000.0f; + mMin.y = 1000000000.0f; + mMin.x = 1000000000.0f; + mMax.z = -1000000000.0f; + mMax.y = -1000000000.0f; + mMax.x = -1000000000.0f; + } + + const mVec3_c *GetMaxP(void) const { + return &mMax; + } + const mVec3_c *GetMinP(void) const { + return &mMin; + } + const f32 GetMaxX(void) const { + return mMax.x; + } + const f32 GetMaxY(void) const { + return mMax.y; + } + const f32 GetMaxZ(void) const { + return mMax.z; + } + const f32 GetMinX(void) const { + return mMin.x; + } + const f32 GetMinY(void) const { + return mMin.y; + } + const f32 GetMinZ(void) const { + return mMin.z; + } + bool Cross(const cM3dGLin *pLin) { + return cM3d_Cross_MinMaxBoxLine(mMin, mMax, pLin->mStart, pLin->mEnd); + } + // bool Cross(const cM3dGAab *param_1) { + // return cM3d_Cross_AabAab(this, param_1); + // } + // bool Cross(const cM3dGCyl *param_1) { + // return cM3d_Cross_AabCyl(this, param_1); + // } + // bool Cross(const cM3dGSph *param_1) { + // return cM3d_Cross_AabSph(this, param_1); + // } +}; + +#endif /* C_M3D_G_AAB_H */ diff --git a/include/d/col/c/c_m3d_g_cir.h b/include/d/col/c/c_m3d_g_cir.h new file mode 100644 index 00000000..9804c8b5 --- /dev/null +++ b/include/d/col/c/c_m3d_g_cir.h @@ -0,0 +1,35 @@ +#ifndef C_M3D_G_CIR_H +#define C_M3D_G_CIR_H + +#include "common.h" + +class cM2dGCir { +public: + f32 mPosX; + f32 mPosY; + f32 mRadius; + + f32 GetCx() const { + return mPosX; + } + f32 GetCy() const { + return mPosY; + } + f32 GetR() const { + return mRadius; + } + + cM2dGCir() {} + virtual ~cM2dGCir() {} +}; + +class cM3dGCir : public cM2dGCir { + f32 mPosZ; + +public: + cM3dGCir() {} + virtual ~cM3dGCir(){}; + void Set(f32, f32, f32, f32); +}; + +#endif diff --git a/include/d/col/c/c_m3d_g_cps.h b/include/d/col/c/c_m3d_g_cps.h new file mode 100644 index 00000000..d700e3bb --- /dev/null +++ b/include/d/col/c/c_m3d_g_cps.h @@ -0,0 +1,38 @@ +#ifndef C_M3D_G_CPS_H +#define C_M3D_G_CPS_H + +#include "d/col/c/c_m3d.h" +#include "d/col/c/c_m3d_g_lin.h" +#include "d/col/c/c_m3d_g_unk.h" +#include "m/m_vec.h" + +class cM3dGCps : public cM3dGLin { +public: + /* 0x18 */ f32 mRadius; + /* 0x1C */ f32 mField_0x1C; + /* 0x20 */ u8 mField_0x20; + /* 0x24 */ u32 mFlags; + + cM3dGCps(); + + void Set(const mVec3_c &, const mVec3_c &, f32); + void SetR(f32 r); + void Set_0x1C(f32); + bool fn_80337f30(cM3dGUnk *, mVec3_c *); + bool fn_80337f40(const mVec3_c &) const; + + f32 GetR() const { + return mRadius; + } + // bool Cross(cM3dGCps const *other, mVec3_c *xyz) const { + // return cM3d_Cross_CpsCps(*this, *other, xyz); + // } + // bool Cross(const cM3dGCyl *cyl, mVec3_c *xyz) const { + // return cM3d_Cross_CpsCyl(*this, *cyl, xyz); + // } + // bool Cross(const cM3dGSph *sph, mVec3_c *xyz) const { + // return cM3d_Cross_CpsSph(*this, *sph, xyz); + // } +}; + +#endif diff --git a/include/d/col/c/c_m3d_g_cyl.h b/include/d/col/c/c_m3d_g_cyl.h new file mode 100644 index 00000000..c0c0e067 --- /dev/null +++ b/include/d/col/c/c_m3d_g_cyl.h @@ -0,0 +1,30 @@ +#ifndef C_M3D_G_CYL_H +#define C_M3D_G_CYL_H + +#include +#include + +class cM3dGCyl { +public: + /* 0x00 */ mVec3_c mCenter; + /* 0x0C */ f32 mRadius; + /* 0x10 */ f32 mHeight; + cM3dGCyl() {} + + void Set(const mVec3_c &, f32, f32); + void SetC(const mVec3_c &, f32 radius, f32 height); + void SetC(const mVec3_c &); + void SetH(f32); + void SetR(f32); + + bool fn_803380e0(cM3dGUnk *, mVec3_c *); + bool fn_803380f0(cM3dGUnk *, f32 *); + bool Cross(const mVec3_c &) const; + void Clamp(const mVec3_c &, mVec3_c &) const; + + const mVec3_c &GetC() const { + return mCenter; + } +}; + +#endif diff --git a/include/d/col/c/c_m3d_g_lin.h b/include/d/col/c/c_m3d_g_lin.h new file mode 100644 index 00000000..a0f72aef --- /dev/null +++ b/include/d/col/c/c_m3d_g_lin.h @@ -0,0 +1,67 @@ +#ifndef C_M3D_G_LIN_H +#define C_M3D_G_LIN_H + +#include +#include + +class cM3dGLin { +public: + typedef nw4r::math::VEC3 VEC3; + typedef EGG::Vector3f Vector3f; + + /* 0x00 */ mVec3_c mStart; + /* 0x0C */ mVec3_c mEnd; + + cM3dGLin() {} + + void SetStartEnd(const VEC3 &, const VEC3 &); + void SetStartEnd(const mVec3_c *, const mVec3_c *); + + void Set(const mVec3_c &start, const mVec3_c &end) { + mStart = start; + mEnd = end; + } + void CalcPos(mVec3_c *, f32) const; + + void CalcVec(Vec *pOut) const { + PSVECSubtract(mEnd, mStart, pOut); + } + + void SetStart(const mVec3_c &); + void SetEnd(const mVec3_c *pEnd) { + mEnd = *pEnd; + } + + nw4r::math::VEC3 &GetStart() { + return mStart; + } + + const nw4r::math::VEC3 &GetStart() const { + return mStart; + } + + nw4r::math::VEC3 *GetStartP(void) { + return &mStart; + } + const nw4r::math::VEC3 *GetStartP(void) const { + return &mStart; + } + + nw4r::math::VEC3 &GetEnd() { + return mEnd; + } + + const nw4r::math::VEC3 &GetEnd() const { + return mEnd; + } + + nw4r::math::VEC3 *GetEndP(void) { + return &mEnd; + } + + const nw4r::math::VEC3 *GetEndP(void) const { + return &mEnd; + } +}; + +#endif /* C_M3D_G_LIN_H */ diff --git a/include/d/col/c/c_m3d_g_pla.h b/include/d/col/c/c_m3d_g_pla.h new file mode 100644 index 00000000..cac47fbe --- /dev/null +++ b/include/d/col/c/c_m3d_g_pla.h @@ -0,0 +1,58 @@ +#ifndef C_M3D_G_PLA_H +#define C_M3D_G_PLA_H + +#include "c/c_math.h" +#include "d/col/c/c_m3d.h" +#include "m/m_vec.h" + +// Plane with a normal +class cM3dGPla { +public: + /* 0x00 */ mVec3_c mNormal; + /* 0x0C */ f32 mD; + + cM3dGPla() {} + cM3dGPla(const mVec3_c *v, f32 f) { + mNormal = *v; + f = mD; + } + bool CrossInfLin(const mVec3_c &, const mVec3_c &, mVec3_c &) const; + bool getCrossYLessD(const mVec3_c &, f32 *) const; + mAng GetAngle(mAng) const; + mAng GetNegativeAngle(mAng) const; + + // Unused + // void SetupNP0(const mVec3_c &, const mVec3_c &); + // void SetupNP(const mVec3_c &, const mVec3_c &); + // bool getCrossY(const mVec3_c &, f32 *) const; + // void Set(const cM3dGPla *); + + f32 getPlaneFunc(const mVec3_c &pnt) const { + return mD + VEC3Dot(mNormal, pnt); + } + mVec3_c *GetNP() { + return &mNormal; + } + const mVec3_c *GetNP() const { + return &mNormal; + } + f32 GetD() const { + return mD; + } + void SetupFrom3Vtx(const nw4r::math::VEC3 *v1, const nw4r::math::VEC3 *v2, const nw4r::math::VEC3 *v3) { + cM3d_CalcPla(v1, v2, v3, &mNormal, &mD); + } + f32 getCrossY_NonIsZero(const mVec3_c *param_1) { + return ((-mNormal.x * param_1->x - mNormal.z * param_1->z) - mD) / mNormal.y; + } + + s32 GetAngleY() const { + return cM::atan2s(mNormal.x, mNormal.z); + } + + f32 GetXZDist() const { + return EGG::Math::sqrt(mNormal.x * mNormal.x + mNormal.z * mNormal.z); + } +}; + +#endif diff --git a/include/d/col/c/c_m3d_g_sph.h b/include/d/col/c/c_m3d_g_sph.h new file mode 100644 index 00000000..43480a97 --- /dev/null +++ b/include/d/col/c/c_m3d_g_sph.h @@ -0,0 +1,38 @@ +#ifndef C_M3D_G_SPH_H +#define C_M3D_G_SPH_H + +#include "d/col/c/c_m3d_g_tri.h" +#include "m/m_vec.h" + +class cM3dGSph { +public: + /* 0x00 */ mVec3_c mCenter; + /* 0x0C */ f32 mRadius; + /* 0x10 */ f32 mRatio; + cM3dGSph(); + + void SetC(const mVec3_c *); + void Set(const mVec3_c *, f32); + void SetR(f32); + void SetC(f32, f32, f32); + + f32 GetYDist(f32) const; + bool Cross(const cM3dGTri *, f32 *, mVec3_c *); + void Clamp(const mVec3_c &, mVec3_c &) const; + + bool fn_80338750(cM3dGUnk *, mVec3_c *); + bool fn_80338760(cM3dGUnk *, f32 *); + + void SetRatio(f32); + + const mVec3_c &GetC() const { + return mCenter; + } + + const f32 &GetR() const { + return mRadius; + } + +}; // Size = 0x14 + +#endif diff --git a/include/d/col/c/c_m3d_g_tri.h b/include/d/col/c/c_m3d_g_tri.h new file mode 100644 index 00000000..a6402cdc --- /dev/null +++ b/include/d/col/c/c_m3d_g_tri.h @@ -0,0 +1,25 @@ +#ifndef C_M3D_G_TRI_H +#define C_M3D_G_TRI_H + +#include "common.h" +#include "d/col/c/c_m3d_g_pla.h" + +class cM3dGTri : public cM3dGPla { + typedef nw4r::math::VEC3 VecType; + +public: + /* 0x10 */ VecType mA; + /* 0x1C */ VecType mB; + /* 0x28 */ VecType mC; + + cM3dGTri() {} + void SetPos(const VecType *, const VecType *, const VecType *); + + void SetBg(const VecType *, const VecType *, const VecType *, const cM3dGPla *pla); + + bool cross(const cM3dGLin *lin, VecType *xyz, bool param_2, bool param_3) const { + return cM3d_Cross_LinTri(lin, this, xyz, param_2, param_3); + } +}; + +#endif diff --git a/include/d/col/c/c_m3d_g_unk.h b/include/d/col/c/c_m3d_g_unk.h new file mode 100644 index 00000000..6d36035d --- /dev/null +++ b/include/d/col/c/c_m3d_g_unk.h @@ -0,0 +1,52 @@ +#ifndef C_M3D_G_UNK_H +#define C_M3D_G_UNK_H + +#include "d/col/c/c_m3d_g_cps.h" +#include "d/col/c/c_m3d_g_cyl.h" +#include "d/col/c/c_m3d_g_pla.h" +#include "d/col/c/c_m3d_g_sph.h" +#include "m/m_mtx.h" +#include "m/m_vec.h" + +#include + +class cM3dGUnk { +public: + /* 0x00 */ mMtx_c mMtx; + /* 0x30 */ mMtx_c mInvMtx; + /* 0x60 */ mVec3_c mMin; + /* 0x6C */ mVec3_c mMax; + /* 0x78 */ mVec3_c mField_0x78; + /* 0x84 */ mVec3_c mField_0x84; + /* 0x90 */ mVec3_c mField_0x90; + /* 0x9C */ mVec3_c mField_0x9C; + /* 0xA8 */ mVec3_c mField_0xA8; + /* 0xB4 */ u32 mField_0xB4; + /* 0xB8 */ mVec3_c mVirtCenter; + /* 0xC4 */ f32 mField_0xC4; + + cM3dGUnk(); + + /* vt at 0xC8*/ + virtual ~cM3dGUnk() {} + + void Set(const mVec3_c &, const mVec3_c &); + void Update(); + void GetStartEnd(mVec3_c &, mVec3_c &); + + void fn_80338c30(cM3dGCps *, mVec3_c *); + bool fn_80338c40(cM3dGUnk *, mVec3_c *); + bool fn_80338ca0(/* TODO */); + bool fn_80338cb0(cM3dGCyl *, mVec3_c *); + bool fn_80338cc0(cM3dGCyl *, f32 *); + bool fn_80338cd0(cM3dGSph *, mVec3_c *); + bool fn_80338ce0(cM3dGSph *, f32 *); + + void Set(const mMtx_c &); + void Set(const mVec3_c &, const mAng &); + bool Cross(const mVec3_c &); + void Clamp(const mVec3_c &, mVec3_c &); + void fn_80338f30(f32, f32); +}; + +#endif diff --git a/include/d/col/c/c_partition.h b/include/d/col/c/c_partition.h new file mode 100644 index 00000000..6f8d9e62 --- /dev/null +++ b/include/d/col/c/c_partition.h @@ -0,0 +1,36 @@ +#ifndef C_PARTITION_H +#define C_PARTITION_H + +/** + * File Made Up. + * Some Mask/Quick index into the collision octree + */ +#include "common.h" +#include "d/col/c/c_m3d_g_aab.h" + +class cPartition { +public: + // static u32 sShift; + // static u32 sMask; + + /* 0x0 */ u32 mX; + /* 0x4 */ u32 mY; + /* 0x8 */ u32 mZ; + + cPartition(); + + // vt at 0xC + virtual ~cPartition(); + + void Calc(mVec3_c *pPos); + + void fn_803391f0(const cM3dGAab *); + + void fn_80339740(mVec3_c *, f32); + void fn_803399b0(mVec3_c *); + static void fn_80338fb0(); + + static bool fn_80339070(const cM3dGAab *); +}; + +#endif diff --git a/include/toBeSorted/cc/d_cc_d.h b/include/d/col/cc/d_cc_d.h similarity index 92% rename from include/toBeSorted/cc/d_cc_d.h rename to include/d/col/cc/d_cc_d.h index be1d8452..f5a3664f 100644 --- a/include/toBeSorted/cc/d_cc_d.h +++ b/include/d/col/cc/d_cc_d.h @@ -1,13 +1,16 @@ -#ifndef TOSORT_D_CC_D_H -#define TOSORT_D_CC_D_H +#ifndef D_CC_D_H +#define D_CC_D_H #include +#include +#include +#include +#include +#include #include #include #include #include -#include -#include // Largely modeled off // https://github.com/zeldaret/tp/blob/main/include/SSystem/SComponent/c_cc_d.h @@ -28,18 +31,7 @@ public: // bool Chk(dCcD_DivideInfo const &) const; }; // Size = 0x10 -// This Aabb type really could be anything -struct Aabb { - mVec3_c mMin; - mVec3_c mMax; - - void Set(mVec3_c const &a, mVec3_c const &b) { - mMin = a; - mMax = b; - } -}; // Size = 0x18 - -class dCcD_DivideArea : public Aabb { +class dCcD_DivideArea : public cM3dGAab { private: /* 0x18 */ bool mXDiffIsZero; /* 0x1C */ f32 mScaledXDiff; @@ -55,9 +47,9 @@ public: /* vt at 0x3C */ dCcD_DivideArea(); virtual ~dCcD_DivideArea(); - /* 803281c0 */ void SetArea(Aabb const &); - /* 803282d0 */ void CalcDivideInfo(dCcD_DivideInfo *, Aabb const &, u32); - /* 80328470 */ void CalcDivideInfoOverArea(dCcD_DivideInfo *, Aabb const &); + /* 803281c0 */ void SetArea(cM3dGAab const &); + /* 803282d0 */ void CalcDivideInfo(dCcD_DivideInfo *, cM3dGAab const &, u32); + /* 80328470 */ void CalcDivideInfoOverArea(dCcD_DivideInfo *, cM3dGAab const &); }; // Size = 0x40 class dCcD_GAtTgCoCommonBase { @@ -328,24 +320,6 @@ struct dCcD_SrcSphAttr { /* 0x00 */ f32 mRadius; }; // Size = 0x4 -class cM3dGAabb { -public: - /* 0x00 */ mMtx_c mMtx1; - /* 0x30 */ mMtx_c mMtx2; - /* 0x60 */ mVec3_c mMin; - /* 0x6C */ mVec3_c mMax; - /* 0x78 */ u8 field_0x78[0xB8 - 0x78]; - /* 0xB8 */ mVec3_c mVirtualCenter; - /* 0xC4 */ u32 field_0xC4; - - cM3dGAabb(); - /* vt 0xC8 */ - virtual ~cM3dGAabb() {} - - void setWithYRot(const mVec3_c &translation, const mAng &rot); - void setMinMax(const mVec3_c &min, const mVec3_c &max); -}; - struct dCcD_SrcAabbAttr { /* 0x00 */ f32 minX, minY, minZ, maxX, maxY, maxZ; }; // Size = 0x18 @@ -354,12 +328,7 @@ struct dCcD_SrcUnk1Attr {}; class cM3dGUnk1 { public: - /* 0x00 */ mVec3_c field_0x00; - /* 0x0C */ mVec3_c field_0x0C; - /* 0x18 */ f32 field_0x18; - /* 0x1C */ f32 field_0x1C; - /* 0x20 */ u8 field_0x20; - /* 0x24 */ u32 field_0x24; + /* 0x00 */ cM3dGCps mCps; /* 0x28 */ mVec3_c mVirtualCenter; cM3dGUnk1(); }; @@ -427,7 +396,7 @@ public: }; // Aabb -class dCcD_ShapeAttr5 : public dCcD_ShapeAttr, public cM3dGAabb { +class dCcD_ShapeAttr5 : public dCcD_ShapeAttr, public cM3dGUnk { public: dCcD_ShapeAttr5(); diff --git a/include/toBeSorted/cc/d_cc_mgr.h b/include/d/col/cc/d_cc_mgr.h similarity index 85% rename from include/toBeSorted/cc/d_cc_mgr.h rename to include/d/col/cc/d_cc_mgr.h index 25686613..4ede33d4 100644 --- a/include/toBeSorted/cc/d_cc_mgr.h +++ b/include/d/col/cc/d_cc_mgr.h @@ -1,7 +1,7 @@ #ifndef TOSORT_D_CC_MGR_H #define TOSORT_D_CC_MGR_H -#include +#include class ColliderManager { public: diff --git a/include/toBeSorted/cc/d_cc_shape_colliders.h b/include/d/col/cc/d_cc_shape_colliders.h similarity index 98% rename from include/toBeSorted/cc/d_cc_shape_colliders.h rename to include/d/col/cc/d_cc_shape_colliders.h index d46efe3b..b6806000 100644 --- a/include/toBeSorted/cc/d_cc_shape_colliders.h +++ b/include/d/col/cc/d_cc_shape_colliders.h @@ -1,8 +1,8 @@ #ifndef D_CC_SHAPE_COLLIDERS_H #define D_CC_SHAPE_COLLIDERS_H +#include #include -#include struct dCcD_SrcUnk { /* 0x00 */ dCcD_SrcGObjInf mObjInf; diff --git a/include/d/d_base.h b/include/d/d_base.h index c57ea39a..b05be764 100644 --- a/include/d/d_base.h +++ b/include/d/d_base.h @@ -9,6 +9,9 @@ // non-official but likely name class dBase_c : public fBase_c { public: + enum BaseProperties_e { + BASE_PROP_0x4 = 0x4, + }; /* 0x64 */ u32 baseProperties; // field from profile init public: /* 80050800 */ dBase_c(); diff --git a/include/d/lyt/d_structd.h b/include/d/lyt/d_structd.h index 9b599fda..8499424b 100644 --- a/include/d/lyt/d_structd.h +++ b/include/d/lyt/d_structd.h @@ -8,10 +8,9 @@ namespace d2d { struct dLytStructD_Base { - dLytStructD_Base() - : field_0x0C(0), field_0x10(0), field_0x14(0), field_0x015(0), field_0x016(0) {} + dLytStructD_Base() : field_0x0C(0), field_0x10(0), field_0x14(0), field_0x015(0), field_0x016(0) {} virtual ~dLytStructD_Base(); - TListNode mNode; + TListNode mLink; u32 field_0x0C; u32 field_0x10; u16 field_0x14; @@ -50,8 +49,8 @@ public: void removeFromList2(dLytStructD *other); private: - TList mList1; - TList mList2; + TList mList2; + TList mList1; bool field_0x18; }; diff --git a/include/egg/gfx/eggCpuTexture.h b/include/egg/gfx/eggCpuTexture.h index 61de3178..7d1d10ba 100644 --- a/include/egg/gfx/eggCpuTexture.h +++ b/include/egg/gfx/eggCpuTexture.h @@ -1,6 +1,10 @@ #ifndef EGG_CPU_TEXTURE_H #define EGG_CPU_TEXTURE_H -namespace EGG {} // namespace EGG +namespace EGG { + +class CpuTexture {}; + +} // namespace EGG #endif diff --git a/include/f/f_base.h b/include/f/f_base.h index 5f172af2..cd6bc24a 100644 --- a/include/f/f_base.h +++ b/include/f/f_base.h @@ -12,8 +12,10 @@ #include "f/f_list_mg.h" #include "f/f_manager.h" #include "f/f_profile.h" + #include + // Ghidra: fBase // size: 0x64 // official name @@ -50,15 +52,28 @@ public: ACTOR, STAGE, }; - enum MAIN_STATE_e { CANCELED, ERROR, SUCCESS, WAITING }; + enum MAIN_STATE_e { + CANCELED, + ERROR, + SUCCESS, + WAITING + }; enum PACK_RESULT_e { NOT_READY, SUCCEEDED, FAILED, }; - enum PROC_DISABLE_e { ROOT_DISABLE_EXECUTE = 1, DISABLE_EXECUTE = 2, ROOT_DISABLE_DRAW = 4, DISABLE_DRAW = 8 }; + enum PROC_DISABLE_e { + ROOT_DISABLE_EXECUTE = 1, + DISABLE_EXECUTE = 2, + ROOT_DISABLE_DRAW = 4, + DISABLE_DRAW = 8 + }; + + int getID() const { + return unique_ID; + } - // Inlines bool isProcControlFlag(u8 flag) const { return (proc_control & flag) != 0; } @@ -105,8 +120,8 @@ public: // vtable 0x60 /* 0x48 | 802E1480 */ virtual ~fBase_c(); public: - /* 802e1500 */ int commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), - void (fBase_c::*postFunc)(MAIN_STATE_e)); + /* 802e1500 */ int + commonPack(int (fBase_c::*doFunc)(), int (fBase_c::*preFunc)(), void (fBase_c::*postFunc)(MAIN_STATE_e)); /* 802e1680 */ int createPack(); /* 802e1860 */ int deletePack(); /* 802e1960 */ int executePack(); diff --git a/include/m/m_angle.h b/include/m/m_angle.h index 2b0c98c9..97033a08 100644 --- a/include/m/m_angle.h +++ b/include/m/m_angle.h @@ -8,16 +8,23 @@ struct mAng { mAng() {} mAng(s16 s) : mVal(s) {} mAng(const mAng &other) : mVal(other.mVal) {} + operator s16() const { return mVal; } + + mAng &operator+=(const mAng &other) { + mVal += other.mVal; + return *this; + } + s32 step(s16 target, s32 steps, s16 max, s16 min); - inline f32 sin() const { + f32 sin() const { return nw4r::math::SinIdx(*this); } - inline f32 cos() const { + f32 cos() const { return nw4r::math::CosIdx(*this); } diff --git a/include/m/m_mtx.h b/include/m/m_mtx.h index 006e419d..f198f09d 100644 --- a/include/m/m_mtx.h +++ b/include/m/m_mtx.h @@ -5,9 +5,12 @@ #include "egg/math/eggMatrix.h" #include "m/m_angle.h" +#include "m/m_vec.h" #include "nw4r/nw4r_types.h" + #include + #pragma push #pragma warning off(10402) class mMtx_c { @@ -16,8 +19,7 @@ class mMtx_c { public: mMtx_c(){}; - /* 802f1660 */ mMtx_c(f32 xx, f32 xy, f32 xz, f32 xw, f32 yx, f32 yy, f32 yz, f32 yw, f32 zx, f32 zy, f32 zz, - f32 zw); + mMtx_c(f32 xx, f32 xy, f32 xz, f32 xw, f32 yx, f32 yy, f32 yz, f32 yw, f32 zx, f32 zy, f32 zz, f32 zw); // not sure if this breaks anything but we need a matrix type // with an inline copy assignment operator @@ -39,29 +41,36 @@ public: return &nw4rm; } - /* 802f16b0 */ void XrotS(const mAng &angle); ///< Generates a rotation matrix for the X axis with the given angle. - /* 802f1770 */ void XrotM(const mAng &angle); ///< Rotates the matrix on the X axis by the given angle. - /* 802f17c0 */ void YrotS(const mAng &angle); ///< Generates a rotation matrix for the Y axis with the given angle. - /* 802f1880 */ void YrotM(const mAng &angle); ///< Rotates the matrix on the Y axis by the given angle. - /* 802f18d0 */ void ZrotS(const mAng &angle); ///< Generates a rotation matrix for the Z axis with the given angle. - /* 802f1990 */ void ZrotM(const mAng &angle); ///< Rotates the matrix on the Z axis by the given angle. + void XrotS(const mAng &angle); ///< Generates a rotation matrix for the X axis with the given angle. + void XrotM(const mAng &angle); ///< Rotates the matrix on the X axis by the given angle. + void YrotS(const mAng &angle); ///< Generates a rotation matrix for the Y axis with the given angle. + void YrotM(const mAng &angle); ///< Rotates the matrix on the Y axis by the given angle. + void ZrotS(const mAng &angle); ///< Generates a rotation matrix for the Z axis with the given angle. + void ZrotM(const mAng &angle); ///< Rotates the matrix on the Z axis by the given angle. - /* 802f19e0 */ void ZXYrotS(mAng xRot, mAng yRot, - mAng zRot); ///< Generates the matrix on the Y, X and Z axes by the given angles. - /* 802f1a40 */ void ZXYrotM(mAng xRot, mAng yRot, - mAng zRot); ///< Rotates the matrix on the Y, X and Z axes by the given angles. - /* 802f1aa0 */ void XYZrotS(mAng xRot, mAng yRot, - mAng zRot); ///< Generates the matrix on the Z, Y and X axes by the given angles. - /* 802f1b00 */ void XYZrotM(mAng xRot, mAng yRot, - mAng zRot); ///< Rotates the matrix on the Z, Y and X axes by the given angles. + void ZXYrotS(mAng xRot, mAng yRot, + mAng zRot); ///< Generates the matrix on the Y, X and Z axes by the given angles. + void ZXYrotM(mAng xRot, mAng yRot, + mAng zRot); ///< Rotates the matrix on the Y, X and Z axes by the given angles. + void XYZrotS(mAng xRot, mAng yRot, + mAng zRot); ///< Generates the matrix on the Z, Y and X axes by the given angles. - /* 802f1b60 */ void toRot(mAng3_c &out) const; ///< Converts the matrix to a rotation vector. + void XYZrotM(mAng xRot, mAng yRot, + mAng zRot); ///< Rotates the matrix on the Z, Y and X axes by the given angles. + + void toRot(mAng3_c &out) const; ///< Converts the matrix to a rotation vector. void multVecZero(nw4r::math::VEC3 &out) const; ///< Converts the matrix to a vector. void zero(); ///< Zeroes out the matrix. - /* 802f1c40 */ void rot(int, int); // does some werrd operation to rotate the matrix - /* 802f1e60 */ bool quatRelated(); + void rot(int, int); // does some werrd operation to rotate the matrix + bool quatRelated(); + + void SetTranslation(const mVec3_c &t) { + m[0][3] = t.x; + m[1][3] = t.y; + m[2][3] = t.z; + } public: union { diff --git a/include/m/m_vec.h b/include/m/m_vec.h index 44be26c3..8ebd6335 100644 --- a/include/m/m_vec.h +++ b/include/m/m_vec.h @@ -2,15 +2,16 @@ #define M_VEC_H #include "egg/math/eggVector.h" -#include "rvl/MTX.h" #include "m/m_angle.h" +#include "rvl/MTX.h" + #include class mVec3_c : public EGG::Vector3f { public: /// @brief Constructs an empty vector. - /* 80009ee0 */ mVec3_c() {} - /* 80007460 */ ~mVec3_c() {} + mVec3_c() {} + ~mVec3_c() {} /// @brief Constructs a vector from a float array. mVec3_c(const f32 *p) { @@ -27,11 +28,33 @@ public: set(fx, fy, fz); } + // ?? Sometimes Works + void copyFrom(const Vec *pV) { + set(pV->x, pV->y, pV->z); + } + + /// @brief Assignment operator mVec3_c &operator=(const mVec3_c &r) { set(r.x, r.y, r.z); return *this; } + /// @brief Assignment operator + mVec3_c &operator=(const EGG::Vector3f &r) { + x = r.x; + y = r.y; + z = r.z; + return *this; + } + + /// @brief Assignment operator + mVec3_c &operator=(const nw4r::math::VEC3 &r) { + x = r.x; + y = r.y; + z = r.z; + return *this; + } + /// @brief Constructs a new vector from an existing vector from the MTX library. mVec3_c(const Vec &v) { x = v.x; @@ -46,6 +69,13 @@ public: z = v.z; } + /// @brief Constructs a new vector from an existing vector from the EGG library. + mVec3_c(const EGG::Vector3f &v) { + x = v.x; + y = v.y; + z = v.z; + } + /// @brief Float cast operator. operator f32 *() { return &x; @@ -66,6 +96,7 @@ public: return *(Vec *)&x; } + /// @brief Vector3f cast operator. operator EGG::Vector3f *() { return (EGG::Vector3f *)&x; } @@ -85,6 +116,14 @@ public: return (const nw4r::math::VEC3 *)&x; } + /// @brief Augmented subtraction operator. + mVec3_c &operator+=(const mVec3_c &v) { + x += v.x; + y += v.y; + z += v.z; + return *this; + } + /// @brief Augmented subtraction operator. mVec3_c &operator-=(const mVec3_c &v) { x -= v.x; @@ -111,6 +150,20 @@ public: return *this; } + mVec3_c &operator-=(f32 f) { + x -= f; + y -= f; + z -= f; + return *this; + } + + mVec3_c &operator+=(f32 f) { + x += f; + y += f; + z += f; + return *this; + } + /// @brief Negative operator. mVec3_c operator-() const { return mVec3_c(-x, -y, -z); diff --git a/include/nw4r/math/math_arithmetic.h b/include/nw4r/math/math_arithmetic.h index cce709d2..2e297271 100644 --- a/include/nw4r/math/math_arithmetic.h +++ b/include/nw4r/math/math_arithmetic.h @@ -67,7 +67,7 @@ inline f32 FModf(f32 x, f32 *y) { } inline f32 FSqrt(f32 x) { - if (x < 0.0f) { + if (x <= 0.0f) { return 0.0f; } diff --git a/include/rvl/MTX/mtx.h b/include/rvl/MTX/mtx.h index 642f9997..c973a20e 100644 --- a/include/rvl/MTX/mtx.h +++ b/include/rvl/MTX/mtx.h @@ -21,7 +21,7 @@ void PSMTXCopy(const Mtx, Mtx); void PSMTXConcat(const Mtx, const Mtx, Mtx); void PSMTXConcatArray(const Mtx, const Mtx, Mtx, u32); void PSMTXTranspose(const Mtx, Mtx); -void PSMTXInverse(const Mtx, Mtx); +bool PSMTXInverse(const Mtx, Mtx); void PSMTXInvXpose(const Mtx, Mtx); void PSMTXRotRad(Mtx, f32, char); void PSMTXRotTrig(Mtx, f32, f32, char); diff --git a/include/toBeSorted/actor_collision.h b/include/toBeSorted/actor_collision.h deleted file mode 100644 index d849db4c..00000000 --- a/include/toBeSorted/actor_collision.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef ACTOR_COLLISION_H -#define ACTOR_COLLISION_H - -#include -#include -#include - -class ActorCollision { -public: - ActorCollision(); - ~ActorCollision(); - - void* create(void *dzbData, void *plcData, bool b, const mMtx_c &mtx, const mVec3_c &vec); - void* create(void *dzbData, void *plcData, bool b, const mMtx_c &mtx, const mVec3_c &vec, void *callback) { - void* result = create(dzbData, plcData, b, mtx, vec); - multMatrix = callback; - return result; - } - void init(); - void execute(); - - u8 field_0x00[0x1FC - 0x000]; - /* 0x1FC */ void *multMatrix; - /* 0x200 */ void *interactFunc; - /* 0x204 */ u8 field_0x204[0x210 - 0x204]; - - -}; - -class CollisionCheckContext { -public: - - static CollisionCheckContext* get(); - void registerActorBgCollision(ActorCollision&, dAcObjBase_c*); - void destroyActorBgCollision(ActorCollision&); -}; - -#endif diff --git a/include/toBeSorted/arc_managers/oarc_manager.h b/include/toBeSorted/arc_managers/oarc_manager.h index 643dc000..bc938d0e 100644 --- a/include/toBeSorted/arc_managers/oarc_manager.h +++ b/include/toBeSorted/arc_managers/oarc_manager.h @@ -10,7 +10,6 @@ public: OarcManager(); virtual ~OarcManager(); - static OarcManager *sInstance; static bool create(EGG::Heap *heap); @@ -31,6 +30,7 @@ public: void *getDzbFromArc(const char *oarcName, const char *fileName); void *getPlcFromArc(const char *oarcName, const char *fileName); void *getSubEntryData(const char *oarcName, const char *fileName); + private: dRawArcTable_c mArcTable; }; diff --git a/include/toBeSorted/cc/d_cc_m3d.h b/include/toBeSorted/cc/d_cc_m3d.h deleted file mode 100644 index 84459238..00000000 --- a/include/toBeSorted/cc/d_cc_m3d.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef TOSORT_D_CC_M3D_H -#define TOSORT_D_CC_M3D_H - - - - -#endif diff --git a/include/toBeSorted/cc/d_cc_m3d_g_cyl.h b/include/toBeSorted/cc/d_cc_m3d_g_cyl.h deleted file mode 100644 index ad23d4a0..00000000 --- a/include/toBeSorted/cc/d_cc_m3d_g_cyl.h +++ /dev/null @@ -1,24 +0,0 @@ -#ifndef TO_SORT_D_CC_M3D_G_CYL_H -#define TO_SORT_D_CC_M3D_G_CYL_H - -#include - -class cM3dGCyl { -public: - /* 0x00 */ mVec3_c mCenter; - /* 0x0C */ f32 mRadius; - /* 0x10 */ f32 mHeight; - cM3dGCyl() {} - - void setC(const mVec3_c &, f32 radius, f32 height); - void setC(const mVec3_c &); - void setH(f32); - void setR(f32); - - const mVec3_c &GetC() const { - return mCenter; - } - -}; // Size = 0x14 - -#endif diff --git a/include/toBeSorted/cc/d_cc_m3d_g_sph.h b/include/toBeSorted/cc/d_cc_m3d_g_sph.h deleted file mode 100644 index 812f63b7..00000000 --- a/include/toBeSorted/cc/d_cc_m3d_g_sph.h +++ /dev/null @@ -1,23 +0,0 @@ -#ifndef TO_SORT_D_CC_M3D_G_SPH_H -#define TO_SORT_D_CC_M3D_G_SPH_H - -#include - -class cM3dGSph { -public: - /* 0x00 */ mVec3_c mCenter; - /* 0x0C */ f32 mRadius; - /* 0x10 */ f32 field_0x10; - cM3dGSph(); - - void setR(f32); - void set(const mVec3_c &, f32); - void setC(const mVec3_c &); - void setC(f32, f32, f32); - const mVec3_c &GetC() const { - return mCenter; - } - -}; // Size = 0x14 - -#endif diff --git a/include/toBeSorted/dowsing_target.h b/include/toBeSorted/dowsing_target.h index a157cbae..65d5cd19 100644 --- a/include/toBeSorted/dowsing_target.h +++ b/include/toBeSorted/dowsing_target.h @@ -7,7 +7,7 @@ class DowsingTarget { public: - TListNode mLink; // 0x00 + TListNode mLink; // 0x00 private: dAcBase_c *mpActor; // 0x08 u8 mDowsingSlot; // 0x0C @@ -58,8 +58,9 @@ public: static bool hasDowsingInSlot(int slot); - static DowsingTarget *getDowsingInfo(const mVec3_c &playerPosition, const mVec3_c &dowsingDirection, f32 *, f32 *, - f32 *intensity, int slot); + static DowsingTarget *getDowsingInfo( + const mVec3_c &playerPosition, const mVec3_c &dowsingDirection, f32 *, f32 *, f32 *intensity, int slot + ); static void init(); static void execute(); diff --git a/include/toBeSorted/tlist.h b/include/toBeSorted/tlist.h index 9d62beb2..e1146ced 100644 --- a/include/toBeSorted/tlist.h +++ b/include/toBeSorted/tlist.h @@ -7,123 +7,122 @@ // * Entirely in headers // * Swapped node and count members // Used in DowsingTarget, maybe also in dAcBase_c.soundStuff - -// It's not immediately clear whether this stores pointers to nodes -// or pointers to objects. DowsingTarget's node offset is 0, so there's -// no observable difference, but the SoundSource stuff makes it -// look like it stores object pointers - +template class TListNode { public: TListNode() : mpPrev(nullptr), mpNext(nullptr) {} - void *GetNext() const { + T *GetNext() const { return mpNext; } - void *GetPrev() const { + T *GetPrev() const { return mpPrev; } - void *mpPrev; - void *mpNext; + + T *mpPrev; + T *mpNext; }; template class TList { public: + typedef TListNode TNode; class Iterator { public: - Iterator() : mNode(NULL) {} - Iterator(TListNode *node) : mNode(node) {} + Iterator() : pVal(NULL) {} + Iterator(T *p_val) : pVal(p_val) {} Iterator &operator++() { - mNode = GetNodeFromPointer(mNode->GetNext()); + pVal = GetNodeFromPtr(pVal)->GetNext(); return *this; } Iterator &operator--() { - mNode = mNode->GetPrev(); + pVal = GetNodeFromPtr(pVal)->GetPrev(); return *this; } T *operator->() const { - return GetPointerFromNode(mNode); + return pVal; } T &operator*() { return *this->operator->(); } - friend bool operator==(Iterator lhs, Iterator rhs) { - return lhs.mNode == rhs.mNode; + friend bool operator==(const Iterator &lhs, const Iterator &rhs) { + return lhs.pVal == rhs.pVal; } - friend bool operator!=(Iterator lhs, Iterator rhs) { - return !(lhs.mNode == rhs.mNode); + friend bool operator!=(const Iterator &lhs, const Iterator &rhs) { + return !(lhs.pVal == rhs.pVal); } private: - TListNode *mNode; // at 0x0 + T *pVal; // at 0x0 }; TList() { - this->mNode.mpNext = GetPointerFromNode(&mNode); - this->mNode.mpPrev = GetPointerFromNode(&mNode); + mStartEnd.mpNext = GetPtrFromNode(&mStartEnd); + mStartEnd.mpPrev = GetPtrFromNode(&mStartEnd); mCount = 0; } Iterator GetBeginIter() { - return GetNodeFromPointer(&mNode) != mNode.GetNext() ? Iterator(GetNodeFromPointer(mNode.GetNext())) : - Iterator(&mNode); + if (GetEndIter() != Iterator(mStartEnd.GetNext())) { + return Iterator(mStartEnd.GetNext()); + } else { + return GetEndIter(); + } } + Iterator GetEndIter() { - return Iterator(&mNode); + return Iterator(GetPtrFromNode(&mStartEnd)); } - static TListNode *GetNodeFromPointer(void *p) { - return reinterpret_cast(reinterpret_cast(p) + offset); + static TNode *GetNodeFromPtr(T *pT) { + return (TNode *)((u8 *)pT + offset); } - - static T *GetPointerFromNode(TListNode *node) { - return reinterpret_cast(reinterpret_cast(node) - offset); + static T *GetPtrFromNode(TNode *pN) { + return (T *)((u8 *)pN - offset); } - void insert(T *value) { - TListNode *node = GetNodeFromPointer(value); - if (GetPointerFromNode(&mNode) == this->mNode.mpNext) { - node->mpNext = GetPointerFromNode(&mNode); - node->mpPrev = GetPointerFromNode(&mNode); - this->mNode.mpNext = value; - this->mNode.mpPrev = value; + TNode *node = GetNodeFromPtr(value); + if (GetPtrFromNode(&mStartEnd) == mStartEnd.mpNext) { + node->mpNext = GetPtrFromNode(&mStartEnd); + node->mpPrev = GetPtrFromNode(&mStartEnd); + mStartEnd.mpNext = value; + mStartEnd.mpPrev = value; mCount++; } else { - node->mpPrev = this->mNode.mpPrev; - node->mpNext = GetPointerFromNode(&mNode); - GetNodeFromPointer(this->mNode.mpPrev)->mpNext = value; - this->mNode.mpPrev = value; + node->mpPrev = mStartEnd.mpPrev; + node->mpNext = GetPtrFromNode(&mStartEnd); + GetNodeFromPtr(mStartEnd.mpPrev)->mpNext = value; + mStartEnd.mpPrev = value; mCount++; } } void remove(T *value) { - TListNode *node = GetNodeFromPointer(value); + TNode *node = GetNodeFromPtr(value); T *next = reinterpret_cast(node->mpNext); - if (GetPointerFromNode(&mNode) == node->mpPrev) { - this->mNode.mpNext = next; + if (GetPtrFromNode(&mStartEnd) == node->mpPrev) { + this->mStartEnd.mpNext = next; } else { - GetNodeFromPointer(node->mpPrev)->mpNext = next; + GetNodeFromPtr(node->mpPrev)->mpNext = next; } - if (GetPointerFromNode(&mNode) == node->mpNext) { - this->mNode.mpPrev = node->mpPrev; + if (GetPtrFromNode(&mStartEnd) == node->mpNext) { + this->mStartEnd.mpPrev = node->mpPrev; } else { - GetNodeFromPointer(node->mpNext)->mpPrev = node->mpPrev; + GetNodeFromPtr(node->mpNext)->mpPrev = node->mpPrev; } node->mpPrev = nullptr; node->mpNext = nullptr; mCount--; } - TListNode mNode; + TNode mStartEnd; s32 mCount; }; diff --git a/src/REL/d/a/d_a_t_wood_area.cpp b/src/REL/d/a/d_a_t_wood_area.cpp index 95202ea2..06972cc5 100644 --- a/src/REL/d/a/d_a_t_wood_area.cpp +++ b/src/REL/d/a/d_a_t_wood_area.cpp @@ -1,5 +1,6 @@ -#include #include +#include + const f32 dAcTWoodArea_c::scaleX = 100.0f; const f32 dAcTWoodArea_c::scaleY = 100.0f; @@ -11,18 +12,14 @@ STATE_DEFINE(dAcTWoodArea_c, Wait); int dAcTWoodArea_c::actorCreate() { mStateMgr.changeState(StateID_Init); - PSMTXTrans(worldMatrix.m, position.x, position.y, position.z); + PSMTXTrans(mWorldMtx.m, position.x, position.y, position.z); boundingBox.min = mVec3_c(-0.0f, -0.0f, -0.0f); boundingBox.max = mVec3_c(0.0f, 0.0f, 0.0f); return SUCCEEDED; } static const ProfileName FILTER_PROFILE[] = { - fProfile::OBJ_FRUIT, - fProfile::ITEM, - fProfile::NPC_KYUI_THIRD, - fProfile::OBJ_IVY_ROPE, - fProfile::NPC_SORAJIMA_BOY, + fProfile::OBJ_FRUIT, fProfile::ITEM, fProfile::NPC_KYUI_THIRD, fProfile::OBJ_IVY_ROPE, fProfile::NPC_SORAJIMA_BOY, }; int dAcTWoodArea_c::actorPostCreate() { diff --git a/src/REL/d/a/e/d_a_e_hb_leaf.cpp b/src/REL/d/a/e/d_a_e_hb_leaf.cpp index d5099ed4..27200886 100644 --- a/src/REL/d/a/e/d_a_e_hb_leaf.cpp +++ b/src/REL/d/a/e/d_a_e_hb_leaf.cpp @@ -27,23 +27,14 @@ int dAcEhb_leaf_c::create() { someRot = rotation.y.mVal; switch (getParam1()) { - case 0: - case 7: - mType = 0; - break; - case 1: - mType = 1; - break; - case 2: - mType = 2; - break; - case 3: - case 4: - case 5: - rotation.z = -0x8000; - break; - default: - break; + case 0: + case 7: mType = 0; break; + case 1: mType = 1; break; + case 2: mType = 2; break; + case 3: + case 4: + case 5: rotation.z = -0x8000; break; + default: break; } if (mType == 0) { @@ -85,9 +76,9 @@ int dAcEhb_leaf_c::actorExecute() { if (mType != 0) { Mtx m; PSMTXScale(m, mTimeAreaStruct.field_0x00, mTimeAreaStruct.field_0x00, mTimeAreaStruct.field_0x00); - PSMTXConcat(worldMatrix.m, m, worldMatrix.m); + PSMTXConcat(mWorldMtx.m, m, mWorldMtx.m); } - mModel.getModel().setLocalMtx(worldMatrix); + mModel.getModel().setLocalMtx(mWorldMtx); mModel.getModel().calc(false); someRot++; diff --git a/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp b/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp index 3f5215c1..ba87702b 100644 --- a/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp +++ b/src/REL/d/a/obj/d_a_obj_appear_bridge.cpp @@ -1,5 +1,6 @@ #include #include +#include #include SPECIAL_ACTOR_PROFILE(OBJ_APPEAR_BRIDGE, dAcOappearBridge_c, fProfile::OBJ_APPEAR_BRIDGE, 0x01FC, 0, 6); @@ -21,18 +22,18 @@ bool dAcOappearBridge_c::createHeap() { TRY_CREATE(mSrtAnm.create(mdl, srt, &heap_allocator, nullptr, 1)); nw4r::g3d::ResAnmClr clr = mResFile.GetResAnmClr("TongueStage"); TRY_CREATE(mClrAnm.create(mdl, clr, &heap_allocator, nullptr, 1)); - void *dzb = getOarcFile("TongueStage", "dzb/TongueStage.dzb"); - void *plc = getOarcFile("TongueStage", "dat/TongueStage.plc"); + cBgD_t *dzb = (cBgD_t *)getOarcFile("TongueStage", "dzb/TongueStage.dzb"); + PLC *plc = (PLC *)getOarcFile("TongueStage", "dat/TongueStage.plc"); updateMatrix(); - mModel.setLocalMtx(worldMatrix); - TRY_CREATE(mCollision.create(dzb, plc, true, worldMatrix, scale) == nullptr); - mCollision.init(); + mModel.setLocalMtx(mWorldMtx); + TRY_CREATE(!mCollision.Set(dzb, plc, 1, &mWorldMtx, &mScale)); + mCollision.Lock(); return true; } int dAcOappearBridge_c::create() { CREATE_ALLOCATOR(dAcOappearBridge_c); - CollisionCheckContext::get()->registerActorBgCollision(mCollision, this); + dBgS::GetInstance()->Regist(&mCollision, this); mAreaIdx = params & 0xFF; mEventId = (params >> 8) & 0xFF; mSoundPosition = position + positionOffset; @@ -65,7 +66,7 @@ int dAcOappearBridge_c::draw() { } void dAcOappearBridge_c::initializeState_Wait() { - CollisionCheckContext::get()->destroyActorBgCollision(mCollision); + dBgS::GetInstance()->Release(&mCollision); } void dAcOappearBridge_c::executeState_Wait() { if (checkPosInArea(mAreaIdx, roomid, dAcPy_c::LINK->position, nullptr)) { @@ -89,7 +90,7 @@ void dAcOappearBridge_c::finalizeState_Wait() { void dAcOappearBridge_c::initializeState_Appear() { mSrtAnm.setRate(sMovementRate, 0); mClrAnm.setRate(sMovementRate, 0); - CollisionCheckContext::get()->registerActorBgCollision(mCollision, this); + dBgS::GetInstance()->Regist(&mCollision, this); playSound(0xAA4); } void dAcOappearBridge_c::executeState_Appear() { diff --git a/src/REL/d/a/obj/d_a_obj_bamboo_island.cpp b/src/REL/d/a/obj/d_a_obj_bamboo_island.cpp index 2caf0071..ac12ff8b 100644 --- a/src/REL/d/a/obj/d_a_obj_bamboo_island.cpp +++ b/src/REL/d/a/obj/d_a_obj_bamboo_island.cpp @@ -1,17 +1,18 @@ #include +#include #include const f32 dAcObambooIsland_c::unusedFloat1 = 100000.0f; const f32 dAcObambooIsland_c::unusedFloat2 = 0.0f; static const char *const sBambooIslandNames[] = { - "IslBamb", - "IslBamb_s", + "IslBamb", + "IslBamb_s", }; SPECIAL_ACTOR_PROFILE(OBJ_BAMBOO_ISLAND, dAcObambooIsland_c, fProfile::OBJ_BAMBOO_ISLAND, 0x01F9, 0, 3); -void dAcObambooIsland_c::interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *interactor) { +void dAcObambooIsland_c::rideCallback(dBgW *unknown, dAcObjBase_c *actor, dAcObjBase_c *interactor) { if (interactor->isActorPlayer() && actor != nullptr && StoryFlagManager::sInstance->getCounterOrFlag(284) == 0) { StoryFlagManager::sInstance->setFlag(284); } @@ -25,26 +26,26 @@ bool dAcObambooIsland_c::createHeap() { nw4r::g3d::ResMdl mdl = mBrres.GetResMdl(sBambooIslandNames[i]); TRY_CREATE(mModels[i].create(mdl, &heap_allocator, 0x120)); } - void *dzb = getOarcFile("IslBamb", "dzb/IslBamb.dzb"); - void *plc = getOarcFile("IslBamb", "dat/IslBamb.plc"); + cBgD_t *dzb = (cBgD_t *)getOarcFile("IslBamb", "dzb/IslBamb.dzb"); + PLC *plc = (PLC *)getOarcFile("IslBamb", "dat/IslBamb.plc"); updateMatrix(); for (int i = 0; i < 2; i++) { - mModels[i].setLocalMtx(worldMatrix); + mModels[i].setLocalMtx(mWorldMtx); } - TRY_CREATE(mCollision.create(dzb, plc, true, worldMatrix, scale) == nullptr); - mCollision.init(); + TRY_CREATE(!mCollision.Set(dzb, plc, 1, &mWorldMtx, &mScale)); + mCollision.Lock(); return true; } int dAcObambooIsland_c::create() { CREATE_ALLOCATOR(dAcObambooIsland_c); - CollisionCheckContext::get()->registerActorBgCollision(mCollision, this); + dBgS::GetInstance()->Regist(&mCollision, this); mModels[0].setPriorityDraw(0x1C, 9); mModels[1].setPriorityDraw(0x22, 9); setBoundingBox(mVec3_c(-2400.0f, -1600.0f, -2300.0f), mVec3_c(2400.0f, 3900.0f, 2400.0f)); mCullingDistance = 500000.0f; - mCollision.interactFunc = interactCallback; + mCollision.SetRideCallback(rideCallback); return SUCCEEDED; } diff --git a/src/REL/d/a/obj/d_a_obj_junk_repairing.cpp b/src/REL/d/a/obj/d_a_obj_junk_repairing.cpp index 97c9eddc..afc9d45c 100644 --- a/src/REL/d/a/obj/d_a_obj_junk_repairing.cpp +++ b/src/REL/d/a/obj/d_a_obj_junk_repairing.cpp @@ -37,10 +37,7 @@ int dAcOJunkRep_c::create() { mStateMgr.changeState(StateID_Wait); - setBoundingBox( - mVec3_c(-30.0f, -0.0f, -20.0f), - mVec3_c(30.0f, 120.0f, 20.0f) - ); + setBoundingBox(mVec3_c(-30.0f, -0.0f, -20.0f), mVec3_c(30.0f, 120.0f, 20.0f)); return SUCCEEDED; } @@ -52,7 +49,7 @@ int dAcOJunkRep_c::doDelete() { int dAcOJunkRep_c::actorExecute() { mStateMgr.executeState(); updateMatrix(); - mpModelToUse->setLocalMtx(worldMatrix); + mpModelToUse->setLocalMtx(mWorldMtx); return SUCCEEDED; } diff --git a/src/REL/d/a/obj/d_a_obj_lava_F200.cpp b/src/REL/d/a/obj/d_a_obj_lava_F200.cpp index ee5c5ef9..7cf1f3ed 100644 --- a/src/REL/d/a/obj/d_a_obj_lava_F200.cpp +++ b/src/REL/d/a/obj/d_a_obj_lava_F200.cpp @@ -34,7 +34,7 @@ int dAcOlavaF200_c::create() { updateMatrix(); for (int i = 0; i < 2; i++) { - mModels[i].setLocalMtx(worldMatrix); + mModels[i].setLocalMtx(mWorldMtx); } mModels[0].setPriorityDraw(0x1C, 9); diff --git a/src/REL/d/a/obj/d_a_obj_mole_soil.cpp b/src/REL/d/a/obj/d_a_obj_mole_soil.cpp index ee752355..f3da21eb 100644 --- a/src/REL/d/a/obj/d_a_obj_mole_soil.cpp +++ b/src/REL/d/a/obj/d_a_obj_mole_soil.cpp @@ -30,7 +30,7 @@ int dAcOmoleSoil_c::create() { CREATE_ALLOCATOR(dAcOmoleSoil_c); mScale = sHalfScale; - scale.set(sHalfScale, sHalfScale, sHalfScale); + dAcBase_c::mScale.set(sHalfScale, sHalfScale, sHalfScale); mStateMgr.changeState(StateID_Wait); setBoundingBox(mVec3_c(-100.0f, -0.0f, -100.0f), mVec3_c(100.0f, 100.0f, 100.0f)); @@ -43,25 +43,25 @@ int dAcOmoleSoil_c::doDelete() { int dAcOmoleSoil_c::actorExecute() { switch (getNextState()) { - case 1: - if (!mStateMgr.isState(StateID_Appear)) { - mStateMgr.changeState(StateID_Appear); - } - break; - case 2: - if (!mStateMgr.isState(StateID_DisAppear)) { - mStateMgr.changeState(StateID_DisAppear); - } - break; - case 3: - if (!mStateMgr.isState(StateID_Appear)) { - mStateMgr.changeState(StateID_Appear); - } - break; + case 1: + if (!mStateMgr.isState(StateID_Appear)) { + mStateMgr.changeState(StateID_Appear); + } + break; + case 2: + if (!mStateMgr.isState(StateID_DisAppear)) { + mStateMgr.changeState(StateID_DisAppear); + } + break; + case 3: + if (!mStateMgr.isState(StateID_Appear)) { + mStateMgr.changeState(StateID_Appear); + } + break; } mStateMgr.executeState(); updateMatrix(); - mModel.setLocalMtx(worldMatrix); + mModel.setLocalMtx(mWorldMtx); return SUCCEEDED; } diff --git a/src/REL/d/a/obj/d_a_obj_pool_cock.cpp b/src/REL/d/a/obj/d_a_obj_pool_cock.cpp index 193462e7..c71dff6f 100644 --- a/src/REL/d/a/obj/d_a_obj_pool_cock.cpp +++ b/src/REL/d/a/obj/d_a_obj_pool_cock.cpp @@ -52,8 +52,8 @@ int dAcOPoolCock_c::actorExecute() { updateMatrix(); mMtx_c mdl1Transform; mMtx_c mdl2Transform; - mdl1Transform = worldMatrix; - mdl2Transform = worldMatrix; + mdl1Transform = mWorldMtx; + mdl2Transform = mWorldMtx; mMtx_c tmp1; mMtx_c tmp2; diff --git a/src/REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp b/src/REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp index 121136aa..ec1210dc 100644 --- a/src/REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp +++ b/src/REL/d/a/obj/d_a_obj_pumpkin_leaf.cpp @@ -23,7 +23,7 @@ int dAcOPumpkinLeaf_c::create() { mStateMgr.changeState(StateID_Wait); setBoundingBox(mVec3_c(-50.0f, -10.0f, -50.0f), mVec3_c(50.0f, 50.0f, 50.0f)); dAcObjBase_c::create( - "PmpknBd", getRoomId(), 0, &position, &rotation, &scale, getParams2_ignoreLower(), -1, viewclip_index + "PmpknBd", getRoomId(), 0, &position, &rotation, &mScale, getParams2_ignoreLower(), -1, viewclip_index ); return SUCCEEDED; } @@ -33,7 +33,7 @@ int dAcOPumpkinLeaf_c::doDelete() { } int dAcOPumpkinLeaf_c::actorExecute() { - mModel.setLocalMtx(worldMatrix); + mModel.setLocalMtx(mWorldMtx); return SUCCEEDED; } diff --git a/src/REL/d/a/obj/d_a_obj_ring.cpp b/src/REL/d/a/obj/d_a_obj_ring.cpp index 9bc13a04..d35c7cb7 100644 --- a/src/REL/d/a/obj/d_a_obj_ring.cpp +++ b/src/REL/d/a/obj/d_a_obj_ring.cpp @@ -1,5 +1,5 @@ -#include #include +#include SPECIAL_ACTOR_PROFILE(OBJ_RING, dAcOring_c, fProfile::OBJ_RING, 0x00f2, 0, 0x103); @@ -20,8 +20,8 @@ int dAcOring_c::create() { setBoundingBox(mVec3_c(-100.0f, -100.0f, -100.0f), mVec3_c(100.0f, 100.0f, 100.0f)); updateMatrix(); - mModel.setScale(scale); - mModel.setLocalMtx(worldMatrix); + mModel.setScale(mScale); + mModel.setLocalMtx(mWorldMtx); forwardAccel = -5.0f; forwardMaxSpeed = -40.0f; field_0x38C = dAcPy_c::LINK->position.y; @@ -39,7 +39,7 @@ int dAcOring_c::actorExecute() { position += velocity; position += mCCdStruct.posIncrements; updateMatrix(); - mModel.setLocalMtx(worldMatrix); + mModel.setLocalMtx(mWorldMtx); return SUCCEEDED; } diff --git a/src/REL/d/a/obj/d_a_obj_smoke.cpp b/src/REL/d/a/obj/d_a_obj_smoke.cpp index 0aa8aa26..90a16c4d 100644 --- a/src/REL/d/a/obj/d_a_obj_smoke.cpp +++ b/src/REL/d/a/obj/d_a_obj_smoke.cpp @@ -1,13 +1,13 @@ #include static const char *const sSmokeNames1[] = { - "SmokeF200", - "SmokeF202", + "SmokeF200", + "SmokeF202", }; static const char *const sSmokeNames2[] = { - "SmokeF200", - "SmokeF202", + "SmokeF200", + "SmokeF202", }; SPECIAL_ACTOR_PROFILE(OBJ_SMOKE, dAcOsmoke_c, fProfile::OBJ_SMOKE, 0x01DB, 0, 4); @@ -29,7 +29,7 @@ int dAcOsmoke_c::create() { mModel.setAnm(mTexAnm); updateMatrix(); - mModel.setLocalMtx(worldMatrix); + mModel.setLocalMtx(mWorldMtx); mStateMgr.changeState(StateID_Wait); mModel.setPriorityDraw(0x1C, 9); setBoundingBox(mVec3_c(-0.0f, -0.0f, -0.0f), mVec3_c(0.0f, 0.0f, 0.0f)); diff --git a/src/REL/d/a/obj/d_a_obj_spike.cpp b/src/REL/d/a/obj/d_a_obj_spike.cpp index baabdf99..4f7a83dc 100644 --- a/src/REL/d/a/obj/d_a_obj_spike.cpp +++ b/src/REL/d/a/obj/d_a_obj_spike.cpp @@ -1,5 +1,5 @@ #include -#include +#include SPECIAL_ACTOR_PROFILE(OBJ_SPIKE, dAcOspike_c, fProfile::OBJ_SPIKE, 0x1D9, 0, 2); @@ -33,9 +33,9 @@ int dAcOspike_c::create() { mCollision.initUnk(mCCdStruct); updateMatrix(); - mMdl.setLocalMtx(worldMatrix); + mMdl.setLocalMtx(mWorldMtx); mVec3_c tmp; - PSMTXMultVecSR(worldMatrix.m, mVec3_c::Ex, tmp); + PSMTXMultVecSR(mWorldMtx.m, mVec3_c::Ex, tmp); mCollision.setAtVec(tmp); mMtx_c mtx; @@ -61,7 +61,7 @@ int dAcOspike_c::create() { tmp3.z = copy; } - mCollision.setMinMax(tmp2, tmp3); + mCollision.Set(tmp2, tmp3); mStateMgr.changeState(StateID_Wait); setBoundingBox(mVec3_c(-10.0f, -250.0f, -480.0f), mVec3_c(80.0f, 260.0f, 490.0f)); return SUCCEEDED; @@ -73,7 +73,7 @@ int dAcOspike_c::doDelete() { int dAcOspike_c::actorExecute() { mStateMgr.executeState(); - mCollision.setWithYRot(position, rotation.y); + mCollision.Set(position, rotation.y); ColliderManager::getColliderManager()->addCollider(&mCollision); return 1; } diff --git a/src/REL/d/a/obj/d_a_obj_stage_cover.cpp b/src/REL/d/a/obj/d_a_obj_stage_cover.cpp index 934a9c0f..c21bc94b 100644 --- a/src/REL/d/a/obj/d_a_obj_stage_cover.cpp +++ b/src/REL/d/a/obj/d_a_obj_stage_cover.cpp @@ -28,7 +28,7 @@ int dAcOstageCover_c::doDelete() { int dAcOstageCover_c::actorExecute() { mStateMgr.executeState(); updateMatrix(); - mModel.setLocalMtx(worldMatrix); + mModel.setLocalMtx(mWorldMtx); return SUCCEEDED; } diff --git a/src/REL/d/a/obj/d_a_obj_sun_light.cpp b/src/REL/d/a/obj/d_a_obj_sun_light.cpp index 656dea2d..35201950 100644 --- a/src/REL/d/a/obj/d_a_obj_sun_light.cpp +++ b/src/REL/d/a/obj/d_a_obj_sun_light.cpp @@ -38,7 +38,7 @@ int dAcOsunLight_c::actorExecute() { mTexAnm.play(); } updateMatrix(); - mModel.setLocalMtx(worldMatrix); + mModel.setLocalMtx(mWorldMtx); return SUCCEEDED; } diff --git a/src/REL/d/a/obj/d_a_obj_toD3_stone_figure.cpp b/src/REL/d/a/obj/d_a_obj_toD3_stone_figure.cpp index 0aef96c0..7f665394 100644 --- a/src/REL/d/a/obj/d_a_obj_toD3_stone_figure.cpp +++ b/src/REL/d/a/obj/d_a_obj_toD3_stone_figure.cpp @@ -1,6 +1,6 @@ #include +#include #include -#include #include #include #include @@ -39,14 +39,14 @@ int dAcOtoD3StoneFigure_c::create() { return FAILED; } - mMdl.setLocalMtx(worldMatrix); + mMdl.setLocalMtx(mWorldMtx); mCCdStruct.setField0x38ToMagicValue(); mCollision.init(sCcSrc); mCollision.initUnk(mCCdStruct); int zero = 0; - mCollision.setC(position); - mCollision.setR(dAcOtoD3StoneFigure_c::sRadius + zero); - mCollision.setH(dAcOtoD3StoneFigure_c::sHeight + zero); + mCollision.SetC(position); + mCollision.SetR(dAcOtoD3StoneFigure_c::sRadius + zero); + mCollision.SetH(dAcOtoD3StoneFigure_c::sHeight + zero); ColliderManager::getColliderManager()->addCollider(&mCollision); // mCollision.clearCoFlag(); mCollision.setTgCoFlag(1); @@ -96,7 +96,7 @@ void dAcOtoD3StoneFigure_c::initializeState_OneEye() { if (ScGame::currentSpawnInfo.night == 1) { rotation.y.mVal += -0x8000; updateMatrix(); - mMdl.setLocalMtx(worldMatrix); + mMdl.setLocalMtx(mWorldMtx); } } diff --git a/src/REL/d/a/obj/d_a_obj_triforce.cpp b/src/REL/d/a/obj/d_a_obj_triforce.cpp index 3b054302..36180d41 100644 --- a/src/REL/d/a/obj/d_a_obj_triforce.cpp +++ b/src/REL/d/a/obj/d_a_obj_triforce.cpp @@ -1,7 +1,7 @@ #include #include +#include #include -#include SPECIAL_ACTOR_PROFILE(OBJ_TRIFORCE, dAcOtriforce_c, fProfile::OBJ_TRIFORCE, 0x15D, 0, 4); @@ -42,10 +42,10 @@ int dAcOtriforce_c::create() { mEffects.init(this); mCollision.setSomeDefendValue(0x2000); updateMatrix(); - scale.x = sScale; - scale.y = sScale; - scale.z = sScale; - mMdl.setLocalMtx(worldMatrix); + mScale.x = sScale; + mScale.y = sScale; + mScale.z = sScale; + mMdl.setLocalMtx(mWorldMtx); return SUCCEEDED; } @@ -62,16 +62,16 @@ int dAcOtriforce_c::actorExecute() { position = mStartingPos + offset; mStartingOffset.mVal += 0x16C; - mCollision.setC(position.x, position.y + 90.0f + zero, position.z); + mCollision.SetC(position.x, position.y + 90.0f + zero, position.z); ColliderManager::getColliderManager()->addCollider(&mCollision); updateMatrix(); Mtx m; - PSMTXScale(m, scale.x, scale.y, scale.z); - PSMTXConcat(worldMatrix.m, m, worldMatrix.m); - mMdl.setLocalMtx(worldMatrix); + PSMTXScale(m, mScale.x, mScale.y, mScale.z); + PSMTXConcat(mWorldMtx.m, m, mWorldMtx.m); + mMdl.setLocalMtx(mWorldMtx); mAnm.play(); - fn_80029AE0(&mEffects, PARTICLE_RESOURCE_ID_MAPPING_967_, &worldMatrix, nullptr, nullptr); + fn_80029AE0(&mEffects, PARTICLE_RESOURCE_ID_MAPPING_967_, &mWorldMtx, nullptr, nullptr); return 1; } diff --git a/src/REL/d/t/d_t_fairytag.cpp b/src/REL/d/t/d_t_fairytag.cpp index 4e68e598..dc8a3a68 100644 --- a/src/REL/d/t/d_t_fairytag.cpp +++ b/src/REL/d/t/d_t_fairytag.cpp @@ -52,7 +52,8 @@ void dTgFairy_c::createFairies() { mVec3_c v = calcLocation(f); v2 = v; dAcObjFairy_c *ac = static_cast( - dAcObjBase_c::create("Fairy", roomid, fairyParams1, &v2, nullptr, nullptr, -1, -1, viewclip_index)); + dAcObjBase_c::create("Fairy", roomid, fairyParams1, &v2, nullptr, nullptr, -1, -1, viewclip_index) + ); if (ac != nullptr) { mpFairyRefs[i].link(ac); } @@ -62,9 +63,9 @@ void dTgFairy_c::createFairies() { mVec3_c dTgFairy_c::calcLocation(const f32 &offset) { mVec3_c v; - v.y = scale.y * 0.5f; - v.x = scale.x * calcRnd(0.5f, offset); - v.z = scale.z * calcRnd(0.5f, offset); + v.y = mScale.y * 0.5f; + v.x = mScale.x * calcRnd(0.5f, offset); + v.z = mScale.z * calcRnd(0.5f, offset); v.rotY(rotation.y); return position + v; } diff --git a/src/REL/d/t/d_t_genki_dws_tgt.cpp b/src/REL/d/t/d_t_genki_dws_tgt.cpp index ca5e8c2b..20fd7b76 100644 --- a/src/REL/d/t/d_t_genki_dws_tgt.cpp +++ b/src/REL/d/t/d_t_genki_dws_tgt.cpp @@ -1,7 +1,7 @@ #include +#include #include #include -#include #include SPECIAL_ACTOR_PROFILE(TAG_GENKI_DOWSING_TARGET, dTgGenkiDwsTgt_c, fProfile::TAG_GENKI_DOWSING_TARGET, 0x02A5, 0, 0); @@ -22,7 +22,6 @@ int dTgGenkiDwsTgt_c::create() { return FAILED; } - int roomId_tmp = roomid; if (addActorToRoom(-1)) { roomid = roomId_tmp; @@ -30,9 +29,9 @@ int dTgGenkiDwsTgt_c::create() { } else { return FAILED; } - scale.x = 1.0f; - scale.y = 1.0f; - scale.z = 1.0f; + mScale.x = 1.0f; + mScale.y = 1.0f; + mScale.z = 1.0f; static mVec3_c offset(0.0f, 25.0f, 0.0f); mDowsingTarget.initialize(DowsingTarget::SLOT_CRYSTAL, 0, &offset, 1.0f); diff --git a/src/REL/d/t/d_t_holy_water.cpp b/src/REL/d/t/d_t_holy_water.cpp index abebdb04..6861abc2 100644 --- a/src/REL/d/t/d_t_holy_water.cpp +++ b/src/REL/d/t/d_t_holy_water.cpp @@ -29,10 +29,10 @@ int dTgHolyWater_c::draw() { } bool dTgHolyWater_c::isLinkNearby() { - mVec3_c diff = dAcPy_c::LINK->position - (position + mVec3_c::Ey * scale.y * 0.5f); - diff.x /= scale.x; - diff.y /= scale.y; - diff.z /= scale.z; + mVec3_c diff = dAcPy_c::LINK->position - (position + mVec3_c::Ey * mScale.y * 0.5f); + diff.x /= mScale.x; + diff.y /= mScale.y; + diff.z /= mScale.z; return diff.x <= 0.5f && diff.x >= -0.5f && diff.y <= 0.5f && diff.y >= -0.5f && diff.z <= 0.5f && diff.z >= -0.5f; } diff --git a/src/REL/d/t/d_t_noeffect_area.cpp b/src/REL/d/t/d_t_noeffect_area.cpp index 4eaec40e..f8116eed 100644 --- a/src/REL/d/t/d_t_noeffect_area.cpp +++ b/src/REL/d/t/d_t_noeffect_area.cpp @@ -8,7 +8,7 @@ const f32 dTgNoEffectArea_c::sFloat1 = 100.0f; const f32 dTgNoEffectArea_c::sFloat2 = 100.0f; int dTgNoEffectArea_c::create() { - scale *= 0.01f; + mScale *= 0.01f; PSMTXTrans(mMtx, position.x, position.y, position.z); mMtx.YrotM(rotation.y); PSMTXInverse(mMtx, mMtx); diff --git a/src/REL/d/t/d_t_sound_area.cpp b/src/REL/d/t/d_t_sound_area.cpp index 82b6c088..c81321ab 100644 --- a/src/REL/d/t/d_t_sound_area.cpp +++ b/src/REL/d/t/d_t_sound_area.cpp @@ -1,5 +1,6 @@ -#include #include +#include +#include #include #include #include @@ -12,20 +13,18 @@ void float_ordering() { } int dTgSndAr_c::create() { - scale *= 0.01f; + mScale *= 0.01f; if (dTgSndMg_c::sInstance == nullptr) { dAcObjBase_c::createActorUnkGroup3(fProfile::SOUND_AREA_MGR, roomid, 0, nullptr, nullptr, nullptr, -1); } switch (getTypeFromParams()) { - case 0: - PSMTXTrans(mtx.m, position.x, position.y, position.z); - mtx.YrotM(rotation.y); - PSMTXInverse(mtx.m, mtx.m); - break; - case 3: - mRail.init(params >> 8 & 0xFF, roomid, 0); - break; + case 0: + PSMTXTrans(mtx.m, position.x, position.y, position.z); + mtx.YrotM(rotation.y); + PSMTXInverse(mtx.m, mtx.m); + break; + case 3: mRail.init(params >> 8 & 0xFF, roomid, 0); break; } fBase_c *base = nullptr; @@ -72,14 +71,10 @@ int dTgSndAr_c::draw() { bool dTgSndAr_c::checkPosInArea(mVec3_c &pos) { switch (getTypeFromParams()) { - case 0: - return checkAlg0(pos); - case 1: - return checkAlg1(pos); - case 2: - return checkAlg2(pos); - case 3: - return checkAlg3(pos); + case 0: return checkAlg0(pos); + case 1: return checkAlg1(pos); + case 2: return checkAlg2(pos); + case 3: return checkAlg3(pos); } return false; @@ -93,15 +88,15 @@ inline bool inRange(f32 val, f32 tolerance) { bool dTgSndAr_c::checkAlg0(const mVec3_c &pos) { mVec3_c c2 = pos; PSMTXMultVec(mtx.m, c2, c2); - f32 sxLower = -50.0f * scale.x; - f32 sxUpper = 50.0f * scale.x; + f32 sxLower = -50.0f * mScale.x; + f32 sxUpper = 50.0f * mScale.x; f32 syLower = 0.0f; - f32 syUpper = 100.0f * scale.y; - f32 szLower = -50.0f * scale.z; - f32 szUpper = 50.0f * scale.z; + f32 syUpper = 100.0f * mScale.y; + f32 szLower = -50.0f * mScale.z; + f32 szUpper = 50.0f * mScale.z; if (sxLower <= c2.x && c2.x <= sxUpper && syLower <= c2.y && c2.y <= syUpper && szLower <= c2.z && - c2.z <= szUpper) { + c2.z <= szUpper) { return true; } return false; @@ -109,18 +104,18 @@ bool dTgSndAr_c::checkAlg0(const mVec3_c &pos) { // Sphere bool dTgSndAr_c::checkAlg1(const mVec3_c &pos) { - f32 tgtDist = scale.x * 100.0f; + f32 tgtDist = mScale.x * 100.0f; f32 tgtDist2 = tgtDist * tgtDist; return PSVECSquareDistance(position, pos) < tgtDist2; } // Cylinder bool dTgSndAr_c::checkAlg2(const mVec3_c &pos) { - if (pos.y < position.y || pos.y > (position.y + 100.0f * scale.y)) { + if (pos.y < position.y || pos.y > (position.y + 100.0f * mScale.y)) { return false; } - f32 radius = scale.x * 100.0f; + f32 radius = mScale.x * 100.0f; mVec3_c diff = pos - position; f32 dist = diff.x * diff.x + diff.z * diff.z; @@ -138,38 +133,32 @@ struct UnkStruct { /* 0x24 */ u32 field_0x24; }; -extern "C" void fn_80337EA0(UnkStruct *); -extern "C" void fn_80337EF0(UnkStruct *, mVec3_c &, mVec3_c &, f32); -extern "C" int cM3d_Len3dSqPntAndSegLine(UnkStruct *, Vec &, Vec *, f32 *, f32 *); - // Capsule bool dTgSndAr_c::checkAlg3(const mVec3_c &pos) { - Vec q; + mVec3_c q; - f32 radius = scale.x * 100.0f; + f32 radius = mScale.x * 100.0f; radius = radius * radius; - Vec a = pos; - - UnkStruct unk; - fn_80337EA0(&unk); + nw4r::math::VEC3 a = pos; + cM3dGCps unk; // Line between b and c mVec3_c b = *mRail.getPntPosForIndex(0); mVec3_c c = *mRail.getPntPosForIndex(1); - fn_80337EF0(&unk, b, c, scale.x * 100.0f); + unk.Set(b, c, mScale.x * 100.0f); f32 d; - if (cM3d_Len3dSqPntAndSegLine(&unk, a, &q, &d, nullptr)) { + if (cM3d_Len3dSqPntAndSegLine(&unk, &a, &q, &d, nullptr)) { // At the cylindrical part of the capsule, just check the distance to // the line return d < radius; } else { // Otherwise check if we are within the spheres around the endpoints - f32 distSq = PSVECSquareDistance(unk.vec, pos); + f32 distSq = PSVECSquareDistance(unk.GetStart(), pos); if (distSq < radius) { return true; } else { - distSq = PSVECSquareDistance(unk.vec2, pos); + distSq = PSVECSquareDistance(unk.GetEnd(), pos); return distSq < radius; } } diff --git a/src/REL/d/t/d_t_touch.cpp b/src/REL/d/t/d_t_touch.cpp index 8ff87fcc..df97ddc3 100644 --- a/src/REL/d/t/d_t_touch.cpp +++ b/src/REL/d/t/d_t_touch.cpp @@ -16,7 +16,7 @@ int dTgTouchTag::create() { mActivatorIndex = !(getActivatorIndex() == 0xF) ? getActivatorIndex() : 0; mZoneFlag = getZoneFlag(); mChkFlag = getChkFlag(); - matrixCreateFromPosRotYScale(mAreaOfEffect, position, rotation.y, scale, nullptr, 0.0f); + matrixCreateFromPosRotYScale(mAreaOfEffect, position, rotation.y, mScale, nullptr, 0.0f); mStateMgr.changeState(StateID_Wait); return SUCCEEDED; } diff --git a/src/REL/d/t/d_t_tumble_weed.cpp b/src/REL/d/t/d_t_tumble_weed.cpp index 2187ee23..021c391b 100644 --- a/src/REL/d/t/d_t_tumble_weed.cpp +++ b/src/REL/d/t/d_t_tumble_weed.cpp @@ -47,7 +47,7 @@ void dTgTumbleWeed_c::executeState_AreaOut() { return; } } - if (isWithinPlayerRadius(scale.x)) { + if (isWithinPlayerRadius(mScale.x)) { mStateMgr.changeState(StateID_AreaIn); } } @@ -68,7 +68,7 @@ void dTgTumbleWeed_c::executeState_AreaIn() { return; } } - if (!isWithinPlayerRadius(scale.x)) { + if (!isWithinPlayerRadius(mScale.x)) { mStateMgr.changeState(StateID_AreaOut); } } @@ -84,7 +84,7 @@ void dTgTumbleWeed_c::initializeState_Wind() { } void dTgTumbleWeed_c::executeState_Wind() { - if (isWithinPlayerRadius(scale.x)) { + if (isWithinPlayerRadius(mScale.x)) { mStateMgr.changeState(StateID_AreaIn); } else { mStateMgr.changeState(StateID_AreaOut); diff --git a/src/d/a/d_a_base.cpp b/src/d/a/d_a_base.cpp index 41584bfa..3ae517e2 100644 --- a/src/d/a/d_a_base.cpp +++ b/src/d/a/d_a_base.cpp @@ -1,6 +1,7 @@ #include "d/a/d_a_base.h" -#include "d/a/obj/d_a_obj_base.h" + #include "d/a/d_a_player.h" +#include "d/a/obj/d_a_obj_base.h" #include "f/f_list_nd.h" #include "m/m_vec.h" #include "toBeSorted/event.h" @@ -57,7 +58,7 @@ dAcBase_c::dAcBase_c() if (s_Create_Scale) { SetScale(*s_Create_Scale); } else { - scale.set(1.0f, 1.0f, 1.0f); + mScale.set(1.0f, 1.0f, 1.0f); } if (s_Create_Parent != nullptr) { @@ -77,8 +78,10 @@ dAcBase_c::dAcBase_c() dAcBase_c::~dAcBase_c() {} -void dAcBase_c::setTempCreateParams(mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, - dAcBase_c *parent, u8 subtype, s16 unkFlag, u8 viewClipIdx, ObjInfo *objInfo) { +void dAcBase_c::setTempCreateParams( + mVec3_c *pos, mAng3_c *rot, mVec3_c *scale, s32 roomId, u32 params2, dAcBase_c *parent, u8 subtype, s16 unkFlag, + u8 viewClipIdx, ObjInfo *objInfo +) { s_Create_Position = pos; s_Create_Rotation = rot; s_Create_Scale = scale; @@ -239,8 +242,9 @@ u32 dAcBase_c::itemDroppingAndGivingRelated(mVec3_c *spawnPos, int subtype) { params2 = param2Copy | 0xFF000000; // mAng3_c rot = {}; s16 rot = 0; - return SpecialItemDropMgr::giveSpecialDropItem(SpecialItemDropMgr::sInstance, param2Copy >> 0x18, roomid, spawnPos, - subtype, &rot, -1); + return SpecialItemDropMgr::giveSpecialDropItem( + SpecialItemDropMgr::sInstance, param2Copy >> 0x18, roomid, spawnPos, subtype, &rot, -1 + ); } // 8002cf90 @@ -356,8 +360,9 @@ s32 doAbs(s16 val) { } // Similar weirdness as the above function. Also, r29->31 are initted in the wrong order? // 8002d290 -bool dAcBase_c::getDistanceAndAngleToActor(dAcBase_c *actor, f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, - s16 *outDiffAngleY, s16 *outDiffAngleX) { +bool dAcBase_c::getDistanceAndAngleToActor( + dAcBase_c *actor, f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX +) { f32 distSquared = 3.402823e+38f; s16 angleToActorY, angleToActorX; bool isWithinRange = false; @@ -371,7 +376,7 @@ bool dAcBase_c::getDistanceAndAngleToActor(dAcBase_c *actor, f32 distThresh, s16 angleToActorX = targetAngleX(&position, &actor->position); if ((distSquared <= distThresh * distThresh) && (doAbs(s32(rotation.y.mVal - angleToActorY)) <= yAngle) && - (doAbs(s32(rotation.x.mVal - angleToActorX)) <= xAngle)) { + (doAbs(s32(rotation.x.mVal - angleToActorX)) <= xAngle)) { isWithinRange = true; } } @@ -398,8 +403,9 @@ bool dAcBase_c::isWithinPlayerRadius(f32 radius) const { } // 8002d440 -bool dAcBase_c::getDistanceAndAngleToPlayer(f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, - s16 *outDiffAngleX) { +bool dAcBase_c::getDistanceAndAngleToPlayer( + f32 distThresh, s16 yAngle, s16 xAngle, f32 *outDist, s16 *outDiffAngleY, s16 *outDiffAngleX +) { return getDistanceAndAngleToActor(dAcPy_c::LINK, distThresh, yAngle, xAngle, outDist, outDiffAngleY, outDiffAngleX); } @@ -483,8 +489,10 @@ void dAcBase_c::changeLoadedEntitiesNoSet() { // spawns GroupType2 (ACTOR) // 8002d980 -dAcBase_c *dAcBase_c::createActor(ProfileName actorId, u32 actorParams1, mVec3_c *actorPosition, mAng3_c *actorRotation, - mVec3_c *actorScale, u32 actorParams2, s32 actorRoomid, dBase_c *actorRef) { +dAcBase_c *dAcBase_c::createActor( + ProfileName actorId, u32 actorParams1, mVec3_c *actorPosition, mAng3_c *actorRotation, mVec3_c *actorScale, + u32 actorParams2, s32 actorRoomid, dBase_c *actorRef +) { if (actorPosition == nullptr) { actorPosition = &position; } @@ -494,7 +502,7 @@ dAcBase_c *dAcBase_c::createActor(ProfileName actorId, u32 actorParams1, mVec3_c } if (actorScale == nullptr) { - actorScale = &scale; + actorScale = &mScale; } if (actorRoomid == 63) { @@ -503,16 +511,19 @@ dAcBase_c *dAcBase_c::createActor(ProfileName actorId, u32 actorParams1, mVec3_c u32 newParams2 = actorParams2 != 0 ? getParams2_ignoreLower() : -1; - setTempCreateParams(actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, - 0xFF, nullptr); + setTempCreateParams( + actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, 0xFF, nullptr + ); dBase_c *room = RoomManager::getRoom(roomid); return (dAcBase_c *)dBase_c::createBase(actorId, room, actorParams1, ACTOR); } // spawns GroupType2 (STAGE) // 8002da80 -dAcBase_c *dAcBase_c::createActorStage(ProfileName actorId, u32 actorParams1, mVec3_c *actorPosition, - mAng3_c *actorRotation, mVec3_c *actorScale, u32 actorParams2, s32 actorRoomid, dBase_c *actorRef) { +dAcBase_c *dAcBase_c::createActorStage( + ProfileName actorId, u32 actorParams1, mVec3_c *actorPosition, mAng3_c *actorRotation, mVec3_c *actorScale, + u32 actorParams2, s32 actorRoomid, dBase_c *actorRef +) { if (actorPosition == nullptr) { actorPosition = &position; } @@ -522,7 +533,7 @@ dAcBase_c *dAcBase_c::createActorStage(ProfileName actorId, u32 actorParams1, mV } if (actorScale == nullptr) { - actorScale = &scale; + actorScale = &mScale; } if (actorRoomid == 63) { @@ -531,8 +542,9 @@ dAcBase_c *dAcBase_c::createActorStage(ProfileName actorId, u32 actorParams1, mV u32 newParams2 = actorParams2 != 0 ? getParams2_ignoreLower() : -1; - setTempCreateParams(actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, - 0xFF, nullptr); + setTempCreateParams( + actorPosition, actorRotation, actorScale, actorRoomid, newParams2, (dAcBase_c *)actorRef, 0, -1, 0xFF, nullptr + ); dBase_c *room = RoomManager::getRoom(roomid); return (dAcBase_c *)dBase_c::createBase(actorId, room, actorParams1, STAGE); } diff --git a/src/d/a/obj/d_a_obj_fairy.cpp b/src/d/a/obj/d_a_obj_fairy.cpp index 6df649bd..23fcc6d3 100644 --- a/src/d/a/obj/d_a_obj_fairy.cpp +++ b/src/d/a/obj/d_a_obj_fairy.cpp @@ -1,7 +1,6 @@ #include #include - SPECIAL_ACTOR_PROFILE(OBJ_FAIRY, dAcObjFairy_c, fProfile::OBJ_FAIRY, 0x166, 0, 2); STATE_DEFINE(dAcObjFairy_c, Wait); @@ -52,7 +51,7 @@ int dAcObjFairy_c::draw() { if (!isCuring()) { static mQuat_c rot(0.0f, 0.0f, 0.0f, 10.0f); - drawShadow(mShadow, nullptr, worldMatrix, &rot, -1, -1, -1, -1, -1, position.y - field_0x4B0); + drawShadow(mShadow, nullptr, mWorldMtx, &rot, -1, -1, -1, -1, -1, position.y - field_0x4B0); } } @@ -116,7 +115,7 @@ bool dAcObjFairy_c::shouldAvoidLink() const { bool dAcObjFairy_c::isCuring() const { return mStateMgr.isState(StateID_CureStart) || mStateMgr.isState(StateID_Cure) || - mStateMgr.isState(StateID_CureEnd); + mStateMgr.isState(StateID_CureEnd); } bool dAcObjFairy_c::canTargetWithBugNet() const { diff --git a/src/d/a/obj/d_a_obj_switch.cpp b/src/d/a/obj/d_a_obj_switch.cpp index 74d51d41..d514b3a5 100644 --- a/src/d/a/obj/d_a_obj_switch.cpp +++ b/src/d/a/obj/d_a_obj_switch.cpp @@ -1,6 +1,8 @@ #include #include #include +#include +#include #include #include @@ -27,10 +29,10 @@ void dAcOswMdlCallback_c::timingB(u32 nodeId, nw4r::g3d::WorldMtxManip *manip, n static bool isPushableBlock(dAcBase_c *actor) { return actor->isActorPlayer() || actor->profile_name == fProfile::OBJ_PUSH_BLOCK || - actor->profile_name == fProfile::OBJ_KIBAKO; + actor->profile_name == fProfile::OBJ_KIBAKO; } -void dAcOsw_c::interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *interactor) { +void dAcOsw_c::rideCallback(dBgW *unknown, dAcObjBase_c *actor, dAcObjBase_c *interactor) { if (!isPushableBlock(interactor)) { return; } @@ -38,20 +40,19 @@ void dAcOsw_c::interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *i dAcOsw_c *sw = static_cast(actor); // halp - if (!(link == nullptr || - ((link->mActionFlags & 0x40000) == 0 && - (((link->someFlags_0x340 & 0x800000) == 0 || + if (!(link == nullptr || ((link->mActionFlags & 0x40000) == 0 && + (((link->someFlags_0x340 & 0x800000) == 0 || ((link->getCurrentCarriedActor() != nullptr && - link->getCurrentCarriedActor()->mActorCarryInfo.testCarryFlag(0x04)))))))) { + link->getCurrentCarriedActor()->mActorCarryInfo.testCarryFlag(0x04)))))))) { return; } if (interactor->mActorCarryInfo.isCarried != 1) { if (link == nullptr || (link->mActionFlags & 0xC70852) == 0) { if (!sw->someInteractCheck(link != nullptr)) { bool needsOnFlag = sw->mOnSceneFlag < 0xFF && - !SceneflagManager::sInstance->checkBoolFlag(sw->roomid, sw->mOnSceneFlag); + !SceneflagManager::sInstance->checkBoolFlag(sw->roomid, sw->mOnSceneFlag); if (!needsOnFlag && sw->mObjRef.get() == nullptr && link != nullptr && sw->field_0x5F1 == 0 && - sw->mStateMgr.isState(StateID_On)) { + sw->mStateMgr.isState(StateID_On)) { link->field_0x360 |= 0x8000; } } @@ -60,31 +61,32 @@ void dAcOsw_c::interactCallback(void *unknown, dAcBase_c *actor, dAcObjBase_c *i } } -extern "C" void fn_8033CE10(); - bool dAcOsw_c::createHeap() { nw4r::g3d::ResFile resFile = getOarcResFile(SWITCH_TYPES[mSwitchType]); nw4r::g3d::ResMdl resMdl = resFile.GetResMdl(SWITCH_TYPES[mSwitchType]); TRY_CREATE(mModel.create(resMdl, &heap_allocator, 0x20, 1, nullptr)); - field_0x5E8 = scale.x * - (resMdl.GetResNode("base").mNode.ref().FLOAT_0x50 - resMdl.GetResNode("base").mNode.ref().FLOAT_0x44); - void *dbzData = getOarcDZB(SWITCH_TYPES[mSwitchType], SWITCH_TYPES[mSwitchType]); - void *plcData = getOarcPLC(SWITCH_TYPES[mSwitchType], SWITCH_TYPES[mSwitchType]); - scale.set(1.0f, 0.8f, 1.0f); + field_0x5E8 = mScale.x * + (resMdl.GetResNode("base").mNode.ref().FLOAT_0x50 - resMdl.GetResNode("base").mNode.ref().FLOAT_0x44); + cBgD_t *dbzData = (cBgD_t *)getOarcDZB(SWITCH_TYPES[mSwitchType], SWITCH_TYPES[mSwitchType]); + PLC *plcData = (PLC *)getOarcPLC(SWITCH_TYPES[mSwitchType], SWITCH_TYPES[mSwitchType]); + mScale.set(1.0f, 0.8f, 1.0f); updateMatrix(); - field_0x5B8.set(worldMatrix); - mModel.setLocalMtx(worldMatrix); - return !mCollision.create(dbzData, plcData, true, field_0x5B8, scale, fn_8033CE10); + field_0x5B8.set(mWorldMtx); + mModel.setLocalMtx(mWorldMtx); + + bool set = mCollision.Set(dbzData, plcData, 1, &field_0x5B8, &mScale); + mCollision.SetCrrFunc(dBgS_MoveBGProc_TypicalRotY); + return !set; } int dAcOsw_c::actorCreate() { mSwitchType = params & 0xF; mOnSceneFlag = (params >> 0xE); CREATE_ALLOCATOR(dAcOsw_c); - mCollision.interactFunc = interactCallback; + mCollision.SetRideCallback(rideCallback); mModel.setCallback(&mButtonCtrl); - CollisionCheckContext::get()->registerActorBgCollision(mCollision, this); + dBgS::GetInstance()->Regist(&mCollision, this); mOffSceneFlag = (params >> 0x4); mCanBeSeen = ((params >> 0xC) & 3) == 0; nw4r::g3d::ResMdl resMdl = mModel.getResMdl(); @@ -107,10 +109,10 @@ int dAcOsw_c::actorPostCreate() { field_0x5A0.check(roomid, position, 0, 30.0f, 0.1f); if (field_0x5A0.field_0x00 <= 0.0f) { mHidden = true; - scale.set(0.0f, 0.0f, 0.0f); + mScale.set(0.0f, 0.0f, 0.0f); } else { mShown = true; - scale.set(1.0f, 1.0f, 1.0f); + mScale.set(1.0f, 1.0f, 1.0f); } } @@ -124,7 +126,7 @@ int dAcOsw_c::actorPostCreate() { } } } while (parent != nullptr); - mModel.setScale(scale); + mModel.setScale(mScale); return SUCCEEDED; } @@ -148,7 +150,7 @@ int dAcOsw_c::actorExecute() { if (mCanBeSeen) { field_0x5A0.check(roomid, position, 0, 30.0f, 0.1f); if (field_0x5A0.field_0x00 <= 0.0f) { - if (scale.x >= 1.0f) { + if (mScale.x >= 1.0f) { if (!mHidden) { fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_754_, &position, &rotation, 0, 0, 0, 0, 0); playSound(0xC0B); @@ -157,11 +159,11 @@ int dAcOsw_c::actorExecute() { } else { mHidden = false; } - sLib::chase(&scale.x, 0.0f, 0.07f); - scale.y = scale.x; - scale.z = scale.x; + sLib::chase(&mScale.x, 0.0f, 0.07f); + mScale.y = mScale.x; + mScale.z = mScale.x; } else { - if (scale.x <= 0.0f) { + if (mScale.x <= 0.0f) { if (!mShown) { fn_800298B0(PARTICLE_RESOURCE_ID_MAPPING_754_, &position, &rotation, 0, 0, 0, 0, 0); playSound(0xC0A); @@ -170,20 +172,20 @@ int dAcOsw_c::actorExecute() { } else { mShown = false; } - sLib::chase(&scale.x, 1.0f, 0.07f); - scale.z = scale.x; + sLib::chase(&mScale.x, 1.0f, 0.07f); + mScale.z = mScale.x; } } updateMatrix(); - field_0x5B8.set(worldMatrix); + field_0x5B8.set(mWorldMtx); mMtx_c tmp; PSMTXTrans(tmp, 0.0f, mButtonCtrl.mElevation, 0.0f); PSMTXConcat(field_0x5B8, tmp, field_0x5B8); - mModel.setScale(scale); - mModel.setLocalMtx(worldMatrix); + mModel.setScale(mScale); + mModel.setLocalMtx(mWorldMtx); mModel.calc(false); - mCollision.execute(); + mCollision.Move(); field_0x5F3 = 0; mActivatedByPlayer = 0; field_0x5F2 = field_0x5F1; @@ -212,7 +214,7 @@ void dAcOsw_c::initializeState_OnWait() { } } void dAcOsw_c::executeState_OnWait() { - sLib::chase(&scale.y, 0.8f, 0.12f); + sLib::chase(&mScale.y, 0.8f, 0.12f); if (field_0x5F1 != 0) { field_0x5F3 = 1; } @@ -282,7 +284,7 @@ void dAcOsw_c::executeState_Off() { void dAcOsw_c::finalizeState_Off() {} void dAcOsw_c::initializeState_None() { - scale.y = 0.8f; + mScale.y = 0.8f; mButtonCtrl.mElevation = -20.0f; } void dAcOsw_c::executeState_None() {} diff --git a/src/d/col/bg/d_bg_pc.cpp b/src/d/col/bg/d_bg_pc.cpp new file mode 100644 index 00000000..304c5dd2 --- /dev/null +++ b/src/d/col/bg/d_bg_pc.cpp @@ -0,0 +1,5 @@ +#include "d/col/bg/d_bg_pc.h" + +bool dBgPc::getWtr() const { + return (m_code.code3 & 0x1F) == 0xC; +} diff --git a/src/d/col/bg/d_bg_plc.cpp b/src/d/col/bg/d_bg_plc.cpp new file mode 100644 index 00000000..49e287ab --- /dev/null +++ b/src/d/col/bg/d_bg_plc.cpp @@ -0,0 +1,9 @@ +#include "d/col/bg/d_bg_plc.h" + +void dBgPlc::setBase(void *pPlc) { + mBase = (PLC *)pPlc; +} + +u32 dBgPlc::getGrpCode(int idx) const { + return getCode(idx)->code4; +} diff --git a/src/d/col/bg/d_bg_s.cpp b/src/d/col/bg/d_bg_s.cpp new file mode 100644 index 00000000..1dd88fb1 --- /dev/null +++ b/src/d/col/bg/d_bg_s.cpp @@ -0,0 +1,1224 @@ +#include "d/col/bg/d_bg_s.h" + +#include "d/col/bg/d_bg_s_acch.h" +#include "d/col/bg/d_bg_s_gnd_chk.h" +#include "d/col/bg/d_bg_s_lin_chk.h" +#include "d/col/bg/d_bg_s_roof_chk.h" +#include "d/col/bg/d_bg_s_sph_chk.h" +#include "d/col/bg/d_bg_s_wtr_chk.h" +#include "d/col/c/c_bg_s_shdw_draw.h" +#include "d/col/c/c_m3d.h" +#include "d/col/c/c_partition.h" +#include "toBeSorted/arc_managers/oarc_manager.h" +#include "toBeSorted/scgame.h" + +const char *MAP_SOLID_MATERIAL_NAMES[31] = { + 0, + "tex/m_tuti.bti", + "tex/m_rock.bti", + "tex/m_sand.bti", + "tex/m_grass.bti", + "tex/m_tree.bti", + 0, + 0, + "tex/m_stone.bti", + 0, + "tex/m_metal.bti", + 0, + 0, + 0, + "tex/m_carpet.bti", + 0, + "tex/m_wood.bti", + 0, + "tex/m_naraku.bti", + 0, + "tex/m_tree.bti", + "tex/m_tree.bti", + "tex/m_stone.bti", + "tex/m_metal.bti", + "tex/m_metal.bti", + 0, + 0, + 0, + 0, + 0, + "tex/m_stone.bti", +}; + +const char *MAP_SCROLL_MATERIAL_NAMES[5] = { + "tex/m_lava.bti", "tex/m_water.bti", "tex/m_numa.bti", "tex/m_quicksand.bti", "tex/m_death.bti", +}; + +const char *SKYKEEP_STAGE_NAMES[8] = { + "D003_0", "D003_1", "D003_2", "D003_3", "D003_4", "D003_5", "D003_6", "D003_7", +}; + +GXColor Color_0x80574060 = {0xFF, 0xFF, 0xFF, 0x80}; +char common_folder[] = "Common"; +char MAP_GRADATION_FILE[] = "dat/MapGradation.dat"; +char MAP_SCROLL_TEX_FILE[] = "dat/mapScrollTex_00.dat"; + +void _float_ordering() { + -1000000000.0f; + 1000000000.0f; + 0.0f; + 1000.0f; + 1.0f; + -1.0f; + 0.5f; + -0.8f; + 1200.0f; + -0.5f; + -10000.0f; + 100.0f; + 255.0f; + 4503599627370496.0; // Conversions + 4503601774854144.0; // Conversions + 135.0f; + (f32)65535; + (1 / 256.f); +} + +cBgS_ChkElm::cBgS_ChkElm() { + Init(); +} + +cBgS_ChkElm::~cBgS_ChkElm() {} + +void cBgS_ChkElm::Init() { + mpBgW = nullptr; + mObj.unlink(); +} + +void cBgS_ChkElm::Regist2(dBgW_Base *pdBgW, dAcObjBase_c *pObj) { + mpBgW = pdBgW; + if (pObj) { + mObj.link(pObj); + } else { + mObj.unlink(); + } +} + +void cBgS_ChkElm::Release() { + Init(); +} + +cBgS::cBgS() : mSetCounter(0) {} + +cBgS::~cBgS() {} + +void cBgS::fn_80339de0(dBgW_Base *pBgW) { + if (!cPartition::fn_80339070(pBgW->GetBnd())) { + return pBgW->vt_0x3C(); + } +} + +bool cBgS::Regist(dBgW_Base *pBgBase, dAcObjBase_c *pObj) { + if (pBgBase->ChkMemoryError() || pBgBase->ChkNotReady()) { + return true; + } + + for (s32 i = 0; i < ARRAY_LENGTH(mChkElem); ++i) { + // If not assigned already + if (mChkElem[i].mpBgW == nullptr) { + mChkElem[i].Regist2(pBgBase, pObj); + pBgBase->Regist(i); + // Set next slot available? + if (mSetCounter < i + 1) { + mSetCounter = i + 1; + } + fn_80339de0(pBgBase); + return false; + } + } + pBgBase->Release(); + + return true; +} + +bool cBgS::Release(dBgW_Base *pBgW) { + if (pBgW == nullptr) { + return true; + } + + if (!pBgW->ChkUsed()) { + return false; + } + + u32 id = pBgW->GetId(); + if (id <= BG_ID_MAX - 1 && mChkElem[id].mpBgW != nullptr) { + mChkElem[id].Release(); + pBgW->Release(); + s32 oldSet = mSetCounter; + if (mSetCounter == (s32)id + 1) { + mSetCounter = 0; + for (int i = 0; i < oldSet; ++i) { + if (mChkElem[i].mpBgW) { + mSetCounter = i + 1; + } + } + } + } else { + return true; + } + + return false; +} + +void cBgS::Ct() { + mSetCounter = 0; + for (int i = 0; i < BG_ID_MAX; ++i) { + mChkElem[i].Init(); + } + cPartition::fn_80338fb0(); + mpBgKCol = nullptr; + mAcOBg.unlink(); + dBgS_ObjGndChk::ClearInstance(); + dBgS_ObjLinChk::ClearInstance(); + dBgS_WtrLinChk::ClearInstance(); + dBgS_ObjRoofChk::ClearInstance(); + dBgS_WtrChk::ClearInstance(); +} + +void cBgS::Dt() { + for (int i = 0; i < BG_ID_MAX; ++i) { + if (mChkElem[i].mpBgW != nullptr) { + mChkElem[i].Release(); + } + mChkElem[i].Init(); + } + mSetCounter = 0; +} + +struct cBgD_Grp_t_ { + u32 strOffset; + u8 data[0x30]; +}; + +void cBgS::ConvDzb(void *pDzb) { + // this is identical to cBgD_t except using u32's for the table offsets. + // u32 is needed to match in ConvDzb ? + struct cBgD_t_ { + /* 0x00 */ int mVtxNum; + /* 0x04 */ u32 mVtxTbl; + /* 0x08 */ int mTriNum; + /* 0x0C */ u32 mTriTbl; + /* 0x10 */ int mBlkNum; + /* 0x14 */ u32 mBlkTbl; + /* 0x18 */ int mTreeNum; + /* 0x1C */ u32 mTreeTbl; + /* 0x20 */ int mGrpNum; + /* 0x24 */ u32 mGrpTbl; + /* 0x28 */ int mTiNum; + /* 0x2C */ u32 mTiTbl; + /* 0x30 */ u32 mFlags; + }; + cBgD_t_ *pbgd = (cBgD_t_ *)pDzb; + + if ((pbgd->mFlags & 0x80000000) == 0) { + pbgd->mFlags |= 0x80000000; + } else { + return; + } + + if (pbgd->mVtxTbl != 0) { + pbgd->mVtxTbl += (u32)pDzb; + } + + pbgd->mTriTbl += (u32)pDzb; + pbgd->mBlkTbl += (u32)pDzb; + pbgd->mTreeTbl += (u32)pDzb; + pbgd->mGrpTbl += (u32)pDzb; + pbgd->mTiTbl += (u32)pDzb; + + for (int i = 0; i < pbgd->mGrpNum; ++i) { + cBgD_Grp_t_ &grp = ((cBgD_Grp_t_ *)pbgd->mGrpTbl)[i]; + grp.strOffset = (u32)pbgd + (int)grp.strOffset; + } +} + +void cBgS::fn_8033a1e0() { + cBgS_ChkElm *endElm = &mChkElem[mSetCounter]; + for (cBgS_ChkElm *chk_elm = &mChkElem[0]; chk_elm < endElm; ++chk_elm) { + if (chk_elm->ChkUsed()) { + chk_elm->mpBgW->vt_0x3C(); + } + } +} + +bool cBgS::LineCross(cBgS_LinChk *pLine) { + pLine->ClearPi(); + pLine->ClrHit(); + cM3dGAab aabb; + aabb.SetBounds(pLine->mLin.mStart, pLine->mLin.mEnd); + pLine->mPartition.fn_803391f0(&aabb); + + cBgS_ChkElm *chkElm = mChkElem; + int i = 0; + do { + if (chkElm->CheckAll(pLine) && chkElm->mpBgW->LineCheck(pLine)) { + const dAcObjBase_c *pObj = chkElm->mObj.get(); + pLine->SetActorInfo(i, chkElm->mpBgW, pObj ? pObj->unique_ID : 0); + pLine->SetHit(); + } + + i++; + chkElm++; + } while (i < mSetCounter); + + if (pLine->ChkHit()) { + pLine->SetEnd(&pLine->mLin.mEnd); + return true; + } else { + return false; + } +} + +f32 cBgS::GroundCross(cBgS_GndChk *pGnd) { + pGnd->SetNowY(-1.0e9); + pGnd->ClearPi(); + pGnd->mPartition.Calc(&pGnd->mPos); + + pGnd->SetField_0x68(pGnd->mPos); + + cBgS_ChkElm *chkElm = mChkElem; + int i = 0; + do { + if (chkElm->CheckAll(pGnd) && chkElm->mpBgW->GroundCross(pGnd)) { + const dAcObjBase_c *pObj = chkElm->mObj.get(); + pGnd->SetActorInfo(i, chkElm->mpBgW, pObj ? pObj->unique_ID : 0); + } + i++; + chkElm++; + } while (i < mSetCounter); + + return pGnd->GetNowY(); +} + +void cBgS::ShdwDraw(cBgS_ShdwDraw *pShdw) { + pShdw->mPartition.fn_803391f0(pShdw->GetBndP()); + + const cBgS_ChkElm *chkElm = mChkElem; + const cBgS_ChkElm *end = &mChkElem[mSetCounter]; + do { + if (chkElm->CheckAll(pShdw)) { + chkElm->mpBgW->ShdwDraw(pShdw); + } + chkElm++; + } while (chkElm < end); +} + +const dAcObjBase_c *cBgS::GetActorPointer(int idx) const { + return mChkElem[idx].mObj.get(); +} + +const dAcObjBase_c *cBgS::GetActorPointer(const cBgS_PolyInfo &info) const { + if (!ChkPolySafe(info)) { + return nullptr; + } + return GetActorPointer(info.GetBgIndex()); +} + +dBgW_Base *cBgS::GetBgWBasePointer(cBgS_PolyInfo const &info) const { + if (!ChkPolySafe(info)) { + return nullptr; + } + return mChkElem[info.GetBgIndex()].mpBgW; +} + +bool cBgS::ChkPolySafe(cBgS_PolyInfo const &info) const { + if (!info.ChkSetInfo()) { + return false; + } + + u32 bgIndex = info.GetBgIndex(); + if (bgIndex > BG_ID_MAX - 1) { + return false; + } + + if (mChkElem[bgIndex].mpBgW == nullptr) { + return false; + } + const dAcObjBase_c *pObj = mChkElem[bgIndex].mObj.get(); + return info.ChkSafe(mChkElem[bgIndex].mpBgW, pObj ? pObj->unique_ID : 0); +} + +bool cBgS::GetTriPla(cBgS_PolyInfo const &info, cM3dGPla *pPlane) const { + if (!ChkPolySafe(info)) { + return nullptr; + } + mChkElem[info.GetBgIndex()].mpBgW->GetTriPla(info, pPlane); + return true; +} + +bool cBgS::GetTriPnt(cBgS_PolyInfo const &info, mVec3_c *pVA, mVec3_c *pVB, mVec3_c *pVC) const { + if (!ChkPolySafe(info)) { + return nullptr; + } + return mChkElem[info.GetBgIndex()].mpBgW->GetTriPnt(info, pVA, pVB, pVC); +} + +bool cBgS::RegistKCol(dBgWKCol *pKCol, dAcObg_c *pAcBg) { + if (mpBgKCol == nullptr) { + mpBgKCol = pKCol; + mAcOBg.link(pAcBg); + return true; + } + return false; +} + +bool cBgS::ReleaseKCol(dBgWKCol *pKCol) { + if (mpBgKCol && mpBgKCol == pKCol) { + mpBgKCol = nullptr; + return true; + } + return false; +} + +// u32 cBgS::GetGrpInf(cBgS_PolyInfo const &) const {} + +// s32 cBgS::GetGrpRoomId(cBgS_PolyInfo const &) const {} + +void dBgS::Regist(dBgW_Base *pBg, int idx) { + mChkElem[idx].Regist2(pBg, mAcOBg.get()); +} + +dBgS *dBgS::GetInstance() { + return spInstance; +} + +dBgS::dBgS() : mMapTexture(0), mInSkyKeep(false), mList_0x388C(), mMapGradation() { + // Sad TList :( + spInstance = this; +} + +dBgS::~dBgS() { + spInstance = nullptr; +} + +void dBgS::Ct() { + cBgS::Ct(); + for (int i = 0; i < BG_ID_MAX; ++i) { + mColllisionTbl[i] = nullptr; + } + + // TODO + OarcManager::sInstance->getData(common_folder, MAP_GRADATION_FILE); + + mInSkyKeep = false; + for (int i = 0; i < 8; ++i) { + if (ScGame::isCurrentStage(SKYKEEP_STAGE_NAMES[i])) { + mInSkyKeep = true; + return; + } + } +} + +void dBgS::Dt() { + cBgS::Dt(); + for (int i = 0; i < BG_ID_MAX; ++i) { + mColllisionTbl[i] = nullptr; + } + ClearMapSegments(); +} + +void dBgS::ClrMoveFlag() { + const cBgS_ChkElm *end = &mChkElem[mSetCounter]; + for (cBgS_ChkElm *chkElm = mChkElem; chkElm < end; chkElm++) { + if (chkElm->mpBgW) { + if (chkElm->mObj.get()) { + chkElm->mpBgW->CalcDiffShapeAngleY(chkElm->mObj.get()->rotation.y); + } + chkElm->mpBgW->OffMoveFlag(); + } + } +} + +bool dBgS::Regist(dBgW_Base *pBg, dAcObjBase_c *pObj) { + if (!pBg) { + return true; + } + if (pBg->ChkUsed()) { + return false; + } + if (pObj && pBg->ChkMoveBg()) { + pBg->SetOldShapeAngleY(pObj->rotation.y); + pBg->SetRoomId(pObj->getRoomId()); + } + return cBgS::Regist(pBg, pObj); +} + +bool dBgS::RegistBg(dBgW_Base *pBg, dAcObjBase_c *pObj) { + // Bg is null, idk why it allows it + if (!pBg) { + return true; + } + + // Already Registered + if (pBg->GetRegistId() != BG_ID_MAX) { + return false; + } + + // Update RoomID if moved + if (pObj && pBg->ChkMoveBg()) { + pBg->SetRoomId(pObj->getRoomId()); + } + + // Check Bg + if (pBg->ChkMemoryError() || pBg->ChkNotReady()) { + return true; + } + + for (int i = 0; i < BG_ID_MAX; ++i) { + if (mColllisionTbl[i] == nullptr) { + mColllisionTbl[i] = pBg; + pBg->RegistBg(i); + if (mColllisionTblLen < i + 1) { + mColllisionTblLen = i + 1; + } + return false; + } + } + + pBg->UnRegistBg(); + return true; +} + +bool dBgS::UnRegist(dBgW_Base *pBg) { + if (!pBg) { + return true; + } + + u32 id = pBg->GetRegistId(); + + bool ret; + if (id == BG_ID_MAX) { + return false; + } + + // Not Quite Right + if (id <= (BG_ID_MAX - 1) && mColllisionTbl[id] != nullptr) { + mColllisionTbl[id] = nullptr; + pBg->UnRegistBg(); + + int oldLen = mColllisionTblLen; + if (oldLen == (int)id + 1) { + mColllisionTblLen = 0; + // Reset the count + for (int i = 0; i < oldLen; i++) { + if (mColllisionTbl[i] != nullptr) { + mColllisionTblLen = i + 1; + } + } + } + ret = false; + } else { + ret = true; + } + + return ret; +} + +bool dBgS::ChkMoveBG(cBgS_PolyInfo const &info, bool bChkLock) { + dBgW_Base *pBg = GetInstance()->GetBgWBasePointer(info); + if (pBg) { + if (bChkLock && pBg->ChkLock()) { + return false; + } + + if (pBg->ChkMoveBg()) { + return true; + } + } + return false; +} + +u32 dBgS::ChkShadowThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetShdwThrough(info.GetPolyIndex()); + } + return 0; +} + +int dBgS::GetSpecialCode(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetSpecialCode(info); + } + return 0; +} + +s32 dBgS::GetWallCode(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetWallCode(info); + } + return 0; +} + +int dBgS::GetPolyAtt0(cBgS_PolyInfo const &info) { + if (!ChkPolySafe(info)) { + return 0; + } + if (GetSpecialCode(info) == 7 /* LAVA */) { + return 6; + } + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyAtt0Material(info); +} + +int dBgS::GetPolyAtt1(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyAtt1(info); + } + return 0; +} + +// TODO: Map to Enums And Cleanup?? +int dBgS::GetMapCode(int att0, int att1, bool bAlt) { + if (bAlt && ScGame::currentSpawnInfo.trial == 1) { + return 0x1E; + } + if (att0 == 4 && att1 == 1) { + return 0x13; + } + if (att0 == 5) { + if (att1 == 1) { + return 0x14; + } + if (att1 == 2) { + return 0x15; + } + } else { + if ((att0 == 8) && (att1 == 1)) { + return 0x16; + } + if (att0 == 10) { + if (att1 == 1) { + return 0x17; + } + if (att1 == 2) { + return 0x18; + } + } + } + + if ((att0 == 0xc) && (att1 == 1)) { + return 0x19; + } + + if (att0 == 0xd) { + if (att1 == 1) { + return 0x1a; + } + if (att1 == 2) { + return 0x1b; + } + if (att1 == 3) { + return 0x1C; + } + } else { + if (att0 != 0xf) { + return att0; + } + if (att1 == 1) { + return 0x1d; + } + } + + return att0; +} + +int dBgS::GetLightingCode(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetLightingCode(info); + } + return 0xF; +} + +int dBgS::GetGroundCode(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetGroundCode(info); + } + return 0; +} + +int dBgS::GetCode1_0x02000000(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetCode1_0x02000000(info.GetPolyIndex()); + } + return 0; +} + +s32 dBgS::GetRoomCamId(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetRoomCamId(info); + } + return 0xFF; +} + +s32 dBgS::GetRoomId(cBgS_PolyInfo const &info) { + if (!ChkPolySafe(info)) { + return -1; + } + int roomId = mChkElem[info.GetBgIndex()].mpBgW->GetRoomId(); + if (roomId == 0xFF) { + roomId = -1; + } + return roomId; +} + +bool dBgS::GetPolyObjectThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyObjThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyCameraThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyCamThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyShadowThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetShdwThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyLinkThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyLinkThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyArrowThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyArrowThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyBombThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyBombThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyBeetleThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyBeetleThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyClawshotThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyClawshotThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyThrough_Code1_0x04000000(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetCode1_0x04000000(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyThrough_Code1_0x08000000(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetCode1_0x08000000(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolyWhipThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolyWhipThrough(info.GetPolyIndex()); + } + return false; +} + +bool dBgS::GetPolySlingshotThrough(cBgS_PolyInfo const &info) { + if (ChkPolySafe(info)) { + return mChkElem[info.GetBgIndex()].mpBgW->GetPolySlingshotThrough(info.GetPolyIndex()); + } + return false; +} + +void dBgS::WallCorrect(dBgS_Acch *pAcch, bool bSort) { + // Lmao im not doing this rn + // pAcch->CalcWallRR(); + // pAcch->CalcMovePosWork(); +} + +f32 dBgS::RoofChk(dBgS_RoofChk *pRoof) { + pRoof->Init(); + pRoof->mPartition.fn_803399b0(pRoof->GetPosP()); + pRoof->CopyPos(); + + cBgS_ChkElm *chkElm = mChkElem; + int i = 0; + do { + if (chkElm->CheckAll(pRoof)) { + const dAcObjBase_c *pObj = chkElm->mObj.get(); + dBgW_Base *pBgW = chkElm->mpBgW; + + if (pBgW->RoofChk(pRoof)) { + const dAcObjBase_c *pObj = chkElm->mObj.get(); + pRoof->SetActorInfo(i, chkElm->mpBgW, pObj ? pObj->unique_ID : 0); + } + } + ++i; + ++chkElm; + } while (i < mSetCounter); + + return pRoof->GetNowY(); +} + +bool dBgS::SplGrpChk(dBgS_SplGrpChk *pSplGrp) { + bool ret = false; + + pSplGrp->Init(); + pSplGrp->mPartition.fn_80339740(&pSplGrp->mGnd, pSplGrp->mRoof); + pSplGrp->CopyGnd(); + + cBgS_ChkElm *chkElm = mChkElem; + int i = 0; + do { + if (chkElm->CheckAll(pSplGrp)) { + const dAcObjBase_c *pObj = chkElm->mObj.get(); + dBgW_Base *pBgW = chkElm->mpBgW; + + if (!pSplGrp->ChkMoveBGOnly() || (pBgW->ChkMoveBg() && !pBgW->ChkLock())) { + if (pBgW->SplGrpChk(pSplGrp)) { + ret = true; + const dAcObjBase_c *pObj = chkElm->mObj.get(); + pSplGrp->SetActorInfo(i, chkElm->mpBgW, pObj ? pObj->unique_ID : 0); + pSplGrp->OnFind(); + } + } + } + ++i; + ++chkElm; + } while (i < mSetCounter); + + return ret; +} + +bool dBgS::SphChk(dBgS_SphChk *pSph, void *p1) { + if (pSph->mCallback == NULL) { + return false; + } + bool ret = false; + + pSph->ClearPi(); + pSph->mAabb.Set(*pSph); + pSph->mPartition.fn_803391f0(&pSph->mAabb); + + pSph->SetInfo(BG_ID_MAX, 0, 0); + + cBgS_ChkElm *chkElm = mChkElem; + int i = 0; + do { + if (chkElm->CheckAll(pSph)) { + const dAcObjBase_c *pObj = chkElm->mObj.get(); + dBgW_Base *pBgW = chkElm->mpBgW; + + pSph->SetInfo(i, pBgW, pObj ? pObj->unique_ID : 0); + if (pBgW->SphChk(pSph, p1)) { + const dAcObjBase_c *pObj = chkElm->mObj.get(); + pSph->SetActorInfo(i, chkElm->mpBgW, pObj ? pObj->unique_ID : 0); + ret = true; + } + } + ++i; + ++chkElm; + } while (i < mSetCounter); + + return ret; +} + +void dBgS::MoveBgCrrPos( + cBgS_PolyInfo const &info, bool param_1, mVec3_c *i_pos, mAng3_c *i_angle, mAng3_c *i_shapeAngle, bool param_5, + bool param_6 +) { + if (!param_1 || !info.ChkBgIndex()) { + return; + } + int bgIdx = info.GetBgIndex(); + dBgW_Base *pBg = mChkElem[bgIdx].mpBgW; + if (pBg && (!param_5 || pBg->ChkStickWall()) && (!param_6 || pBg->ChkStickRoof()) && pBg->ChkMoveFlag() && + ChkPolySafe(info)) { + // TODO -> Check CrrPos Params (void may be dAcObjBase_c) + pBg->CrrPos(info, mChkElem[bgIdx].mObj.get(), param_1, i_pos, i_angle, i_shapeAngle); + } +} + +void dBgS::MoveBgTransPos( + cBgS_PolyInfo const &info, bool param_1, mVec3_c *i_pos, mAng3_c *i_angle, mAng3_c *i_shapeAngle +) { + if (!param_1 || !info.ChkBgIndex()) { + return; + } + int bgIdx = info.GetBgIndex(); + dBgW_Base *pBg = mChkElem[bgIdx].mpBgW; + if (pBg && ChkPolySafe(info)) { + const dAcObjBase_c *pObj = GetInstance()->GetActorPointer(info); + if ((!pObj || (pObj->baseProperties & 4)) && pBg->ChkMoveFlag()) { + // TODO -> Check TransPos Params (void may be dAcObjBase_c) + pBg->TransPos(info, mChkElem[bgIdx].mObj.get(), param_1, i_pos, i_angle, i_shapeAngle); + } + } +} + +void dBgS_MoveBGProc_Typical( + dBgW *i_bgw, void *i_actor_ptr, cBgS_PolyInfo const &info, bool param_3, mVec3_c *i_pos, mAng3_c *i_angle, + mAng3_c *i_shapeAngle +) { + mMtx_c a; + if (i_bgw->GetOldInvMtx(&a) != NULL) { + mVec3_c moveOld; + PSMTXMultVec(a, *i_pos, moveOld); + + mVec3_c movePos; + PSMTXMultVec(i_bgw->mInvMtx, moveOld, movePos); + *i_pos = movePos; + } +} + +void dBgS_MoveBGProc_RotY( + dBgW *i_bgw, void *i_actor_ptr, cBgS_PolyInfo const &info, bool param_3, mVec3_c *i_pos, mAng3_c *i_angle, + mAng3_c *i_shapeAngle +) { + if (!i_shapeAngle) { + return; + } + s16 diffY = i_bgw->GetDiffShapeAngleY(); + if (i_shapeAngle) { + i_shapeAngle->y += diffY; + } + if (i_angle) { + i_angle->y += diffY; + } +} + +void dBgS_MoveBGProc_TypicalRotY( + dBgW *i_bgw, void *i_actor_ptr, cBgS_PolyInfo const &i_poly, bool param_3, mVec3_c *i_pos, mAng3_c *i_angle, + mAng3_c *i_shapeAngle +) { + dBgS_MoveBGProc_Typical(i_bgw, i_actor_ptr, i_poly, param_3, i_pos, i_angle, i_shapeAngle); + dBgS_MoveBGProc_RotY(i_bgw, i_actor_ptr, i_poly, param_3, i_pos, i_angle, i_shapeAngle); +} + +void dBgS::RideCallBack(cBgS_PolyInfo const &info, dAcObjBase_c *pAc) { + int idx = info.GetBgIndex(); + + dBgW_Base *pBgW = mChkElem[idx].mpBgW; + if (!pBgW->ChkUsed()) { + return; + } + pBgW->CallRideCallback(mChkElem[idx].mObj.get(), pAc); +} + +void dBgS::ArrowStickCallBack(cBgS_PolyInfo const &info, dAcObjBase_c *pAc, mVec3_c &vec) { + int idx = info.GetBgIndex(); + + dBgW_Base *pBgW = mChkElem[idx].mpBgW; + if (!pBgW->ChkUsed()) { + return; + } + pBgW->CallArrowStickCallback(mChkElem[idx].mObj.get(), pAc, vec); +} + +bool dBgS::UnkCallback(cBgS_PolyInfo const &info, dAcObjBase_c *pAc) { + int idx = info.GetBgIndex(); + + dBgW_Base *pBgW = mChkElem[idx].mpBgW; + if (!pBgW->ChkUsed()) { + return nullptr; + } + return pBgW->CallUnkCallback(mChkElem[idx].mObj.get(), pAc); +} + +dAcObjBase_c *dBgS::PushPullCallBack(cBgS_PolyInfo const &info, dAcObjBase_c *pAc, dBgW_Base::PushPullLabel label) { + int idx = info.GetBgIndex(); + + dBgW_Base *pBgW = mChkElem[idx].mpBgW; + if (!pBgW->ChkUsed()) { + return nullptr; + } + dAcObjBase_c *pObj = mChkElem[idx].mObj.get(); + if (!pObj) { + return false; + } + + if (pBgW->GetPushPullCallback() == nullptr) { + return false; + } + return pBgW->GetPushPullCallback()(pObj, pAc, label); +} + +bool dBgS_CheckBWallPoly(cBgS_PolyInfo const &info) { + cM3dGPla plane; + if (!dBgS::GetInstance()->GetTriPla(info, &plane)) { + return false; + } + if (!(plane.mNormal.y > 0.5f || plane.mNormal.y < -0.8f)) { + return true; + } + return false; +} + +bool dBgS_CheckBGroundPoly(cBgS_PolyInfo const &info) { + cM3dGPla plane; + if (!dBgS::GetInstance()->GetTriPla(info, &plane)) { + return false; + } + return plane.mNormal.y > 0.5f ? true : false; +} + +bool dBgS_CheckBRoofPoly(cBgS_PolyInfo const &info) { + cM3dGPla plane; + if (!dBgS::GetInstance()->GetTriPla(info, &plane)) { + return false; + } + return plane.mNormal.y < -0.8f ? true : false; +} + +f32 dBgS_GetNY(cBgS_PolyInfo const &info) { + cM3dGPla plane; + dBgS::GetInstance()->GetTriPla(info, &plane); + return plane.mNormal.y; +} + +mVec3_c dBgS_GetN(cBgS_PolyInfo const &info) { + cM3dGPla plane; + dBgS::GetInstance()->GetTriPla(info, &plane); + return plane.mNormal; +} + +void dBgS::UpdateScrollTex() { + MapSrollText_t *scrollTex = (MapSrollText_t *)OarcManager::sInstance->getData(common_folder, MAP_SCROLL_TEX_FILE); + for (int i = 0; i < 5; ++i, ++scrollTex) { + if (++mField_0x3864[i] >= scrollTex->mField_0x0E) { + mField_0x3864[i] = 0; + } + if (++mField_0x3878[i] >= scrollTex->mField_0x10) { + mField_0x3878[i] = 0; + } + } +} + +void dBgS::SetupMapGX(mMtx_c *) { + // TODO +} + +void dBgS::SetupMapMaterial(int matIdx, bool, s32 roomId) { + // TODO +} + +extern "C" UNKTYPE *lbl_805754B0; +UNKTYPE *dBgS::GetMapAccessor() { + return lbl_805754B0; +} + +void dBgS::DrawMap(u8 roomId, mMtx_c *, bool bColor, int) { + // TODO +} + +void dBgS::SetupScrollGX() { + GXSetNumTexGens(2); + GXSetTexCoordGen2(GX_TEXCOORD0, GX_TG_MTX3x4, GX_TG_POS, GX_TEXMTX0, FALSE, GX_DUALMTX_IDENT); + GXSetTexCoordGen2(GX_TEXCOORD1, GX_TG_MTX3x4, GX_TG_POS, GX_TEXMTX1, FALSE, GX_DUALMTX_IDENT); + GXSetNumIndStages(0); + GXSetNumTevStages(4); + GXSetTevOrder(GX_TEVSTAGE0, GX_TEXCOORD0, GX_TEXMAP0, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE0, GX_CC_ZERO, GX_CC_ZERO, GX_CC_ZERO, GX_CC_TEXC); + GXSetTevColorOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE0, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_TEXA); + GXSetTevAlphaOp(GX_TEVSTAGE0, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, true, GX_TEVPREV); + GXSetTevKColor(GX_KCOLOR3, Color_0x80574060); + GXSetTevKColorSel(GX_TEVSTAGE1, GX_TEV_KCSEL_K3_A); + GXSetTevKAlphaSel(GX_TEVSTAGE1, GX_TEV_KASEL_K3_A); + GXSetTevOrder(GX_TEVSTAGE1, GX_TEXCOORD1, GX_TEXMAP1, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE1, GX_CC_TEXC, GX_CC_CPREV, GX_CC_KONST, GX_CC_ZERO); + GXSetTevColorOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE1, GX_CA_TEXA, GX_CA_APREV, GX_CA_KONST, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE1, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, true, GX_TEVPREV); + GXSetTevOrder(GX_TEVSTAGE2, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE2, GX_CC_C0, GX_CC_C1, GX_CC_CPREV, GX_CC_ZERO); + GXSetTevColorOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE2, GX_CA_ZERO, GX_CA_ZERO, GX_CA_ZERO, GX_CA_A1); + GXSetTevAlphaOp(GX_TEVSTAGE2, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, true, GX_TEVPREV); + GXSetTevOrder(GX_TEVSTAGE3, GX_TEXCOORD_NULL, GX_TEXMAP_NULL, GX_COLOR_NULL); + GXSetTevColorIn(GX_TEVSTAGE3, GX_CC_ZERO, GX_CC_CPREV, GX_CC_C2, GX_CC_ZERO); + GXSetTevColorOp(GX_TEVSTAGE3, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, 1, GX_TEVPREV); + GXSetTevAlphaIn(GX_TEVSTAGE3, GX_CA_ZERO, GX_CA_APREV, GX_CA_A2, GX_CA_ZERO); + GXSetTevAlphaOp(GX_TEVSTAGE3, GX_TEV_ADD, GX_TB_ZERO, GX_CS_SCALE_1, true, GX_TEVPREV); + GXSetAlphaCompare(GX_ALWAYS, 0, GX_AOP_OR, GX_ALWAYS, 0); +} + +void dBgS::SetupScrollMaterial(int matIdx, s32, bool) { + // TODO +} + +void dBgS::DrawMapScroll(u8 roomId, mMtx_c *, bool bColor, int) { + // TODO +} + +void dBgS::DrawSkyKeepMap(mMtx_c *, int) { + if (!mInSkyKeep) { + return; + } + // TODO +} + +bool dBgS::ConfigureMapTexture(EGG::Heap *) { + // TODO + return false; +} + +MapLineSegment::MapLineSegment() : bShow(false) {} + +MapLineSegment::~MapLineSegment() { + Dt(); +} + +void MapLineSegment::fn_8033e9a0() { + // Shrug +} + +void MapLineSegment::Dt() { + Remove(); +} + +void MapLineSegment::fn_8033e9c0() { + // Shrug +} + +void MapLineSegment::Append() { + if (!bShow) { + dBgS::GetInstance()->AppendMapSegment(this); + bShow = true; + } +} + +void MapLineSegment::Remove() { + if (bShow) { + dBgS::GetInstance()->RemoveMapSegment(this); + bShow = false; + } +} + +void MapLineSegment::Draw(int, mMtx_c *, bool, int) { + // Default no draw +} + +void dBgS::InitMapParts() { + MapLineList::Iterator it, end; + it = mList_0x388C.GetBeginIter(); + end = mList_0x388C.GetEndIter(); + for (MapLineList::Iterator temp = it; it != end;) { + if (it != end) { + mList_0x388C.remove(&*temp); + temp = ++it; + } + } + + for (int i = 0; i < 31; ++i) { + if (MAP_SOLID_MATERIAL_NAMES[i]) { + spSolidMatTex[i] = OarcManager::sInstance->getData(common_folder, MAP_SOLID_MATERIAL_NAMES[i]); + } else { + spSolidMatTex[i] = nullptr; + } + } + for (int i = 0; i < 5; ++i) { + spScrollMapTex[i] = OarcManager::sInstance->getData(common_folder, MAP_SCROLL_MATERIAL_NAMES[i]); + } +} + +void dBgS::AppendMapSegment(MapLineSegment *pSeg) { + mList_0x388C.insert(pSeg); +} + +void dBgS::RemoveMapSegment(MapLineSegment *pSeg) { + mList_0x388C.remove(pSeg); +} + +void dBgS::DrawMapSegments(int p1, mMtx_c *p2, bool p3, int p4) { + MapLineList::Iterator end, it; + end = mList_0x388C.GetEndIter(); + it = mList_0x388C.GetBeginIter(); + while (it != end) { + it->Draw(p1, p2, p3, p4); + ++it; + }; +} + +void dBgS::ClearMapSegments() { + // Idk tbh + MapLineList::Iterator prevIt, it; + it = mList_0x388C.GetBeginIter(); + while (it != mList_0x388C.GetEndIter()) { + prevIt = it; + ++it; + mList_0x388C.remove(&*prevIt); + }; +} + +void dBgS::SetLightingCode(dAcObjBase_c *pObj, const cBgS_PolyInfo &info) { + const dAcObjBase_c *actor = GetInstance()->GetActorPointer(info); + if (actor && actor->mLightingInfo.mLightingCode != 0xF) { + pObj->mLightingInfo.mLightingCode = actor->mLightingInfo.mLightingCode; + } else { + pObj->mLightingInfo.mLightingCode = GetLightingCode(info); + } +} + +f32 dBgS::SetLightingCode(dAcObjBase_c *pObj, f32 height) { + dBgS_ObjGndChk objGndChk; + mVec3_c pos = pObj->GetPostion(); + pos.y += height; + objGndChk.SetPos(&pos); + f32 gndCross = GroundCross(&objGndChk); + if (gndCross != -1.0e9f) { + SetLightingCode(pObj, objGndChk); + } + return gndCross; +} + +int dBgS::GetLightingCode(const mVec3_c *pPos) { + dBgS_ObjGndChk objGndChk; + objGndChk.SetPos(pPos); + if (GroundCross(&objGndChk) != -1.0e9f) { + return GetLightingCode(objGndChk); + } else { + return 0xF; + } +} + +bool dBgS::GetPolyPreventObjOnly(const cBgS_PolyInfo &info) { + if (!GetPolyObjectThrough(info) && GetPolyLinkThrough(info) && GetPolyCameraThrough(info) && + GetPolyShadowThrough(info) && GetPolyArrowThrough(info) && GetPolyBombThrough(info) && + GetPolyBeetleThrough(info) && GetPolyClawshotThrough(info) && GetPolyThrough_Code1_0x08000000(info) && + GetPolyWhipThrough(info) && GetPolyThrough_Code1_0x04000000(info)) { + return true; + } + return false; +} + +bool dBgS::GetMapGradationColor(GXColor *pColor) { + if (!mMapGradation.mHasGradation) { + return false; + } + pColor->r = mMapGradation.mColorR; + pColor->g = mMapGradation.mColorG; + pColor->b = mMapGradation.mColorB; + pColor->a = mMapGradation.mColorA; + return true; +} diff --git a/src/d/col/bg/d_bg_s_acch.cpp b/src/d/col/bg/d_bg_s_acch.cpp new file mode 100644 index 00000000..17407a43 --- /dev/null +++ b/src/d/col/bg/d_bg_s_acch.cpp @@ -0,0 +1,607 @@ +#include "d/col/bg/d_bg_s_acch.h" + +#include "d/a/d_a_player.h" +#include "d/col/bg/d_bg_s.h" +#include "d/col/c/c_bg_s_lin_chk.h" +#include "d/col/c/c_bg_w.h" + +dBgS_AcchCir::dBgS_AcchCir() { + mWallRR = 0.0f; + mField_0x44 = 0.0f; + mWallH = 0.0f; + mWallR = 0.0f; + mWallHDirect = 0.0f; + mWallAngleY = 0.0f; + mFlags = 0; +} + +dBgS_AcchCir::~dBgS_AcchCir() {} + +bool dBgS_AcchCir::ChkWallHit() const { + bool ret = false; + if (mFlags & WALL_HIT) { + if (dBgS::GetInstance()->ChkPolySafe(*this)) { + ret = true; + } + } + return ret; +} + +void dBgS_AcchCir::SetWallR(f32 wallR) { + mWallR = wallR; +} + +void dBgS_AcchCir::SetWall(f32 wallH, f32 wallR) { + mWallH = wallH; + SetWallR(wallR); +} + +dBgS_Acch::dBgS_Acch() + : mFlags(0), mpPos(nullptr), mpOldPos(nullptr), mSpeed(0.0f, 0.0f, 0.0f), mpSpeed(nullptr), mpAngle(nullptr), + mpShapeAngle(nullptr), mBgIndex(0), mField_0x094(0), mField_0x098(0), mpMyObj(nullptr), mTblSize(0), + mpAcchCir(nullptr), mField_0x0A8(0.0f), mField_0x0AC(0.0f), mGroundHeight(-1e9f), mField_0x0B4(120.0f), + mField_0x0C8(0.0f), mField_0x0CC(0.0f), mRoofHeight(1e9f), mField_0x0D4(1.0f), mField_0x0D8(0.0f), + mpOutPolyInfo(nullptr), mRoofH_0x0E0(0.0f), mGroundH_0x0E4(0.0f), mField_0x0E8(1e9f), mField_0x1D0(-1.0f), + mField_0x2F4(1000.0f), mField_0x390(0), mField_0x394(0) { + SetPolyPassChk(GetPolyPassChkInfo()); + SetGrpPassChk(GetGrpPassChkInfo()); + + SetRoofNone(); + mRoof.mField_0x7C = 1; + + mField_0x398.set(0.0f, 0.0f, 0.0f); + mField_0x3A4.set(0.0f, 0.0f, 0.0f); +} + +dBgS_Acch::~dBgS_Acch() {} + +void dBgS_Acch::Set( + mVec3_c *pPos, mVec3_c *pOldPos, dAcObjBase_c *pObj, int tblSize, dBgS_AcchCir *pAccCir, mVec3_c *pSpeed, + mAng3_c *pAngle, mAng3_c *pShapeAngle +) { + mpPos = pPos; + mpOldPos = pOldPos; + mpMyObj = pObj; + + mActorId = pObj->unique_ID; + mpSpeed = pSpeed; + if (pSpeed) { + mSpeed = *pSpeed; + } else { + mSpeed.set(0.0f, 0.0f, 0.0f); + } + + mTblSize = tblSize; + mpAcchCir = pAccCir; + mpAngle = pAngle; + mpShapeAngle = pShapeAngle; + mGroundHeight = mpPos->y; + + mField_0x1A8.Init(); +} + +void dBgS_Acch::Set(dAcObjBase_c *pObj, int tblSize, dBgS_AcchCir *pAcchCir) { + mTblSize = tblSize; + mpAcchCir = pAcchCir; + mpMyObj = pObj; + mActorId = pObj->getID(); + mpPos = &pObj->GetPostion(); + mpOldPos = &pObj->GetOldPosition(); + mpSpeed = &pObj->GetVelocity(); + if (mpSpeed) { + mSpeed = pObj->GetVelocity(); + } else { + mSpeed.set(0.0f, 0.0f, 0.0f); + } + mpAngle = &pObj->GetAngle(); + mpShapeAngle = &pObj->GetRotation(); +} + +bool dBgS_Acch::fn_8033f5b0(mVec3_c *pPos, mVec3_c *pOldPos, f32 height) { + *pOldPos = *pPos; + cBgS_LinChk line; + mVec3_c v1, v2; + + v1 = *GetOldPos(); + v1.y += height; + + v2 = *pPos; + v2.y += height; + + line.Set2(v1, v2, mActorId); + + bool ret = false; + + line.SetExtChk(*this); + + if (dBgS::GetInstance()->LineCross(&line)) { + ret = true; + *pPos = line.mLin.mEnd; + cM3dGPla pla; + dBgS::GetInstance()->GetTriPla(line, &pla); + if (!cBgW_CheckBGround(pla.mNormal.y)) { + VEC3Add(pPos, pla.mNormal, pPos); + pPos->y -= height; + } + } + mpPos = pPos; + mpOldPos = pOldPos; + + return ret; +} + +void dBgS_Acch::GroundCheck(dBgS &bgs, bool param2) { + if (!(mFlags & GRND_NONE)) { + mVec3_c gnd_pos = *GetPos(); + + // This Ordering is weird + f32 temp = (mField_0x0B4 - mField_0x0A8) + mField_0x0AC; + if (mFlags & ACCH_FLAG_0x20000) { + if (temp <= 1.1f) { + temp = 1.1f; + } + } + gnd_pos.y += temp; + + if (!(mFlags & GND_THIN_CELLING_OFF)) { + mVec3_c old_pos(*GetOldPos()); + old_pos.y += 0.25f; + mVec3_c pos(*GetPos()); + bgs.MoveBgCrrPos(mGnd, Chk_0x10000000(), &old_pos, nullptr, nullptr, false, false); + bgs.MoveBgCrrPos(mGnd, Chk_0x10000000(), &pos, nullptr, nullptr, false, false); + + cBgS_LinChk line; + line.Set2(pos, old_pos, mActorId); + + line.SetExtChk(*this); + line.mBackFlag = true; + if (!bgs.LineCross(&line)) { + dBgS_RoofChk roof; + roof.mActorId = mGnd.mActorId; + roof.SetPos(&pos); + f32 roof_height = bgs.RoofChk(&roof); + cM3dGPla plane; + if (roof_height != 1e9f) { + bgs.GetTriPla(roof, &plane); + if (gnd_pos.y > roof_height) { + gnd_pos.y = roof_height; + } + } + } + } + mField_0x0AC = 0.0f; + if (gnd_pos.y > mRoofHeight) { + gnd_pos.y = mRoofHeight + 0.25f; + } + + if (gnd_pos.y < mpPos->y + mField_0x0E8 && + mpPos->y + mField_0x0E8 < (mField_0x0B4 - mField_0x0A8) + mField_0x0AC + mpPos->y) { + gnd_pos.y = mpPos->y + mField_0x0E8; + } + + mGnd.SetExtChk(*this); + mGnd.SetPos(&gnd_pos); + + mGroundHeight = bgs.GroundCross(&mGnd); + Clr_0x10000000(); + if (mGroundHeight != -1e9f) { + dBgS::GetInstance()->SetLightingCode(GetMyObj(), mGnd); + mField_0x0CC = mGroundHeight + mField_0x0A8; + if (mField_0x0CC > mField_0x0C8) { + mpPos->y = mField_0x0CC; + if (ChkClrSpeedY() && mpSpeed) { + mpSpeed->y = 0.0f; + } + bgs.GetTriPla(mGnd, &mPlane_0x0B8); + SetGroundFind(); + if (param2) { + SetGroundHit(); + } + + Set_0x10000000(); + if (!Chk_0x8000000() && !Chk_0x80000000()) { + Set_0x8000000(); + bgs.RideCallBack(mGnd, GetMyObj()); + } + + if (!(Chk_0x4000000())) { + SetGroundLanding(); + } + } + } + + // UUUUUGH + if ((mFlags & ACCH_FLAG_0x4000000) && !(mFlags & GROUND_HIT)) { + SetGroundAway(); + } + + } else { + mGroundHeight = -1e9f; + } +} + +void dBgS_Acch::RoofCheck(dBgS &bgs) { + if (mGroundHeight == -1e9f) { + return; + } + if (mFlags & LINE_DOWN && mField_0x0CC > mField_0x0D8 && + (mGroundHeight <= mRoofHeight || cM3d_IsZero(mGroundHeight - mRoofHeight))) { + mpPos->y = (mGroundHeight + mRoofHeight) * 0.5f; + } else if (mpPos->y > mField_0x0D8 && mField_0x0D8 > mGroundHeight) { + mpPos->y = mField_0x0D8; + } + if (mFlags & ROOF_NONE) { + return; + } + if (mGroundHeight >= mRoofHeight) { + mRoof.SetExtChk(*this); + ClrRoofHit(); + mVec3_c roof_pos = *GetPos(); + roof_pos.y -= 0.25f; + mRoof.SetPos(&roof_pos); + mRoofHeight = bgs.RoofChk(&mRoof); + } +} + +void dBgS_Acch::GroundRoofProc(dBgS &bgs, bool param2) { + mField_0x0D8 = 1e9f; + if (!(mFlags & ROOF_NONE)) { + mRoof.SetExtChk(*this); + ClrRoofHit(); + mVec3_c roof_pos(*GetPos()); + roof_pos.y -= 0.25f; + mRoof.SetPos(&roof_pos); + mRoofHeight = bgs.RoofChk(&mRoof); + + if (mRoofHeight != 1e9f) { + if (mpPos->y + mField_0x0D4 > mRoofHeight) { + mField_0x0D8 = mRoofHeight - mField_0x0D4; + SetRoofHit(); + } else if (mField_0x0C8 + mField_0x0D4 > mRoofHeight) { + mField_0x0D8 = mRoofHeight - mField_0x0D4; + SetRoofHit(); + } + } + } + + if (!(mFlags & GRND_NONE)) { + mFlags &= ~GROUND_FIND; + GroundCheck(bgs, param2); + RoofCheck(bgs); + } else { + if (mField_0x0D8 < mpPos->y) { + mpPos->y = mField_0x0D8; + } + mFlags &= ~ACCH_FLAG_0x10000000; + mGroundHeight = -1e9f; + } +} + +void dBgS_Acch::LineCheck(dBgS &bgs) { + if (!(mFlags & ACCH_FLAG_0x20000000)) { + mFlags |= ACCH_FLAG_0x20000000; + + dBgS_RoofChk roof; + roof.mActorId = mGnd.mActorId; + + mVec3_c roof_pos = *GetOldPos(); + roof_pos.y -= 0.25f; + + roof.SetPos(&roof_pos); + + mRoofH_0x0E0 = dBgS::GetInstance()->RoofChk(&roof); + + dBgS_GndChk gnd; + gnd.mActorId = mGnd.mActorId; + + mVec3_c gnd_pos = *GetOldPos(); + gnd_pos.y += 0.25f; + + gnd.SetPos(&gnd_pos); + + mGroundH_0x0E4 = dBgS::GetInstance()->GroundCross(&gnd); + } + + cBgS_LinChk line; + mField_0x0E8 = 1e9f; + + int i = 0; + do { + mVec3_c old_pos = *GetOldPos(); + mVec3_c pos = *GetPos(); + + f32 cirWallH = GetWallH(i); + + if (mRoofH_0x0E0 - 0.25f < old_pos.y + cirWallH && mGroundH_0x0E4 + 0.25f > old_pos.y + cirWallH) { + cirWallH = (mRoofH_0x0E0 + mGroundH_0x0E4) * 0.5f - old_pos.y; + } else if (mRoofH_0x0E0 - 0.25f < old_pos.y + cirWallH) { + cirWallH = (mRoofH_0x0E0 - old_pos.y) - 0.25f; + } else if (mGroundH_0x0E4 + 0.25f > old_pos.y + cirWallH) { + cirWallH = (mGroundH_0x0E4 - old_pos.y) + 0.25f; + } + + if (mField_0x0E8 > cirWallH) { + mField_0x0E8 = cirWallH; + } + + old_pos.y += cirWallH; + pos.y += cirWallH; + + if (GetSpeedY() < 0.0f) { + if (GetMyObj() != nullptr && GetMyObj()->isActorPlayer() && + !static_cast(GetMyObj())->CheckPlayerFly() && ChkLink()) { + pos.y -= GetSpeedY(); + } + } + + if (old_pos.x != pos.x || old_pos.y != pos.y || old_pos.z != pos.z) { + line.Set2(old_pos, pos, mActorId); + + if (ChkCirUnk0x8(i)) { + line.mPreGroundChk = true; + } else { + line.mPreGroundChk = false; + } + if (ChkCirUnk0x10(i)) { + line.mPreRoofChk = true; + } else { + line.mPreRoofChk = false; + } + + line.SetExtChk(*this); + + if (bgs.LineCross(&line)) { + *GetPos() = line.GetLinEnd(); + OnLineCheckHit(); + if (mpOutPolyInfo) { + *mpOutPolyInfo = line; + } + cM3dGPla plane; + bgs.GetTriPla(line, &plane); + if (!cBgW_CheckBGround(plane.mNormal.y)) { + mVec3_c *pPos = GetPos(); + VEC3Add(*pPos, plane.mNormal, *pPos); + if (!cM3d_IsZero( + nw4r::math::FSqrt(plane.mNormal.x * plane.mNormal.x + plane.mNormal.z * plane.mNormal.z) + )) { + SetWallHDirect(i, GetPos()->y); + } + GetPos()->y -= GetWallH(i); + + } else { + GetPos()->y -= 1.0f; + mFlags |= ACCH_FLAG_0x20000; + } + } + } + i++; + } while (i < GetTblSize()); +} + +extern "C" void *fn_80359C80(dBgS_SphChk *, cBgD_Vtx_t *, int, int, int, cM3dGPla *, void *); + +void dBgS_Acch::SphCheck() { + f32 height = mField_0x1D0; + + mSph.SetExtChk(*this); + mSph.mCallback = fn_80359C80; + + if (height < 0.0f) { + height = 1e9f; + if (height > mField_0x0A8 && mField_0x0A8 > 0.0f) { + height = mField_0x0A8; + } + if (height > mField_0x0D4 && mField_0x0D4 > 1.0f) { + height = mField_0x0D4; + } + height *= 0.8f; + } + mSph.Set(mpPos, height); + mField_0x1A8.Init(); + dBgS::GetInstance()->SphChk(&mSph, &mField_0x1A8); + mField_0x1A8.CalcPos(mpPos); +} + +void dBgS_Acch::CrrPos(dBgS &bgs) { + if (!(mFlags & ACCH_FLAG_0x1)) { + bgs.MoveBgCrrPos(mGnd, ChkGroundHit(), mpPos, mpAngle, mpShapeAngle, false, false); + + GroundCheckInit(bgs); + u32 prev = mField_0x394; + + Init(); + + // Not in the mood to mess with these inlines lol + } +} + +f32 dBgS_Acch::GetWallAllR() { + f32 ret = 0.0f; + + int i = 0; + do { + if (ret < mpAcchCir[i].GetWallR()) { + ret = mpAcchCir[i].GetWallR(); + } + ++i; + } while (i < mTblSize); + return ret; +} + +void dBgS_Acch::CalcWallBmdCyl() { + if (mTblSize <= 0) { + mWallCyl.Set(*mpPos, 0.0f, 0.0f); + } else { + f32 speed = GetSpeedY(); + + // TOD Stuff + f32 dvar8 = GetWallAllR(); + f32 dvar9 = mpAcchCir->GetWallH(); + f32 dvar10 = mpAcchCir->GetWallH(); + + // if (mTblSize >= 1) { + // for (int i = 0; i < mTblSize; i++) { + // f32 tmp = mpAcchCir[i].GetWallH(); + // if (dvar9 > tmp) { + // dvar9 = mpAcchCir[i].GetWallH(); + // } + + // f32 tmp2 = mpAcchCir[i].GetWallH(); + // if (dvar10 < tmp2) { + // dvar10 = mpAcchCir[i].GetWallH(); + // } + // } + // } + + mVec3_c xyz(*GetPos()); + + // TODO: Stuff + + mWallCyl.Set(xyz, dvar8, dvar10 - dvar9); + } +} + +void dBgS_Acch::SetGroundUpY(f32 param_0) { + mField_0x0AC = param_0 - mField_0x0A8; + mField_0x0A8 = param_0; +} + +bool dBgS_Acch::fn_80340ca0(cBgS_PolyInfo &info) const { + int idx = 0; + if (ChkGndHit()) { + info.SetPolyInfo(mGnd); + return false; + } + + if (ChkWallHit(&idx)) { + info.SetPolyInfo(mpAcchCir[idx]); + return false; + } + + if (ChkRoofHit()) { + info.SetPolyInfo(mRoof); + return false; + } + + return true; +} + +void dBgS_Acch::Draw(dBgS &) { + // Name inferred from being called from (NPC?) draw functions. + // Maybe a debug visual? +} + +void dBgS_Acch::SetMoveBGOnly() { + mFlags |= MOVE_BG_ONLY; + mWtr.OnMoveBGOnly(); +} + +void dBgS_Acch::ClrMoveBGOnly() { + mFlags &= ~MOVE_BG_ONLY; + mWtr.OffMoveBGOnly(); +} + +bool dBgS_Acch::ChkGndHit() const { + bool ret = false; + + if (mFlags & GROUND_HIT) { + if (dBgS::GetInstance()->ChkPolySafe(mGnd)) { + ret = true; + } + } + return ret; +} + +bool dBgS_Acch::ChkRoofHit() const { + bool ret = false; + + if (mFlags & ROOF_HIT) { + if (dBgS::GetInstance()->ChkPolySafe(mRoof)) { + ret = true; + } + } + return ret; +} + +bool dBgS_Acch::ChkWallHit(int *pOutIndex) const { + if (mFlags & WALL_HIT) { + int i = 0; + do { + if (mpAcchCir[i].ChkWallHit()) { + if (pOutIndex) { + *pOutIndex = i; + } + return true; + } + i++; + } while (i < mTblSize); + } + return false; +} + +void dBgS_Acch::SetGndThinCellingOff() { + mFlags |= GND_THIN_CELLING_OFF; +} + +void dBgS_Acch::ClrGndThinCellingOff() { + mFlags &= ~GND_THIN_CELLING_OFF; +} + +void dBgS_Acch::Set_0x2000000() { + mFlags |= ACCH_FLAG_0x2000000; +} + +void dBgS_Acch::Clr_0x2000000() { + mFlags &= ~ACCH_FLAG_0x2000000; +} + +void dBgS_Acch::OnWallSort() { + mFlags |= WALL_SORT; +} + +dBgS_AcchCir &dBgS_Acch::GetCir(int idx) { + return mpAcchCir[idx]; +} + +void dBgS_Acch::fn_80340f70(const mVec3_c *pVec) { + bool adjusted = false; + + if (mField_0x398.x > pVec->x) { + mField_0x398.x = pVec->x; + adjusted = true; + } else if (mField_0x3A4.x < pVec->x) { + mField_0x3A4.x = pVec->x; + adjusted = true; + } + if (mField_0x398.z > pVec->z) { + mField_0x398.z = pVec->z; + adjusted = true; + } else if (mField_0x3A4.z < pVec->z) { + mField_0x3A4.z = pVec->z; + adjusted = true; + } + + if (!adjusted && mField_0x394 > 0) { + mField_0x394--; + } +} + +void dBgS_Acch::fn_80341000() { + mpPos->x += mField_0x398.x + mField_0x3A4.x; + mpPos->z += mField_0x398.z + mField_0x3A4.z; +} + +dBgS_ObjAcch::dBgS_ObjAcch() { + SetObj(); +} +dBgS_ObjAcch::~dBgS_ObjAcch() {} + +dBgS_LinkAcch::dBgS_LinkAcch() { + SetLink(); +} +dBgS_LinkAcch::~dBgS_LinkAcch() {} + +dBgS_BombAcch::dBgS_BombAcch() { + SetBomb(); +} +dBgS_BombAcch::~dBgS_BombAcch() {} diff --git a/src/d/col/bg/d_bg_s_chk.cpp b/src/d/col/bg/d_bg_s_chk.cpp new file mode 100644 index 00000000..6b770ee8 --- /dev/null +++ b/src/d/col/bg/d_bg_s_chk.cpp @@ -0,0 +1,20 @@ +#include "d/col/bg/d_bg_s_chk.h" + +dBgS_Chk::dBgS_Chk() {} + +dBgS_Chk::~dBgS_Chk() {} + +cBgS_PolyPassChk *dBgS_Chk::GetPolyPassChkInfo() { + return this; +} +cBgS_GrpPassChk *dBgS_Chk::GetGrpPassChkInfo() { + return this; +} + +cBgS_GrpPassChk::cBgS_GrpPassChk() {} + +cBgS_GrpPassChk::~cBgS_GrpPassChk() {} + +cBgS_PolyPassChk::cBgS_PolyPassChk() {} + +cBgS_PolyPassChk::~cBgS_PolyPassChk() {} diff --git a/src/d/col/bg/d_bg_s_gnd_chk.cpp b/src/d/col/bg/d_bg_s_gnd_chk.cpp new file mode 100644 index 00000000..8a06c4e4 --- /dev/null +++ b/src/d/col/bg/d_bg_s_gnd_chk.cpp @@ -0,0 +1,93 @@ +#include "d/col/bg/d_bg_s_gnd_chk.h" + +#include "d/col/bg/d_bg_s.h" + +dBgS_ObjGndChk dBgS_ObjGndChk::sInstance; +f32 dBgS_ObjGndChk::sGroundHeight; + +dBgS_GndChk::dBgS_GndChk() { + SetPolyPassChk(GetPolyPassChkInfo()); + SetGrpPassChk(GetGrpPassChkInfo()); +} + +dBgS_GndChk::~dBgS_GndChk() {} + +void dBgS_GndChk::Set(const mVec3_c *pos, u32 *id) { + SetPos(pos); + SetActorID(id); +} + +dBgS_LinkGndChk::dBgS_LinkGndChk() { + SetLink(); +} + +dBgS_LinkGndChk::~dBgS_LinkGndChk() {} + +dBgS_ObjGndChk::dBgS_ObjGndChk() { + SetObj(); +} + +dBgS_ObjGndChk::~dBgS_ObjGndChk() {} + +dBgS_ObjGndChk_Wtr::dBgS_ObjGndChk_Wtr() { + OffNormalGrp(); + OnWaterGrp(); +} + +dBgS_ObjGndChk_Wtr::~dBgS_ObjGndChk_Wtr() {} + +dBgS_ObjGndChk_All::~dBgS_ObjGndChk_All() {} + +dBgS_CamGndChk::dBgS_CamGndChk() { + SetCam(); +} + +dBgS_CamGndChk::~dBgS_CamGndChk() {} + +dBgS_ObjGndChk_All::dBgS_ObjGndChk_All() { + OnAll(); +} + +dBgS_CamGndChk_Wtr::dBgS_CamGndChk_Wtr() { + OnAll(); +} + +dBgS_CamGndChk_Wtr::~dBgS_CamGndChk_Wtr() {} + +void dBgS_ObjGndChk::ClearInstance() { + sInstance.ClearPi(); +} + +bool dBgS_ObjGndChk::CheckPos(const mVec3_c *pPos) { + sInstance.SetPos(pPos); + sGroundHeight = dBgS::GetInstance()->GroundCross(&sInstance); + return sGroundHeight != -1e9f; +} + +int dBgS_ObjGndChk::GetMaterial() { + return dBgS::GetInstance()->GetPolyAtt0(sInstance); +} + +int dBgS_ObjGndChk::GetPolyAtt1() { + return dBgS::GetInstance()->GetPolyAtt1(sInstance); +} + +bool dBgS_ObjGndChk::GetTriPlane(cM3dGPla *pPlane) { + return dBgS::GetInstance()->GetTriPla(sInstance, pPlane); +} + +s32 dBgS_ObjGndChk::GetRoomID() { + return dBgS::GetInstance()->GetRoomId(sInstance); +} + +bool dBgS_ObjGndChk::ChkMoveBG() { + return dBgS::GetInstance()->ChkMoveBG(sInstance, true); +} + +int dBgS_ObjGndChk::GetLightingCode() { + return dBgS::GetInstance()->GetLightingCode(sInstance); +} + +int dBgS_ObjGndChk::GetSpecialCode() { + return dBgS::GetInstance()->GetSpecialCode(sInstance); +} diff --git a/src/d/col/bg/d_bg_s_grp_pass_chk.cpp b/src/d/col/bg/d_bg_s_grp_pass_chk.cpp new file mode 100644 index 00000000..8924f2c0 --- /dev/null +++ b/src/d/col/bg/d_bg_s_grp_pass_chk.cpp @@ -0,0 +1,7 @@ +#include "d/col/bg/d_bg_s_grp_pass_chk.h" + +dBgS_GrpPassChk::dBgS_GrpPassChk() { + mGrp = 1; +} + +dBgS_GrpPassChk::~dBgS_GrpPassChk() {} diff --git a/src/d/col/bg/d_bg_s_lin_chk.cpp b/src/d/col/bg/d_bg_s_lin_chk.cpp new file mode 100644 index 00000000..bd8342f2 --- /dev/null +++ b/src/d/col/bg/d_bg_s_lin_chk.cpp @@ -0,0 +1,155 @@ +#include "d/col/bg/d_bg_s_lin_chk.h" + +#include "d/a/obj/d_a_obj_base.h" +#include "d/col/bg/d_bg_s.h" +#include "d/col/c/c_bg_w.h" + +dBgS_ObjLinChk dBgS_ObjLinChk::sInstance; +dBgS_WtrLinChk dBgS_WtrLinChk::sInstance; + +dBgS_LinChk::dBgS_LinChk() { + SetPolyPassChk(GetPolyPassChkInfo()); + SetGrpPassChk(GetGrpPassChkInfo()); +} + +dBgS_LinChk::~dBgS_LinChk() {} + +void dBgS_LinChk::Set(const mVec3_c *pStart, const mVec3_c *pEnd, const dAcObjBase_c *pObj) { + Set2(*pStart, *pEnd, pObj ? pObj->getID() : 0); +} + +dBgS_CamLinChk::dBgS_CamLinChk() { + SetCam(); +} + +dBgS_CamLinChk::~dBgS_CamLinChk() {} + +dBgS_CamLinChk_NorWtr::dBgS_CamLinChk_NorWtr() { + OnAll(); +} + +dBgS_CamLinChk_NorWtr::~dBgS_CamLinChk_NorWtr() {} + +dBgS_ObjLinChk::dBgS_ObjLinChk() { + SetObj(); + mPreRoofChk = false; +} + +dBgS_ObjLinChk::~dBgS_ObjLinChk() {} + +void dBgS_ObjLinChk::ClearInstance() { + sInstance.ClearPi(); +} + +void dBgS_ObjLinChk::SetEnd(const mVec3_c *pEnd) { + sInstance.mLin.mEnd = *pEnd; +} + +bool dBgS_ObjLinChk::LineCross(mVec3_c const *pStart, mVec3_c const *pEnd, dAcObjBase_c const *pObj) { + sInstance.Set(pStart, pEnd, pObj); + return dBgS::GetInstance()->LineCross(&sInstance); +} + +mAng dBgS_ObjLinChk::GetAngle() { + cM3dGPla plane; + GetTriPla(&plane); + return plane.GetAngleY(); +} + +bool dBgS_ObjLinChk::GetTriPla(cM3dGPla *pPlane) { + return dBgS::GetInstance()->GetTriPla(sInstance, pPlane); +} + +int dBgS_ObjLinChk::GetMaterial() { + return dBgS::GetInstance()->GetPolyAtt0(sInstance); +} + +bool dBgS_ObjLinChk::ChkMoveBG() { + return dBgS::GetInstance()->ChkMoveBG(sInstance, true); +} + +bool dBgS_ObjLinChk::ChkGround() { + cM3dGPla plane; + GetTriPla(&plane); + return cBgW_CheckBGround(plane.mNormal.y); +} + +bool dBgS_ObjLinChk::ChkWall() { + cM3dGPla plane; + GetTriPla(&plane); + return cBgW_CheckBWall(plane.mNormal.y); +} + +bool dBgS_ObjLinChk::ChkRoof() { + cM3dGPla plane; + GetTriPla(&plane); + return cBgW_CheckBRoof(plane.mNormal.y); +} + +dBgS_WtrLinChk::dBgS_WtrLinChk() { + OffFullGrp(); + OnWaterGrp(); +} + +dBgS_WtrLinChk::~dBgS_WtrLinChk() {} + +void dBgS_WtrLinChk::ClearInstance() { + sInstance.ClearPi(); +} + +void dBgS_WtrLinChk::SetEnd(const mVec3_c *pEnd) { + sInstance.mLin.mEnd = *pEnd; +} + +bool dBgS_WtrLinChk::SetIsWater(mVec3_c const *pStart, mVec3_c const *pEnd, dAcObjBase_c const *pObj) { + sInstance.Set(pStart, pEnd, pObj); + bool ret = false; + if (dBgS::GetInstance()->LineCross(&sInstance)) { + if (dBgS::GetInstance()->GetSpecialCode(sInstance) == 0xC /* POLY_GROUND_WATER */) { + ret = true; + } + } + return ret; +} + +dBgS_LinkLinChk::dBgS_LinkLinChk() { + SetLink(); +} + +dBgS_LinkLinChk::~dBgS_LinkLinChk() {} + +dBgS_BombLinChk::dBgS_BombLinChk() { + SetBomb(); +} + +dBgS_BombLinChk::~dBgS_BombLinChk() {} + +dBgS_ArrowLinChk::dBgS_ArrowLinChk() { + SetArrow(); +} + +dBgS_ArrowLinChk::~dBgS_ArrowLinChk() {} + +dBgS_BeetleLinChk::dBgS_BeetleLinChk() { + SetBeetle(); +} + +dBgS_BeetleLinChk::~dBgS_BeetleLinChk() {} + +dBgS_ClawshotLinChk::dBgS_ClawshotLinChk() { + SetClawshot(); +} + +dBgS_ClawshotLinChk::~dBgS_ClawshotLinChk() {} + +dBgS_GustBellowsLinChk::dBgS_GustBellowsLinChk() { + SetBellows(); +} + +dBgS_GustBellowsLinChk::~dBgS_GustBellowsLinChk() {} + +dBgS_WhipLinChk::dBgS_WhipLinChk() { + SetWhip(); +} + +dBgS_WhipLinChk::~dBgS_WhipLinChk() {} diff --git a/src/d/col/bg/d_bg_s_poly_pass_chk.cpp b/src/d/col/bg/d_bg_s_poly_pass_chk.cpp new file mode 100644 index 00000000..fecd6abe --- /dev/null +++ b/src/d/col/bg/d_bg_s_poly_pass_chk.cpp @@ -0,0 +1,17 @@ +#include "d/col/bg/d_bg_s_poly_pass_chk.h" + +dBgS_PolyPassChk::dBgS_PolyPassChk() { + mObject = false; + mCamera = false; + mLink = false; + mArrow = false; + mBomb = false; + mWhip = false; + mBeetle = false; + mClawshot = false; + mUnderwaterRoof = false; + mBellows = false; + mField_0xE = false; +} + +dBgS_PolyPassChk::~dBgS_PolyPassChk() {} diff --git a/src/d/col/bg/d_bg_s_roof_chk.cpp b/src/d/col/bg/d_bg_s_roof_chk.cpp new file mode 100644 index 00000000..18418cf5 --- /dev/null +++ b/src/d/col/bg/d_bg_s_roof_chk.cpp @@ -0,0 +1,44 @@ +#include "d/col/bg/d_bg_s_roof_chk.h" + +#include "d/col/bg/d_bg_s.h" + +dBgS_ObjRoofChk dBgS_ObjRoofChk::sInstance; +f32 dBgS_ObjRoofChk::sRoofHeight; + +dBgS_RoofChk::dBgS_RoofChk() { + mPos.set(0.0f, 0.0f, 0.0f); + mNowY = 0.0f; + mField_0x7C = 1; + mPosCopy.set(0.0f, 0.0f, 0.0f); + + SetPolyPassChk(GetPolyPassChkInfo()); + SetGrpPassChk(GetGrpPassChkInfo()); +} + +dBgS_RoofChk::~dBgS_RoofChk() {} + +void dBgS_RoofChk::SetPos(mVec3_c const *pPos) { + mPos = *pPos; +} + +dBgS_ObjRoofChk::dBgS_ObjRoofChk() { + SetObj(); +} + +dBgS_ObjRoofChk::~dBgS_ObjRoofChk() {} + +void dBgS_ObjRoofChk::ClearInstance() { + sInstance.ClearPi(); +} + +bool dBgS_ObjRoofChk::CheckPos(const mVec3_c *pPos) { + sInstance.SetPos(pPos); + sRoofHeight = dBgS::GetInstance()->RoofChk(&sInstance); + return (sRoofHeight != 1e9f); +} + +dBgS_LinkRoofChk::dBgS_LinkRoofChk() { + SetLink(); +} + +dBgS_LinkRoofChk::~dBgS_LinkRoofChk() {} diff --git a/src/d/col/bg/d_bg_s_sph_chk.cpp b/src/d/col/bg/d_bg_s_sph_chk.cpp new file mode 100644 index 00000000..cab30524 --- /dev/null +++ b/src/d/col/bg/d_bg_s_sph_chk.cpp @@ -0,0 +1,23 @@ +#include "d/col/bg/d_bg_s_sph_chk.h" + +dBgS_SphChk::dBgS_SphChk() { + mField_0x80 = 0.0f; + mField_0x84.set(0.0f, 0.0f, 0.0f); + + SetInfo(600, 0, 0); + + mCallback = nullptr; + + SetPolyPassChk(GetPolyPassChkInfo()); + SetGrpPassChk(GetGrpPassChkInfo()); + + ClearPi(); +} + +dBgS_SphChk::~dBgS_SphChk() {} + +dBgS_CamSphChk::dBgS_CamSphChk() { + SetCam(); +} + +dBgS_CamSphChk::~dBgS_CamSphChk() {} diff --git a/src/d/col/bg/d_bg_s_spl_grp_chk.cpp b/src/d/col/bg/d_bg_s_spl_grp_chk.cpp new file mode 100644 index 00000000..2747e897 --- /dev/null +++ b/src/d/col/bg/d_bg_s_spl_grp_chk.cpp @@ -0,0 +1,22 @@ +#include "d\col\bg\d_bg_s_spl_grp_chk.h" + +dBgS_SplGrpChk::dBgS_SplGrpChk() { + mGnd.set(0.0f, 0.0f, 0.0f); + mRoof = 1e9f; + mHeight = -1e9f; + mGroundH = -1e9f; + + mFlags = 0; + + SetPolyPassChk(GetPolyPassChkInfo()); + SetGrpPassChk(GetGrpPassChkInfo()); + + OffNormalGrp(); +} + +dBgS_SplGrpChk::~dBgS_SplGrpChk() {} + +void dBgS_SplGrpChk::Set(mVec3_c &gnd, f32 roof) { + mGnd = gnd; + mRoof = roof; +} diff --git a/src/d/col/bg/d_bg_s_wtr_chk.cpp b/src/d/col/bg/d_bg_s_wtr_chk.cpp new file mode 100644 index 00000000..0eaf7a4b --- /dev/null +++ b/src/d/col/bg/d_bg_s_wtr_chk.cpp @@ -0,0 +1,36 @@ +#include "d/col/bg/d_bg_s_wtr_chk.h" + +#include "d/col/bg/d_bg_s.h" + +dBgS_WtrChk dBgS_WtrChk::sInstance; +f32 dBgS_WtrChk::sWaterHeight; + +dBgS_WtrChk::dBgS_WtrChk() { + OnWaterGrp(); +} + +dBgS_WtrChk::~dBgS_WtrChk() {} + +void dBgS_WtrChk::ClearInstance() { + sInstance.ClearPi(); +} + +bool dBgS_WtrChk::CheckPos(const mVec3_c *pPos, bool b, f32 f1, f32 f2) { + mVec3_c water_pos; + water_pos.set(pPos->x, pPos->y + f2, pPos->z); + sInstance.Set(water_pos, pPos->y + f1); + + if (dBgS::GetInstance()->WaterChk(&sInstance)) { + if (b && dBgS::GetInstance()->GetSpecialCode(sInstance) != 0xC /* POLY_GROUND_WATER */) { + // Other Liquid + } else { + sWaterHeight = sInstance.mGroundH; + return true; + } + } + return false; +} + +int dBgS_WtrChk::GetMaterial() { + return dBgS::GetInstance()->GetPolyAtt0(sInstance); +} diff --git a/src/d/col/bg/d_bg_w.cpp b/src/d/col/bg/d_bg_w.cpp new file mode 100644 index 00000000..c169f866 --- /dev/null +++ b/src/d/col/bg/d_bg_w.cpp @@ -0,0 +1,909 @@ +#include "d/col/bg/d_bg_w.h" + +#include "d/col/bg/d_bg_s.h" +#include "d/col/bg/d_bg_s_acch.h" +#include "d/col/bg/d_bg_w_kcol.h" +#include "d/col/c/c_bg_s_chk.h" +#include "d/col/c/c_bg_s_lin_chk.h" +#include "d/col/c/c_bg_s_shdw_draw.h" +#include "d/d_heap_alloc.h" +#include "toBeSorted/scgame.h" + +bool cBgW::sLineCheck; +bool cBgW::sGndCheck; +bool cBgW::sWallCheck; +bool cBgW::sRoofCheck; +bool cBgW::sSplGrpCheck; +bool cBgW::sSphCheck; + +mVec3_c dBgW::sWallCorrectPos(0.0f, 0.0f, 0.0f); + +cBgW::cBgW() + : mpMdlMtx(nullptr), mTransVel(0.0f, 0.0f, 0.0f), mpScale(nullptr), mFlags(GLOBAL_e), mRootGroupIdx(-1), + mpTri(nullptr), mpRwg(nullptr), mpVtxTbl(nullptr), mpBgd(nullptr), mpBlk(nullptr), mpGrp(nullptr), + mpNodeTree(nullptr), mNeedsFullTransform(true) { + PSMTXIdentity(mInvMtx); + PSMTXIdentity(mMtx); + PSMTXIdentity(mMtxUnk); +} + +cBgW::~cBgW() { + FreeArea(); +} + +void cBgW::FreeArea() { + if (mpTri) { + delete[] mpTri; + } + if (mpRwg) { + delete[] mpRwg; + } + if (mpNodeTree) { + delete[] mpNodeTree; + } + if (mpBlk) { + delete[] mpBlk; + } + if (mpGrp) { + delete[] mpGrp; + } + mpTri = nullptr; + mpRwg = nullptr; + mpNodeTree = nullptr; + mpBlk = nullptr; + mpGrp = nullptr; + mpVtxTbl = nullptr; +} + +u32 cBgW::GetOldInvMtx(mMtx_c *m) { + return PSMTXInverse(mMtx, *m); +} + +void cBgW::UpdateMtx() { + if (!mpMdlMtx) { + PSMTXIdentity(mInvMtx); + PSMTXIdentity(mMtx); + PSMTXIdentity(mMtxUnk); + } else { + PSMTXCopy(*mpMdlMtx, mInvMtx); + if (mpScale) { + mMtx_c scale; + PSMTXScale(scale, mpScale->x, mpScale->y, mpScale->z); + PSMTXConcat(mInvMtx, scale, mInvMtx); + } + + PSMTXCopy(mInvMtx, mMtx); + PSMTXCopy(mInvMtx, mMtxUnk); + } +} + +void cBgW::GlobalVtx() { + if (mpMdlMtx) { + if (!mNeedsFullTransform) { + int i = 0; + do { + nw4r::math::VEC3 *vtx = &mpVtxTbl[i]; + VEC3Add(vtx, mTransVel, vtx); + i++; + } while (i < mpBgd->mVtxNum); + + } else { + int i = 0; + do { + PSMTXMultVec(mInvMtx, mpBgd->mVtxTbl[i], mpVtxTbl[i]); + i++; + } while (i < mpBgd->mVtxNum); + } + } +} + +bool cBgW::SetVtx() { + if (mFlags & NO_VTX_TBL_e) { + mpVtxTbl = nullptr; + } else if (mFlags & MOVE_BG_e) { + // Im not sure about this, but it works + mpVtxTbl = (cBgD_Vtx_t *)new (0x20) Vec[mpBgd->mVtxNum]; + + if (!mpVtxTbl) { + return true; + } + if (mFlags & CBGW_UNK_FLAG_40) { + int i = 0; + do { + mpVtxTbl[i].x = 0.0f; + mpVtxTbl[i].y = 0.0f; + mpVtxTbl[i].z = 0.0f; + i++; + } while (i < mpBgd->mVtxNum); + } + GlobalVtx(); + + } else { + mpVtxTbl = mpBgd->mVtxTbl; + } + return false; +} + +void cBgW::CalcPlane() { + cBgD_Tri_t *tris = mpBgd->mTriTbl; + if (mpVtxTbl) { + if (!mNeedsFullTransform) { + int i = 0; + do { + mpTri[i].mD -= VEC3Dot(mpTri[i].mNormal, mTransVel); + i++; + } while (i < mpBgd->mTriNum); + } else { + int i = 0; + do { + mpTri[i].SetupFrom3Vtx(&mpVtxTbl[tris->mVtxIdx0], &mpVtxTbl[tris->mVtxIdx1], &mpVtxTbl[tris->mVtxIdx2]); + i++; + tris++; + } while (i < mpBgd->mTriNum); + } + } +} + +bool cBgW::SetTri() { + mpTri = new cBgW_TriElm[mpBgd->mTriNum]; + + if (!mpTri) { + return true; + } + CalcPlane(); + return false; +} + +void cBgW::BlckConnect(u16 *pStartIdx, int *pPrevIdx, int idx) { + if (*pStartIdx == 0xFFFF) { + *pStartIdx = idx; + } + if (*pPrevIdx != 0xFFFF) { + mpRwg[*pPrevIdx].mNext = idx; + } + *pPrevIdx = idx; + mpRwg[idx].mNext = 0xFFFF; +} + +void cBgW::ClassifyPlane() { + if (!mpVtxTbl) { + return; + } + + int i = 0; + do { + int startIdx = mpBgd->mBlkTbl[i].field_0x0; + int endIdx; + if (i != mpBgd->mBlkNum - 1) { + endIdx = mpBgd->mBlkTbl[i + 1].field_0x0 - 1; + } else { + endIdx = mpBgd->mTriNum - 1; + } + + mpBlk[i].mRoofIdx = 0xFFFF; + mpBlk[i].mWallIdx = 0xFFFF; + mpBlk[i].mGndIdx = 0xFFFF; + + int blkRoofIdx, blkWallIdx, blkGndIdx; + blkRoofIdx = blkWallIdx = blkGndIdx = 0xFFFF; + for (int j = startIdx; j <= endIdx; j++) { + f32 norm_y = mpTri[j].GetNP()->y; + + if (!cM3d_IsZero(mpTri[j].GetNP()->x) || !cM3d_IsZero(mpTri[j].GetNP()->y) || + !cM3d_IsZero(mpTri[j].GetNP()->z)) { + if (cBgW_CheckBGround(norm_y)) { + BlckConnect(&mpBlk[i].mGndIdx, &blkGndIdx, j); + } else if (cBgW_CheckBRoof(norm_y)) { + if (!ChkRoofRegist()) { + BlckConnect(&mpBlk[i].mRoofIdx, &blkRoofIdx, j); + } + } else { + BlckConnect(&mpBlk[i].mWallIdx, &blkWallIdx, j); + } + } + } + i++; + } while (i < mpBgd->mBlkNum); +} + +void cBgW::MakeBlckTransMinMax(mVec3_c *pMin, mVec3_c *pMax) { + VEC3Add(pMin, &mTransVel, pMin); + VEC3Add(pMax, &mTransVel, pMax); +} + +void cBgW::MakeBlckMinMax(int vtxIdx, mVec3_c *pMin, mVec3_c *pMax) { + nw4r::math::VEC3 *vtx = &mpVtxTbl[vtxIdx]; + + if (pMin->x > vtx->x) { + pMin->x = vtx->x; + } + + if (pMax->x < vtx->x) { + pMax->x = vtx->x; + } + + if (pMin->y > vtx->y) { + pMin->y = vtx->y; + } + + if (pMax->y < vtx->y) { + pMax->y = vtx->y; + } + + if (pMin->z > vtx->z) { + pMin->z = vtx->z; + } + + if (pMax->z < vtx->z) { + pMax->z = vtx->z; + } +} + +int cBgW::GetPolyAtt0(const cBgS_PolyInfo &info) { + return 0; +} + +void cBgW::MakeBlckBnd(int blkIdx, mVec3_c *pMin, mVec3_c *pMax) { + if (mNeedsFullTransform == 0) { + MakeBlckTransMinMax(pMin, pMax); + } else { + pMin->z = 1e9f; + pMin->y = 1e9f; + pMin->x = 1e9f; + pMax->z = -1e9f; + pMax->y = -1e9f; + pMax->x = -1e9f; + int max; + int start = mpBgd->mBlkTbl[blkIdx].field_0x0; + + if (blkIdx != mpBgd->mBlkNum - 1) { + max = mpBgd->mBlkTbl[blkIdx + 1].field_0x0 - 1; + } else { + max = mpBgd->mTriNum - 1; + } + for (int i = start; i <= max; i++) { + MakeBlckMinMax(mpBgd->mTriTbl[i].mVtxIdx0, pMin, pMax); + MakeBlckMinMax(mpBgd->mTriTbl[i].mVtxIdx1, pMin, pMax); + MakeBlckMinMax(mpBgd->mTriTbl[i].mVtxIdx2, pMin, pMax); + } + + pMin->x -= 1.0f; + pMin->y -= 1.0f; + pMin->z -= 1.0f; + pMax->x += 1.0f; + pMax->y += 1.0f; + pMax->z += 1.0f; + } +} + +void cBgW::MakeNodeTreeRp(int treeIdx) { + cBgD_Tree_t *treeData = &mpBgd->mTreeTbl[treeIdx]; + + if (treeData->mFlag & 1) { + int child_idx = treeData->mId[0]; + + if (child_idx != 0xFFFF) { + mVec3_c *max = (mVec3_c *)mpNodeTree[treeIdx].GetMaxP(); + mVec3_c *min = (mVec3_c *)mpNodeTree[treeIdx].GetMinP(); + + MakeBlckBnd(child_idx, min, max); + } + } else { + mpNodeTree[treeIdx].ClearForMinMax(); + + u16 *id = treeData->mId; + u16 *endIds = &id[8]; + + do { + if (id[0] != 0xFFFF) { + MakeNodeTreeRp(id[0]); + mpNodeTree[treeIdx].SetMinMax(*mpNodeTree[id[0]].GetMinP()); + mpNodeTree[treeIdx].SetMinMax(*mpNodeTree[id[0]].GetMaxP()); + } + id++; + } while (id < endIds); + } +} + +void cBgW::MakeNodeTreeGrpRp(int grpIdx) { + if (mpBgd->mGrpTbl[grpIdx].mTreeIdx != 0xFFFF) { + MakeNodeTreeRp(mpBgd->mGrpTbl[grpIdx].mTreeIdx); + mpGrp[grpIdx].mAab.SetMin(*mpNodeTree[mpBgd->mGrpTbl[grpIdx].mTreeIdx].GetMinP()); + mpGrp[grpIdx].mAab.SetMax(*mpNodeTree[mpBgd->mGrpTbl[grpIdx].mTreeIdx].GetMaxP()); + } + + s32 child_idx = mpBgd->mGrpTbl[grpIdx].mFirstChild; + while (child_idx != 0xFFFF) { + MakeNodeTreeGrpRp(child_idx); + mpGrp[grpIdx].mAab.SetMin(*mpGrp[child_idx].mAab.GetMinP()); + mpGrp[grpIdx].mAab.SetMax(*mpGrp[child_idx].mAab.GetMaxP()); + child_idx = mpBgd->mGrpTbl[child_idx].mNextSibling; + } +} + +void cBgW::MakeNodeTree() { + if (mpVtxTbl == nullptr) { + int i = 0; + do { + if (mpBgd->mGrpTbl[i].mParent == 0xFFFF) { + mRootGroupIdx = i; + return; + } + i++; + } while (i < mpBgd->mGrpNum); + } else { + int i = 0; + do { + mpGrp[i].mAab.ClearForMinMax(); + i++; + } while (i < mpBgd->mGrpNum); + + i = 0; + do { + if (mpBgd->mGrpTbl[i].mParent == 0xFFFF) { + mRootGroupIdx = i; + MakeNodeTreeGrpRp(i); + break; + } + i++; + } while (i < mpBgd->mGrpNum); + i = 0; + do { + mpGrp[i].mAab.PlusR(1.0f); + i++; + } while (i < mpBgd->mGrpNum); + vt_0x3C(); + } +} + +bool cBgW::ChkMemoryError() { + if (!mpTri || !mpRwg || !mpBlk || !mpNodeTree || !mpGrp) { + return true; + } + return false; +} +bool cBgW::Set(cBgD_t *pbgd, PLC *pbgpc, u32 flags, mMtx_c *pMdlMtx, mVec3_c *pScale) { + mFlags = GLOBAL_e; + mpVtxTbl = nullptr; + + if (pbgd == nullptr) { + return true; + } + + mpPolyCodes.setBase(pbgpc); + mFlags = flags & 0xFF; + if (mFlags & GLOBAL_e) { + mpMdlMtx = nullptr; + mpScale = nullptr; + } else { + mpMdlMtx = pMdlMtx; + mpScale = pScale; + } + + UpdateMtx(); + + mpBgd = pbgd; + + if (SetVtx() || SetTri()) { + FreeArea(); + return true; + } + if (mpRwg) { + delete[] mpRwg; + } + mpRwg = new cBgW_RwgElm[mpBgd->mTriNum]; + if (mpRwg == nullptr) { + FreeArea(); + return true; + } + + if (mpBlk) { + delete[] mpBlk; + } + mpBlk = new cBgW_BlkElm[mpBgd->mBlkNum]; + if (mpBlk == nullptr) { + FreeArea(); + return true; + } + + if (mpNodeTree) { + delete[] mpNodeTree; + } + mpNodeTree = new cBgW_NodeTree[mpBgd->mTreeNum]; + if (mpNodeTree == nullptr) { + FreeArea(); + return true; + } + + if (mpGrp) { + delete[] mpGrp; + } + mpGrp = new cBgW_GrpElm[mpBgd->mGrpNum]; + if (mpGrp == nullptr) { + FreeArea(); + return true; + } + + ClassifyPlane(); + mNeedsFullTransform = 1; + MakeNodeTree(); + return false; +} + +bool cBgW::LineCheck(cBgS_LinChk *pLine) { + sLineCheck = false; + LineCheckGrpRp(pLine, mRootGroupIdx); + return sLineCheck; +} + +void cBgW::LineCheckGrpRp(cBgS_LinChk *pLine, int grpIdx) { + cM3dGLin *pLin = &pLine->mLin; + if (!mpGrp[grpIdx].mAab.Cross(pLin)) { + return; + } + + cBgD_Grp_t &grp = mpBgd->mGrpTbl[grpIdx]; + if (grp.mTreeIdx != 0xFFFF) { + LineCheckRp(pLine, grp.mTreeIdx); + } + int childIdx = grp.mFirstChild; + while (childIdx != 0xFFFF) { + LineCheckGrpRp(pLine, childIdx); + childIdx = mpBgd->mGrpTbl[childIdx].mNextSibling; + } +} + +void cBgW::LineCheckRp(cBgS_LinChk *pLine, int idx) { + // Why is the ordering like this here lol + cM3dGLin *pLin; + cBgW_BlkElm *blk; + u16 *id; + + cBgD_Tree_t &tree = mpBgd->mTreeTbl[idx]; + + if (tree.mFlag & 1) { + blk = &mpBlk[tree.mId[0]]; + if (blk->mWallIdx != 0xFFFF && !pLine->GetPreWallChk()) { + RwgLineCheck(blk->mWallIdx, pLine); + } + if (blk->mGndIdx != 0xFFFF && !pLine->GetPreGroundChk()) { + RwgLineCheck(blk->mGndIdx, pLine); + } + if (blk->mRoofIdx != 0xFFFF && !pLine->GetPreRoofChk()) { + RwgLineCheck(blk->mRoofIdx, pLine); + } + } else { + id = tree.mId; + do { + if (*id != 0xFFFF) { + pLin = &pLine->mLin; + if (mpNodeTree[*id].Cross(pLin)) { + LineCheckRp(pLine, *id); + } + } + id++; + } while (id < &tree.mId[8]); + } +} + +void cBgW::RwgLineCheck(int polyIdx, cBgS_LinChk *pLine) { + // TODO + do { + cBgD_Tri_t *triTbl = mpBgd->mTriTbl; + cBgD_Vtx_t *vtxTbl = mpVtxTbl; + mVec3_c cross_pos; + if (cM3d_Cross_LinTri( + &pLine->mLin, &vtxTbl[triTbl[polyIdx].mVtxIdx0], &vtxTbl[triTbl[polyIdx].mVtxIdx1], + &vtxTbl[triTbl[polyIdx].mVtxIdx2], &mpTri[polyIdx], &cross_pos, pLine->ChkFrontFlag(), + pLine->ChkBackFlag() + )) { + dBgPc pc = *mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId); + if (!dBgWKCol::ChkPolyThrough(GetId(), &pc, pLine) + // && fn_803599c0(/* params */) + ) { + pLine->mLin.mEnd = cross_pos; + pLine->SetPolyIndex(polyIdx); + sLineCheck = true; + } + } + polyIdx = mpRwg[polyIdx].mNext; + } while (polyIdx != 0xFFFF); +} + +bool cBgW::GroundCross(cBgS_GndChk *pGnd) { + sGndCheck = false; + GroundCrossGrpRp(pGnd, mRootGroupIdx); + return sGndCheck; +} + +void cBgW::GroundCrossGrpRp(cBgS_GndChk *, int) {} + +void cBgW::GroundCrossRp(cBgS_GndChk *, int) {} + +void cBgW::RwgGroundCheckGnd(u16, cBgS_GndChk *) {} + +void cBgW::RwgGroundCheckWall(u16, cBgS_GndChk *) {} + +void cBgW::Lock() {} + +void cBgW::CopyOldMtx() {} + +void cBgW::Move() {} + +void cBgW::ShdwDraw(cBgS_ShdwDraw *) {} + +void cBgW::ShdwDrawGrpRp(cBgS_ShdwDraw *, int) {} + +void cBgW::ShdwDrawRp(cBgS_ShdwDraw *, int) {} + +void cBgW::RwgShdwDraw(int, cBgS_ShdwDraw *) {} + +const cM3dGAab *cBgW::GetBnd() const { + return &mpGrp[mRootGroupIdx].mAab; +} +bool cBgW::GetTriPnt(cBgS_PolyInfo const &info, mVec3_c *pA, mVec3_c *pB, mVec3_c *pC) const { + cBgD_Tri_t &tri = mpBgd->mTriTbl[info.GetPolyIndex()]; + + *pA = mpVtxTbl[tri.mVtxIdx0]; + *pB = mpVtxTbl[tri.mVtxIdx1]; + *pC = mpVtxTbl[tri.mVtxIdx2]; + + return true; +} + +void cBgW::GetTopUnder(f32 *pOutTop, f32 *pOutUnder) const { + *pOutUnder = mpGrp[mRootGroupIdx].mAab.GetMinP()->y; + *pOutTop = mpGrp[mRootGroupIdx].mAab.GetMaxP()->y; +} + +void cBgW::GetTriPla(int idx, cM3dGPla *pPla) { + *pPla = mpTri[idx]; +} + +void cBgW::GetTriPla(cBgS_PolyInfo const &info, cM3dGPla *pPla) const { + *pPla = mpTri[info.GetPolyIndex()]; +} + +u32 cBgW::GetGrpInf(cBgS_PolyInfo const &info) const { + return mpPolyCodes.getGrpCode(mpBgd->mTriTbl[info.GetPolyIndex()].mId); +} + +s32 dBgW::GetGrpRoomIndex(cBgS_PolyInfo const &info) const { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getGrpRoomIdx(); +} + +s32 dBgW::GetExitId(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getExitId(); +} + +s32 dBgW::GetZTargetThrough(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getTargetThrough(); +} + +int dBgW::GetSpecialCode(cBgS_PolyInfo const &info) { + return GetSpecialCode(info.GetPolyIndex()); +} + +int dBgW::GetSpecialCode(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getSpecialCode(); +} + +int dBgW::GetCode0_0x30000000(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getCode0_0x30000000(); +} + +int dBgW::GetCode0_0x80000000(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getCode0_0x80000000(); +} + +u32 dBgW::GetPolyObjThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getObjThrough(); +} +u32 dBgW::GetPolyCamThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getCamThrough(); +} +u32 dBgW::GetPolyLinkThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getLinkThrough(); +} +u32 dBgW::GetPolyArrowThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getArrowThrough(); +} +u32 dBgW::GetPolySlingshotThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getSlingshotThrough(); +} +u32 dBgW::GetPolyBeetleThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getBeetleThrough(); +} +u32 dBgW::GetPolyClawshotThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getClawshotThrough(); +} +u32 dBgW::GetPolyBombThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getBombThrough(); +} +u32 dBgW::GetPolyWhipThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getWhipThrough(); +} +u32 dBgW::GetUnderwaterRoofCode(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getUnderwaterRoof(); +} +u32 dBgW::GetShdwThrough(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getShdwThrough(); +} + +int dBgW::GetLinkNo(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getLinkNo(); +} + +s32 dBgW::GetWallCode(cBgS_PolyInfo const &info) { + return GetWallAtt(info.GetPolyIndex()); +} + +u32 dBgW::GetWallAtt(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getWallCode(); +} + +int dBgW::GetPolyAtt0Material(cBgS_PolyInfo const &info) { + int att = mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getAtt0Code(); + if (att >= 0x20) { + return att - 0x20; + } + return att; +} + +int dBgW::GetPolyAtt1(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getAtt1Code(); +} + +int dBgW::GetGroundCode(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getGroundCode(); +} + +u32 dBgW::GetCode1_0x02000000(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getCode1_0x02000000(); +} + +u32 dBgW::GetCode1_0x04000000(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getCode1_0x04000000(); +} + +u32 dBgW::GetCode1_0x08000000(int polyIdx) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[polyIdx].mId)->getCode1_0x08000000(); +} + +u32 dBgW::GetLightingCode(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getLightingCode(); +} + +s32 dBgW::GetCamMoveBG(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getCamMoveBG(); +} + +s32 dBgW::GetRoomCamId(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getRoomCam(); +} + +s32 dBgW::GetRoomPathId(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getRoomPath(); +} + +s32 dBgW::GetRoomPathPntNo(cBgS_PolyInfo const &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getRoomPathPnt(); +} + +bool cBgW::ChkNotReady() const { + return mpVtxTbl == nullptr; +} + +bool cBgW::ChkLock() const { + return mFlags & LOCK_e; +} + +bool cBgW::ChkMoveBg() const { + return mFlags & MOVE_BG_e; +} + +dBgW::dBgW() { + mpCrrFunc = nullptr; + mpRide_cb = nullptr; + mpArrowStick_cb = nullptr; + mpUnk_cb = nullptr; + mFlags = 0; +} + +dBgW::~dBgW() {} + +void dBgW::Move() { + OnMoveFlag(); + cBgW::Move(); +} + +void dBgW::positionWallCorrect(dBgS_Acch *pAcch, f32 p1, cM3dGPla &pla, mVec3_c *pUpperPos, f32 p2) { + pAcch->SetWallHit(); + if (p2 - 1.0f < 0.0f) { + return; + } + f32 dist = (p2 - 1.0f) * p1; + pUpperPos->x += dist * pla.mNormal.x; + pUpperPos->z += dist * pla.mNormal.z; +} +void dBgW::RwgWallCorrect(dBgS_Acch *, u16) {} + +void dBgW::WallCorrectRp(dBgS_Acch *, int) {} + +void dBgW::WallCorrectGrpRp(dBgS_Acch *, int) {} + +bool dBgW::WallCorrect(dBgS_Acch *) { + // TODO - only satisfy warning + return false; +} + +void dBgW::RwgWallCorrectSort(dBgS_Acch *, u16) {} + +void dBgW::WallCorrectRpSort(dBgS_Acch *, int) {} + +void dBgW::WallCorrectGrpRpSort(dBgS_Acch *, int) {} + +bool dBgW::WallCorrectSort(dBgS_Acch *) { + // TODO - only satisfy warning + return false; +} + +void dBgW::RwgRoofChk(u16, dBgS_RoofChk *, f32) {} + +void dBgW::RwgRoofChkRoof(u16, dBgS_RoofChk *) {} + +void dBgW::RwgRoofChkWall(u16, dBgS_RoofChk *) {} + +void dBgW::RoofChkRp(dBgS_RoofChk *, int) {} + +void dBgW::RoofChkGrpRp(dBgS_RoofChk *, int) {} + +bool dBgW::RoofChk(dBgS_RoofChk *) { + // TODO - only satisfy warning + return false; +} + +void dBgW::RwgSplGrpChk(u16, dBgS_SplGrpChk *) {} + +void dBgW::SplGrpChkRp(dBgS_SplGrpChk *, int) {} + +void dBgW::SplGrpChkGrpRp(dBgS_SplGrpChk *, int) {} + +bool dBgW::SplGrpChk(dBgS_SplGrpChk *) { + // TODO - only satisfy warning + return false; +} + +void dBgW::RwgCaptPoly(u16, dBgS_CaptPoly &) {} + +void dBgW::CaptPolyRp(dBgS_CaptPoly &, int) {} + +void dBgW::CaptPolyGrpRp(dBgS_CaptPoly &, int) {} + +void dBgW::CaptPoly(dBgS_CaptPoly &) {} + +void dBgW::RwgSphChk(u16, dBgS_SphChk *, void *) {} + +void dBgW::SphChkRp(dBgS_SphChk *, void *, int) {} + +void dBgW::SphChkGrpRp(dBgS_SphChk *, void *, int) {} + +bool dBgW::SphChk(dBgS_SphChk *pSph, void *pV) { + sSphCheck = false; + SphChkRp(pSph, pV, mRootGroupIdx); + return sSphCheck; +} + +void dBgW::CrrPos(cBgS_PolyInfo const &info, void *pObj, bool b, mVec3_c *pPos, mAng3_c *pAngle, mAng3_c *pShapeAngle) { + if (mpCrrFunc && static_cast(pObj)->baseProperties & dBase_c::BASE_PROP_0x4) { + mpCrrFunc(this, pObj, info, b, pPos, pAngle, pShapeAngle); + } +} + +void dBgW::TransPos( + cBgS_PolyInfo const &info, void *pObj, bool b, mVec3_c *pPos, mAng3_c *pAngle, mAng3_c *pShapeAngle +) { + if (mpCrrFunc && static_cast(pObj)->baseProperties & dBase_c::BASE_PROP_0x4) { + mpCrrFunc(this, pObj, info, b, pPos, pAngle, pShapeAngle); + } +} + +void dBgW::MatrixCrrPos( + cBgS_PolyInfo const &info, void *pObj, bool b, mVec3_c *pPos, mAng3_c *pAngle, mAng3_c *pShapeAngle +) { + CrrPos(info, pObj, b, pPos, pAngle, pShapeAngle); +} + +void dBgW::CallRideCallback(dAcObjBase_c *p1, dAcObjBase_c *p2) { + if (mpRide_cb) { + mpRide_cb(this, p1, p2); + } +} + +void dBgW::CallArrowStickCallback(dAcObjBase_c *p1, dAcObjBase_c *p2, mVec3_c &p3) { + if (mpArrowStick_cb) { + mpArrowStick_cb(this, p1, p2, p3); + } +} + +bool dBgW::CallUnkCallback(dAcObjBase_c *p1, dAcObjBase_c *p2) { + if (mpUnk_cb) { + return mpUnk_cb(this, p1, p2); + } + return false; +} + +void dBgW::OffMoveFlag() { + mFlags &= ~MOVE_BG_e; +} + +u32 dBgW::ChkMoveFlag() const { + return mFlags & MOVE_BG_e; +} + +void dBgW::vt_0x3C() { + cM3dGAab bnd = mpGrp[mRootGroupIdx].mAab; + GetPartition().fn_803391f0(&bnd); +} + +bool dBgW::GetMapCode(int polyIdx, int *pOut) { + cBgS_PolyInfo info; + info.SetActorInfo(BG_ID_MAX, nullptr, 0); + info.SetPolyIndex(polyIdx); + + int att0 = GetPolyAtt0(info); + int att1 = GetPolyAtt1(info); + bool target = GetZTargetThrough(info); + if (att0 >= 0x20) { + *pOut = dBgS::GetMapCode(att0 - 0x20, att1, target); + if (Chk0x24_0x20() && ScGame::currentSpawnInfo.trial == 1) { + *pOut = 0x1E; + } + return false; + } else { + return true; + } +} + +bool dBgW::UpdateDraw(mAllocator_c *alloc) { + for (int i = 0; i < 0x1F; ++i) { + mMapRelated[i].mCount = 0; + } + for (int i = 0; i < mpBgd->mTriNum; i++) { + int idx = 0; + if (!GetMapCode(i, &idx)) { + mMapRelated[idx].mCount++; + } + } + for (int i = 0; i < 0x1F; ++i) { + if (mMapRelated[i].mCount > 0) { + mMapRelated[i].mpIdx = new (alloc) int[mMapRelated[i].mCount]; + if (mMapRelated[i].mpIdx == nullptr) { + return false; + } + } + } + + int local_cnt[0x1F]; + for (int i = 0; i < 0x1F; i++) { + local_cnt[i] = 0; + } + for (int i = 0; i < mpBgd->mTriNum; i++) { + int idx = 0; + if (!GetMapCode(i, &idx)) { + mMapRelated[idx].mpIdx[local_cnt[idx]] = i; + local_cnt[idx]++; + } + } + return true; +} + +int dBgW::GetPolyAtt0(const cBgS_PolyInfo &info) { + return mpPolyCodes.GetDBgPc(mpBgd->mTriTbl[info.GetPolyIndex()].mId)->getAtt0Code(); +} + +bool dBgW::GetIsDraw(int idx) { + return mMapRelated[idx].mCount > 0; +} + +void dBgW::DrawOnMap(int idx, bool) {} diff --git a/src/d/col/bg/d_bg_w_base.cpp b/src/d/col/bg/d_bg_w_base.cpp new file mode 100644 index 00000000..0f447459 --- /dev/null +++ b/src/d/col/bg/d_bg_w_base.cpp @@ -0,0 +1,103 @@ + +#include "d/col/bg/d_bg_w_base.h" + +#include "d/col/bg/d_bg_s.h" + +dBgW_Base::dBgW_Base() { + ClrDBgWBase(); +} + +dBgW_Base::~dBgW_Base() { + if (ChkUsed()) { + dBgS::GetInstance()->Release(this); + } + if (GetRegistId() != BG_ID_MAX) { + dBgS::GetInstance()->UnRegist(this); + } + ClrDBgWBase(); +} + +void dBgW_Base::ClrDBgWBase() { + // Regswap? + + mRoomId = 0xFF; + mPriority = 2; + field_0x2E = 0xFF; + // A set to 0 is required. I think 0x24 may be flags, so an unset then set? + field_0x24 = 0; + field_0x24 = 4; + mRegistId = BG_ID_MAX; + field_0x2F = 0xFF; + mDiffShapeAngleY = 0; + mOldShapeAngleY = 0; + SetPushPullCallback(nullptr); + ClearMap(); + field_0x20 = 0; + field_0x22 = 0xFFFF; +} + +bool dBgW_Base::ChkMemoryError() { + return false; +} + +void dBgW_Base::CallRideCallback(dAcObjBase_c *, dAcObjBase_c *) { + // No Call +} + +void dBgW_Base::CallArrowStickCallback(dAcObjBase_c *, dAcObjBase_c *, mVec3_c &) { + // No Call +} + +bool dBgW_Base::CallUnkCallback(dAcObjBase_c *, dAcObjBase_c *) { + return false; +} + +void dBgW_Base::CalcDiffShapeAngleY(s16 shapeAngleY) { + mDiffShapeAngleY = shapeAngleY - mOldShapeAngleY; + mOldShapeAngleY = shapeAngleY; +} + +void dBgW_Base::SetOldShapeAngleY(s16 oldShapeAngleY) { + mOldShapeAngleY = oldShapeAngleY; +} + +bool dBgW_Base::InitMapStuff(mAllocator_c *pAllocator) { + ClearMap(); + return UpdateDraw(pAllocator) != false; +} + +bool dBgW_Base::fn_8034AD70() const { + u8 val = mField_0x18.field_0x00; + if (val == 0 || val == 2) { + return true; + } + return false; +} + +bool dBgW_Base::fn_8034ADA0() const { + return mField_0x18.field_0x00 <= 1; +} + +bool dBgW_Base::UpdateDraw(mAllocator_c * /* unused */) { + ClearMap(); + return true; +} + +void dBgW_Base::RegistBg(int id) { + mRegistId = id; +} + +void dBgW_Base::UnRegistBg() { + mRegistId = BG_ID_MAX; +} + +bool dBgW_Base::ChkReady() const { + if (mRegistId == BG_ID_MAX || ChkNotReady()) { + return false; + } + return true; +} + +void dBgW_Base::Set0x2F(u8 val) { + field_0x2F = val; +} diff --git a/src/d/col/bg/d_bg_w_kcol.cpp b/src/d/col/bg/d_bg_w_kcol.cpp new file mode 100644 index 00000000..5da42405 --- /dev/null +++ b/src/d/col/bg/d_bg_w_kcol.cpp @@ -0,0 +1,676 @@ +#include "d/col/bg/d_bg_w_kcol.h" + +#include "d/col/bg/d_bg_s.h" +#include "d/col/bg/d_bg_s_gnd_chk.h" +#include "d/col/bg/d_bg_s_lin_chk.h" +#include "toBeSorted/scgame.h" + +char STAGE_FS_A[] = "D201"; +char STAGE_FS_B[] = "D201_1"; +char STAGE_SSH[] = "D301"; + +dBgWKCol::dBgWKCol() : mpKCHead(nullptr) { + mNumPrism = 0; + mpTri = 0; +} + +dBgWKCol::~dBgWKCol() { + mpKCHead = nullptr; + mpTri = 0; +} + +void dBgWKCol::initKCollision(void *pFile) { + KCol_Header *pHeader = (KCol_Header *)pFile; + pkcdata *pData = (pkcdata *)pFile; + + pData->mpPositionData = (mVec3_c *)((u32)pFile + pHeader->pos_data_offset); + pData->mpNormalData = (mVec3_c *)((u32)pFile + pHeader->nrm_data_offset); + pData->mpPrismData = (KC_PrismData *)((u32)pFile + pHeader->prism_data_offset); + pData->mpBlockData = (u32 *)((u32)pFile + pHeader->block_data_offset); +} + +void dBgWKCol::Set(void *pKcl, void *pPlc) { + ClrDBgWBase(); + mpKCHead = (pkcdata *)pKcl; + mNumPrism = ((u32)mpKCHead->mpBlockData - (u32)mpKCHead->mpPrismData) / sizeof(KC_PrismData) + 1; + mCode.setBase(pPlc); + // Z,Y,X important? + f32 z = mpKCHead->mAreaMinPos.z; + f32 y = mpKCHead->mAreaMinPos.y; + f32 x = mpKCHead->mAreaMinPos.x; + u32 mz = mpKCHead->mAreaWidthMaskZ; + u32 my = mpKCHead->mAreaWidthMaskY; + u32 mx = mpKCHead->mAreaWidthMaskX; + mBnd.Set(mVec3_c(x, y, z), mVec3_c(x + ~mx, y + ~my, z + ~mz)); + + vt_0x3C(); + mAreaWidthMaskX = ~mpKCHead->mAreaWidthMaskX; + mAreaWidthMaskY = ~mpKCHead->mAreaWidthMaskY; + mAreaWidthMaskZ = ~mpKCHead->mAreaWidthMaskZ; +} + +void dBgWKCol::GetTriNrm(KC_PrismData *pd, mVec3_c **ppTriNrm) const { + *ppTriNrm = GetTriNrm(pd); +} + +bool dBgWKCol::ChkNotReady() const { + return mpKCHead == nullptr; +} + +bool dBgWKCol::ChkLock() const { + return false; +} + +bool dBgWKCol::ChkMoveBg() const { + return false; +} + +u32 dBgWKCol::ChkMoveFlag() const { + return 0; +} + +void dBgWKCol::GetTriPla(cBgS_PolyInfo const &polyInf, cM3dGPla *plane) const { + mVec3_c *pFaceNrm; + KC_PrismData *pPrismData = GetPrismData(polyInf.GetPolyIndex()); + GetTriNrm(pPrismData, &pFaceNrm); + + mVec3_c *pPos = GetTriPos(pPrismData); + plane->mNormal = *pFaceNrm; + plane->mD = -VEC3Dot(plane->mNormal, *pPos); +} + +bool dBgWKCol::GetTriPnt(cBgS_PolyInfo const &polyInf, mVec3_c *v1, mVec3_c *v2, mVec3_c *v3) const { + return GetTriPnt(polyInf.GetPolyIndex(), v1, v2, v3); +} + +bool dBgWKCol::GetTriPnt(int poly_index, mVec3_c *v1, mVec3_c *v2, mVec3_c *v3) const { + return GetTriPnt(GetPrismData(poly_index), v1, v2, v3); +} + +bool dBgWKCol::GetTriPnt(KC_PrismData const *pPrism, mVec3_c *v1, mVec3_c *v2, mVec3_c *v3) const { + *v1 = *GetTriPos(pPrism); + + mVec3_c face_nrm1, face_nrm2; + mVec3_c *pFaceNrm = GetTriNrm(pPrism); + mVec3_c *pEdgeNrm3 = GetEdgeNrm3(pPrism); + VEC3Cross(face_nrm1, pFaceNrm, GetEdgeNrm1(pPrism)); + f32 mag = VEC3Dot(face_nrm1, pEdgeNrm3); + if (cM3d_IsZero(mag)) { + return false; + } + + mag = pPrism->mHeight / mag; + + VEC3Scale(face_nrm1, face_nrm1, mag); + VEC3Add(v3, face_nrm1, v1); + + VEC3Cross(face_nrm2, GetEdgeNrm2(pPrism), pFaceNrm); + + mag = VEC3Dot(face_nrm1, pEdgeNrm3); + + if (cM3d_IsZero(mag)) { + return false; + } + + mag = pPrism->mHeight / mag; + VEC3Scale(face_nrm2, face_nrm2, mag); + VEC3Add(v2, face_nrm2, v1); + + return true; +} + +const cM3dGAab *dBgWKCol::GetBnd() const { + return &mBnd; +} + +u32 dBgWKCol::GetGrpInf(cBgS_PolyInfo const &pi) const { + return mCode.getGrpCode(GetPrismData(pi.GetPolyIndex())->mAttribute); +} + +void dBgWKCol::OffMoveFlag() {} + +bool dBgWKCol::ChkPolyThrough(int id, dBgPc *, cBgS_Chk *) { + // TODO - false return to satisify warnings + return false; +} + +bool dBgWKCol::ChkPolyThroughGnd(int id, dBgPc *, cBgS_Chk *) { + // TODO - false return to satisify warnings + return false; +} + +void dBgWKCol::vt_0x3C() { + mPartitionInfo.fn_803391f0(&mBnd); +} + +bool dBgWKCol::LineCheck(cBgS_LinChk *pLine) { + mVec3_c diff; + VEC3Sub(diff, pLine->mLin.GetStartP(), pLine->mLin.GetEndP()); + f32 mag = PSVECMag(diff); + if (mag < 500.0f) { + int tmp0 = (int)(mag * 0.002f) + 1; + f32 tmp1 = mag / (tmp0 + 1); + VEC3Scale(diff, diff, tmp1 / mag); + } + + // TODO Later lmao +} + +bool dBgWKCol::GroundCross(cBgS_GndChk *pGnd) { + // TODO - false return to satisify warnings + return false; +} + +void dBgWKCol::ShdwDraw(cBgS_ShdwDraw *pShdw) {} + +void dBgWKCol::CaptPoly(dBgS_CaptPoly &capt) {} + +bool dBgWKCol::WallCorrectSort(dBgS_Acch *pAcch) { + // TODO - false return to satisify warnings + return false; +} + +bool dBgWKCol::WallCorrect(dBgS_Acch *pAcch) { + // TODO - false return to satisify warnings + return false; +} + +bool dBgWKCol::RoofChk(dBgS_RoofChk *pRoof) { + // TODO - false return to satisify warnings + return false; +} + +bool dBgWKCol::SplGrpChk(dBgS_SplGrpChk *) { + // TODO - false return to satisify warnings + return false; +} + +bool dBgWKCol::SphChk(dBgS_SphChk *, void *) { + // TODO - false return to satisify warnings + return false; +} + +void dBgWKCol::GetTopUnder(f32 *pOutTop, f32 *pOutUnder) const { + f32 pos = mpKCHead->mAreaMinPos.y; + *pOutUnder = pos; + *pOutTop = pos + mAreaWidthMaskY; +} + +s32 dBgWKCol::GetGrpRoomIndex(cBgS_PolyInfo const &info) const { + return GetPolyCode(info.GetPolyIndex())->getGrpRoomIdx(); +} + +s32 dBgWKCol::GetExitId(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getExitId(); +} + +s32 dBgWKCol::GetZTargetThrough(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getTargetThrough(); +} + +int dBgWKCol::GetSpecialCode(cBgS_PolyInfo const &info) { + return GetSpecialCode(info.GetPolyIndex()); +} + +int dBgWKCol::GetSpecialCode(int polyIdx) { + return GetPolyCode(polyIdx)->getSpecialCode(); +} + +int dBgWKCol::GetCode0_0x30000000(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getCode0_0x30000000(); +} + +int dBgWKCol::GetCode0_0x80000000(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getCode0_0x80000000(); +} + +u32 dBgWKCol::GetPolyObjThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getObjThrough(); +} + +u32 dBgWKCol::GetPolyCamThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getCamThrough(); +} + +u32 dBgWKCol::GetPolyLinkThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getLinkThrough(); +} + +u32 dBgWKCol::GetPolyArrowThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getArrowThrough(); +} + +u32 dBgWKCol::GetPolySlingshotThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getSlingshotThrough(); +} + +u32 dBgWKCol::GetPolyBeetleThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getBeetleThrough(); +} + +u32 dBgWKCol::GetPolyClawshotThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getClawshotThrough(); +} + +u32 dBgWKCol::GetPolyBombThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getBombThrough(); +} + +u32 dBgWKCol::GetPolyWhipThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getWhipThrough(); +} + +u32 dBgWKCol::GetUnderwaterRoofCode(int polyIdx) { + return GetPolyCode(polyIdx)->getUnderwaterRoof(); +} + +u32 dBgWKCol::GetShdwThrough(int polyIdx) { + return GetPolyCode(polyIdx)->getShdwThrough(); +} + +int dBgWKCol::GetLinkNo(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getLinkNo(); +} + +s32 dBgWKCol::GetWallCode(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getWallCode(); +} + +int dBgWKCol::GetPolyAtt0Material(cBgS_PolyInfo const &info) { + int mat = GetPolyCode(info.GetPolyIndex())->getAtt0Code(); + if (mat >= 0x20) { + mat -= 0x20; + } + return mat; +} + +int dBgWKCol::GetPolyAtt1(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getAtt1Code(); +} + +int dBgWKCol::GetGroundCode(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getGroundCode(); +} + +u32 dBgWKCol::GetCode1_0x02000000(int polyIdx) { + return GetPolyCode(polyIdx)->getCode1_0x02000000(); +} + +u32 dBgWKCol::GetCode1_0x04000000(int polyIdx) { + return GetPolyCode(polyIdx)->getCode1_0x04000000(); +} + +u32 dBgWKCol::GetCode1_0x08000000(int polyIdx) { + return GetPolyCode(polyIdx)->getCode1_0x08000000(); +} + +u32 dBgWKCol::GetLightingCode(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getLightingCode(); +} + +s32 dBgWKCol::GetCamMoveBG(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getCamMoveBG(); +} + +s32 dBgWKCol::GetRoomCamId(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getRoomCam(); +} + +s32 dBgWKCol::GetRoomPathId(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getRoomPath(); +} + +s32 dBgWKCol::GetRoomPathPntNo(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getRoomPathPnt(); +} + +void dBgWKCol::CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) {} + +void dBgWKCol::TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) {} + +void dBgWKCol::MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) {} + +int dBgWKCol::GetMapCode(KC_PrismData *prism, int *pOut) { + cBgS_PolyInfo info; + + if (mpKCHead->mpNormalData[prism->mFaceNrmIdx].y <= 0.f) { + return true; + } + + if (mpTri != nullptr) { + int idx = GetPrismIdx(prism); + KC_Tri &tri = mpTri[idx]; + mVec3_c a, b, c; + VEC3Sub(a, tri.mB, tri.mA); + VEC3Sub(b, tri.mC, tri.mB); + VEC3Sub(c, tri.mA, tri.mC); + + if (cM3d_IsZero(VEC3Len(a))) { + return true; + } + if (cM3d_IsZero(VEC3Len(b))) { + return true; + } + if (cM3d_IsZero(VEC3Len(c))) { + return true; + } + } + info.SetPolyIndex(prism - mpKCHead->mpPrismData); + int att0 = GetPolyAtt0(info); + int att1 = GetPolyAtt1(info); + bool target = GetZTargetThrough(info); + if (att0 >= 0x20) { + *pOut = dBgS::GetMapCode(att0 - 0x20, att1, target); + return false; + } else { + return true; + } +} + +bool dBgWKCol::UpdateDraw(mAllocator_c *alloc) { + // TODO + // To Generate Weak Ct and Dt of KC_Tri + mpTri = new (alloc) KC_Tri[mNumPrism]; + if (mpTri == nullptr) { + return false; + } + + KC_PrismData *startPrism = mpKCHead->mpPrismData; + KC_PrismData *currPrism = startPrism + 1; + mBnd.ClearForMinMax(); + do { + // + mVec3_c a, b, c; + if (!GetTriPnt(currPrism, &a, &b, &c)) { + a = mpKCHead->mpPositionData[currPrism->mPosIdx]; + b = a; + c = a; + } + int idx = currPrism - mpKCHead->mpPrismData; + mpTri[idx].mA = a; + mpTri[idx].mB = b; + mpTri[idx].mC = c; + + mBnd.SetMinMax(a); + mBnd.SetMinMax(b); + mBnd.SetMinMax(c); + currPrism++; + } while (currPrism < (KC_PrismData *)mpKCHead->mpBlockData); + mBnd.PlusR(1.0f); + vt_0x3C(); + + ClearMapCount(); + + currPrism = mpKCHead->mpPrismData + 1; + do { + int mapCode = 0; + if (!GetMapCode(currPrism, &mapCode)) { + mMapRelated[mapCode].mCount++; + } + currPrism++; + } while (currPrism < (KC_PrismData *)mpKCHead->mpBlockData); + + for (int i = 0; i < 0x1F; i++) { + if (mMapRelated[i].mCount > 0) { + mMapRelated[i].mpIdx = new (alloc) int[mMapRelated[i].mCount]; + if (mMapRelated[i].mpIdx == nullptr) { + return false; + } + } + } + + int local_cnt[0x1F]; + for (int i = 0; i < 0x1F; i++) { + local_cnt[i] = 0; + } + currPrism = mpKCHead->mpPrismData + 1; + do { + int mapCode = 0; + if (!GetMapCode(currPrism, &mapCode)) { + mMapRelated[mapCode].mpIdx[local_cnt[mapCode]] = currPrism - mpKCHead->mpPrismData; + local_cnt[mapCode]++; + } + currPrism++; + } while (currPrism < (KC_PrismData *)mpKCHead->mpBlockData); + + return true; +} + +int dBgWKCol::GetPolyAtt0(cBgS_PolyInfo const &info) { + return GetPolyCode(info.GetPolyIndex())->getAtt0Code(); +} + +bool dBgWKCol::GetIsDraw(int idx) { + if (mMapRelated[idx].mCount <= 0) { + return false; + } + return mpTri != nullptr; +} + +void dBgWKCol::DrawMapSection(int idx, f32 yPos, f32 upper, f32 lower) { + int all = mMapRelated[idx].mCount; + int count = 0; + for (int i = 0; i < all; i++) { + KC_Tri &tri = mpTri[mMapRelated[idx].mpIdx[i]]; + if ( + // If Tri height is not above or below the limits + !((tri.mA.y > upper) && (tri.mB.y > upper) && (tri.mC.y > upper)) && + !((tri.mA.y < lower) && (tri.mB.y < lower) && (tri.mC.y < lower))) { + count++; + } + }; + + GXBegin(GX_TRIANGLES, GX_VTXFMT0, count * 3); + for (int i = 0; i < all; i++) { + KC_Tri &tri = mpTri[mMapRelated[idx].mpIdx[i]]; + if ( + // If Tri height is not above or below the limits + !((tri.mA.y > upper) && (tri.mB.y > upper) && (tri.mC.y > upper)) && + !((tri.mA.y < lower) && (tri.mB.y < lower) && (tri.mC.y < lower))) + { + f32 BAx = tri.mB.x - tri.mA.x; + f32 CBx = tri.mC.x - tri.mB.x; + f32 ACx = tri.mA.x - tri.mC.x; + + f32 BAz = tri.mB.z - tri.mA.z; + f32 CBz = tri.mC.z - tri.mB.z; + f32 ACz = tri.mA.z - tri.mC.z; + + f32 tmp0 = nw4r::math::FSqrt(BAx * BAx + BAz * BAz); + f32 tmp1 = nw4r::math::FSqrt(CBx * CBx + CBz * CBz); + f32 tmp2 = nw4r::math::FSqrt(ACx * ACx + ACz * ACz); + + tmp0 = cM3d_IsZero(tmp0) ? 0.0f : 10.0f / tmp0; + tmp1 = cM3d_IsZero(tmp1) ? 0.0f : 10.0f / tmp1; + tmp2 = cM3d_IsZero(tmp2) ? 0.0f : 10.0f / tmp2; + + f32 t0x = BAx * tmp0; + f32 t0z = BAz * tmp0; + + f32 t1z = CBz * tmp1; + f32 t1x = CBx * tmp1; + + f32 t2x = ACx * tmp2; + f32 t2z = ACz * tmp2; + + f32 x0 = t2x + (tri.mA.x - t0x); + f32 z0 = t2z + (tri.mA.z - t0z); + + f32 x2 = t0x + (tri.mB.x - t1x); + f32 z2 = t0z + (tri.mB.z - t1z); + + f32 x1 = t1x + (tri.mC.x - t2x); + f32 z1 = t1z + (tri.mC.z - t2z); + + GXPosition3f32(x0, yPos, z0); + GXPosition3f32(x1, yPos, z1); + GXPosition3f32(x2, yPos, z2); + } + } +} + +void dBgWKCol::DrawOnMap(int idx, bool param2) { + // uhhhhhh + + if (!GetIsDraw(idx)) { + return; + } + + if (param2) { + // FS Room 9 /* Spiral Staircase */ + if (GetRoomId() == 9 && (ScGame::isCurrentStage(STAGE_FS_A) || ScGame::isCurrentStage(STAGE_FS_B))) { + int all = mMapRelated[idx].mCount; + mVec3_c AB, CA, BC; + mVec3_c v0, v1, v2; + // Pass 1 + int count = 0; + for (int i = 0; i < all; i++) { + KC_Tri &tri = mpTri[mMapRelated[idx].mpIdx[i]]; + if (!((tri.mA.y < -550.0f) && (tri.mB.y < -550.0f) && (tri.mC.y < -550.0f))) { + count++; + } + } + GXBegin(GX_TRIANGLES, GX_VTXFMT0, count * 3); + for (int i = 0; i < all; i++) { + KC_Tri &tri = mpTri[mMapRelated[idx].mpIdx[i]]; + if (!((tri.mA.y < -550.0f) && (tri.mB.y < -550.0f) && (tri.mC.y < -550.0f))) { + VEC3Sub(AB, tri.mB, tri.mA); + VEC3Sub(CA, tri.mA, tri.mC); + VEC3Sub(BC, tri.mC, tri.mB); + + f32 len0 = VEC3Len(AB); + f32 len1 = VEC3Len(CA); + f32 len2 = VEC3Len(BC); + + VEC3Scale(AB, AB, 10.0f / len0); + VEC3Scale(CA, CA, 10.0f / len1); + VEC3Scale(BC, BC, 10.0f / len2); + + VEC3Sub(v0, tri.mA, AB); + VEC3Sub(v1, tri.mC, CA); + VEC3Sub(v2, tri.mB, BC); + + VEC3Add(v0, v0, CA); + VEC3Add(v1, v1, BC); + VEC3Add(v2, v2, AB); + + GXPosition3f32(v0.x, v0.y, v0.z); + GXPosition3f32(v1.x, v1.y, v1.z); + GXPosition3f32(v2.x, v2.y, v2.z); + } + } + // Pass 2 + count = 0; + for (int i = 0; i < all; i++) { + KC_Tri &tri = mpTri[mMapRelated[idx].mpIdx[i]]; + if (!((tri.mA.y > -550.0f) && (tri.mB.y > -550.0f) && (tri.mC.y > -550.0f))) { + count++; + } + } + GXBegin(GX_TRIANGLES, GX_VTXFMT0, count * 3); + for (int i = 0; i < all; i++) { + KC_Tri &tri = mpTri[mMapRelated[idx].mpIdx[i]]; + if (!((tri.mA.y > -550.0f) && (tri.mB.y > -550.0f) && (tri.mC.y > -550.0f))) { + VEC3Sub(AB, tri.mB, tri.mA); + VEC3Sub(CA, tri.mA, tri.mC); + VEC3Sub(BC, tri.mC, tri.mB); + + f32 len0 = VEC3Len(AB); + f32 len1 = VEC3Len(CA); + f32 len2 = VEC3Len(BC); + + VEC3Scale(AB, AB, 10.0f / len0); + VEC3Scale(CA, CA, 10.0f / len1); + VEC3Scale(BC, BC, 10.0f / len2); + + VEC3Sub(v0, tri.mA, AB); + VEC3Sub(v2, tri.mB, BC); + VEC3Sub(v1, tri.mC, CA); + + VEC3Add(v0, v0, CA); + VEC3Add(v1, v1, BC); + VEC3Add(v2, v2, AB); + + // v0.y = (v0.y + 6500.0f) * 0.1680672f - 6500.0f; + // v1.y = (v1.y + 6500.0f) * 0.1680672f - 6500.0f; + // v2.y = (v2.y + 6500.0f) * 0.1680672f - 6500.0f; + + GXPosition3f32(v0.x, (v0.y + 6500.0f) * 0.1680672f - 6500.0f, v0.z); + GXPosition3f32(v1.x, (v1.y + 6500.0f) * 0.1680672f - 6500.0f, v1.z); + GXPosition3f32(v2.x, (v2.y + 6500.0f) * 0.1680672f - 6500.0f, v2.z); + // GXPosition3f32(v0.x, v0.y, v0.z); + // GXPosition3f32(v1.x, v1.y, v1.z); + // GXPosition3f32(v2.x, v2.y, v2.z); + } + } + } + // Normal + else { + int all = mMapRelated[idx].mCount; + GXBegin(GX_TRIANGLES, GX_VTXFMT0, all * 3); + for (int i = 0; i < all; i++) { + KC_Tri &tri = mpTri[mMapRelated[idx].mpIdx[i]]; + + mVec3_c AB, CA, BC; + mVec3_c v0, v1, v2; + + VEC3Sub(AB, tri.mB, tri.mA); + VEC3Sub(CA, tri.mA, tri.mC); + VEC3Sub(BC, tri.mC, tri.mB); + + f32 len0 = VEC3Len(AB); + f32 len1 = VEC3Len(CA); + f32 len2 = VEC3Len(BC); + + VEC3Scale(AB, AB, 10.0f / len0); + VEC3Scale(CA, CA, 10.0f / len1); + VEC3Scale(BC, BC, 10.0f / len2); + + VEC3Sub(v0, tri.mA, AB); + VEC3Sub(v1, tri.mC, CA); + VEC3Sub(v2, tri.mB, BC); + + VEC3Add(v0, v0, CA); + VEC3Add(v1, v1, BC); + VEC3Add(v2, v2, AB); + + GXPosition3f32(v0.x, v0.y, v0.z); + GXPosition3f32(v1.x, v1.y, v1.z); + GXPosition3f32(v2.x, v2.y, v2.z); + } + } + } + // Sections + else { + const cM3dGAab *bnd = GetBnd(); + f32 yPos = (bnd->GetMinP()->y + bnd->GetMaxP()->y) * 0.5f; + + // Sandship + if (GetRoomId() == 15 && ScGame::isCurrentStage(STAGE_SSH)) { + yPos = 0.0f; + } + if (idx == 0x12 /* Abyss `Common/tex/naraku.bti`)*/) { + yPos -= 1.0f; + } + if (ScGame::isCurrentStage(STAGE_FS_A) || ScGame::isCurrentStage(STAGE_FS_B)) { + int room = GetRoomId(); + /* FS Room 9 - Spiral Staircse */ + if (room == 9) { + DrawMapSection(idx, yPos, 1e9f, -550.0f); + DrawMapSection(idx, -6000.0f, -550.0f, -1e9f); + return; + } + /* FS Room 6 - Bridges */ + if (room == 6) { + DrawMapSection(idx, yPos, 1e9f, -5500.0f); + DrawMapSection(idx, -6000.0f, -550.0f, -1e9f); + return; + } + } + DrawMapSection(idx, yPos, 1e9f, -1e9f); + } +} + +int dBgWKCol::GetPrismIdx(const KC_PrismData *pPrismData) { + return (pPrismData - mpKCHead->mpPrismData); +} diff --git a/src/d/col/bg/d_bg_w_sv.cpp b/src/d/col/bg/d_bg_w_sv.cpp new file mode 100644 index 00000000..41fa92b0 --- /dev/null +++ b/src/d/col/bg/d_bg_w_sv.cpp @@ -0,0 +1,204 @@ +#include "d/col/bg/d_bg_w_sv.h" + +#include "d/col/c/c_bg_s_chk.h" + +dBgWSv::dBgWSv() { + mpVtx = nullptr; +} + +dBgWSv::~dBgWSv() {} + +bool dBgWSv::Set(cBgD_t *pDzb, PLC *pPlc, u32 p3, bool p4) { + u32 flags = 0; + if (p4) { + flags |= 0x10; + } + if (cBgW::Set(pDzb, pPlc, flags | 99, nullptr, nullptr)) { + return true; + } + + mField_0x214 = p3; + if (p3 & 1) { + return false; + } + mpVtx = (nw4r::math::VEC3 *)new Vec[mpBgd->mVtxNum]; + return mpVtx == nullptr; +} + +void dBgWSv::CopyBackVtx() { + if (!mpVtx || !mpVtxTbl) { + return; + } + for (int i = 0; i < mpBgd->mVtxNum; i++) { + mpVtx[i] = mpVtxTbl[i]; + } +} + +bool dBgWSv::CrrPosWork(mVec3_c *pPos, int vtx0, int vtx1, int vtx2) { + mVec3_c tmp0, tmp1; + + tmp0.x = mpVtx[vtx1].x - mpVtx[vtx0].x; + tmp0.y = mpVtx[vtx1].y - mpVtx[vtx0].y; + tmp0.z = mpVtx[vtx1].z - mpVtx[vtx0].z; + + tmp1.x = mpVtx[vtx2].x - mpVtx[vtx0].x; + tmp1.y = mpVtx[vtx2].y - mpVtx[vtx0].y; + tmp1.z = mpVtx[vtx2].z - mpVtx[vtx0].z; + + if (cM3d_IsZero(tmp0.z) || cM3d_IsZero(tmp1.z)) { + return true; + } + + f32 tmp2 = tmp0.x - (tmp0.z * (tmp1.x / tmp1.z)); + f32 tmp3 = tmp1.x - (tmp1.z * (tmp0.x / tmp0.z)); + + if (cM3d_IsZero(tmp2) || cM3d_IsZero(tmp3)) { + return true; + } + + pPos->x -= mpVtx[vtx0].x; + pPos->z -= mpVtx[vtx0].z; + + mVec3_c tmp4; + mVec3_c tmp5; + + f32 tmp6 = (pPos->x - (pPos->z * (tmp1.x / tmp1.z))) / tmp2; + f32 tmp7 = (pPos->x - (pPos->z * (tmp0.x / tmp0.z))) / tmp3; + + tmp4.x = mpVtxTbl[vtx1].x - mpVtxTbl[vtx0].x; + tmp4.z = mpVtxTbl[vtx1].z - mpVtxTbl[vtx0].z; + + tmp5.x = mpVtxTbl[vtx2].x - mpVtxTbl[vtx0].x; + tmp5.z = mpVtxTbl[vtx2].z - mpVtxTbl[vtx0].z; + + pPos->x = (tmp6 * tmp4.x) + (tmp7 * tmp5.x); + pPos->z = (tmp6 * tmp4.z) + (tmp7 * tmp5.z); + + pPos->x += mpVtxTbl[vtx0].x; + pPos->z += mpVtxTbl[vtx0].z; + + return false; +} + +void dBgWSv::CrrPos( + cBgS_PolyInfo const &info, void *pObj, bool b, mVec3_c *pPos, mAng3_c *pAngle, mAng3_c *pShapeAngle +) { + if (mField_0x214 & 1) { + return; + } + + if (!b) { + return; + } + + int idx = info.GetPolyIndex(); + cBgD_Tri_t *tri = mpBgd->mTriTbl; + + u32 vtx0 = tri[idx].mVtxIdx0; + u32 vtx1 = tri[idx].mVtxIdx1; + u32 vtx2 = tri[idx].mVtxIdx2; + + if (CrrPosWork(pPos, vtx0, vtx1, vtx2) && CrrPosWork(pPos, vtx1, vtx2, vtx0)) { + CrrPosWork(pPos, vtx2, vtx0, vtx1); + } +} + +bool dBgWSv::TransPosWork(mVec3_c *pPos, int vtx0, int vtx1, int vtx2) { + mVec3_c tmp0; + mVec3_c tmp1; + + tmp0.x = mpVtx[vtx1].x - mpVtx[vtx0].x; + tmp0.y = mpVtx[vtx1].y - mpVtx[vtx0].y; + tmp0.z = mpVtx[vtx1].z - mpVtx[vtx0].z; + + tmp1.x = mpVtx[vtx2].x - mpVtx[vtx0].x; + tmp1.y = mpVtx[vtx2].y - mpVtx[vtx0].y; + tmp1.z = mpVtx[vtx2].z - mpVtx[vtx0].z; + + if (cM3d_IsZero(tmp0.z) || cM3d_IsZero(tmp1.z)) { + return true; + } + + f32 tmp2 = tmp0.x - (tmp0.z * (tmp1.x / tmp1.z)); + f32 tmp3 = tmp1.x - (tmp1.z * (tmp0.x / tmp0.z)); + + if (cM3d_IsZero(tmp2) || cM3d_IsZero(tmp3)) { + return true; + } + + f32 tmp4 = pPos->x - mpVtx[vtx0].x; + f32 tmp5 = pPos->z - mpVtx[vtx0].z; + + f32 tmp6 = (tmp4 - (tmp5 * (tmp1.x / tmp1.z))) / tmp2; + f32 tmp7 = (tmp4 - (tmp5 * (tmp0.x / tmp0.z))) / tmp3; + + if (tmp6 < 0.0f || tmp6 > 1.0f || tmp7 < 0.0f || tmp7 > 1.0f) { + return true; + } + + mVec3_c tmp8; + mVec3_c tmp9; + + tmp8.x = mpVtxTbl[vtx1].x - mpVtxTbl[vtx0].x; + tmp8.y = mpVtxTbl[vtx1].y - mpVtxTbl[vtx0].y; + tmp8.z = mpVtxTbl[vtx1].z - mpVtxTbl[vtx0].z; + + tmp9.x = mpVtxTbl[vtx2].x - mpVtxTbl[vtx0].x; + tmp9.y = mpVtxTbl[vtx2].y - mpVtxTbl[vtx0].y; + tmp9.z = mpVtxTbl[vtx2].z - mpVtxTbl[vtx0].z; + + pPos->x = (tmp6 * tmp8.x) + (tmp7 * tmp9.x); + pPos->y = (tmp6 * tmp8.y) + (tmp7 * tmp9.y); + pPos->z = (tmp6 * tmp8.z) + (tmp7 * tmp9.z); + + pPos->x += mpVtxTbl[vtx0].x; + pPos->y += mpVtxTbl[vtx0].y; + pPos->z += mpVtxTbl[vtx0].z; + + return false; +} + +void dBgWSv::TransPos( + cBgS_PolyInfo const &info, void *pObj, bool b, mVec3_c *pPos, mAng3_c *pAngle, mAng3_c *pShapeAngle +) { + if (mField_0x214 & 1) { + return; + } + + if (!b) { + return; + } + + int idx = info.GetPolyIndex(); + cBgD_Tri_t *tri = mpBgd->mTriTbl; + + u32 vtx0 = tri[idx].mVtxIdx0; + u32 vtx1 = tri[idx].mVtxIdx1; + u32 vtx2 = tri[idx].mVtxIdx2; + + if (TransPosWork(pPos, vtx0, vtx1, vtx2) && TransPosWork(pPos, vtx1, vtx2, vtx0)) { + TransPosWork(pPos, vtx2, vtx0, vtx1); + } +} + +void dBgWSv::MatrixCrrPos( + cBgS_PolyInfo const &info, void *pObj, bool b, mVec3_c *pPos, mAng3_c *pAngle, mAng3_c *pShapeAngle +) {} + +void dBgWSv::ApplyMtx(mMtx_c *pMtx) { + mpMdlMtx = pMtx; + ClrNoCalcVtx(); + UpdateMtx(); + GlobalVtx(); + mpMdlMtx = nullptr; + UpdateMtx(); + SetNoCalcVtx(); +} + +void dBgWSv::SetTriHeight(int idx, f32 y) { + mpVtxTbl[idx].y = y; +} + +nw4r::math::VEC3 *dBgWSv::GetTri(int idx) { + return &mpVtxTbl[idx]; +} diff --git a/src/d/col/bg/d_bg_w_time.cpp b/src/d/col/bg/d_bg_w_time.cpp new file mode 100644 index 00000000..e68f8456 --- /dev/null +++ b/src/d/col/bg/d_bg_w_time.cpp @@ -0,0 +1,328 @@ +#include "d/col/bg/d_bg_w_time.h" + +#include "d/col/bg/d_bg_s_lin_chk.h" +#include "d/col/bg/d_bg_s_sph_chk.h" +#include "d/col/bg/d_bg_w.h" + +dBgWTime::dBgWTime() {} + +dBgWTime::~dBgWTime() {} + +void dBgWTime::GetTopUnder(f32 *pOutTop, f32 *pOutUnder) const { + f32 height = mCyl.mHeight; + f32 posY = mCyl.GetC().y; + *pOutTop = posY + height; + *pOutUnder = posY; +} + +bool dBgWTime::ChkNotReady() const { + return false; +} + +bool dBgWTime::ChkLock() const { + return false; +} + +bool dBgWTime::ChkMoveBg() const { + return true; +} + +u32 dBgWTime::ChkMoveFlag() const { + return false; +} + +void dBgWTime::GetTriPla(cBgS_PolyInfo const &info, cM3dGPla *pPla) const { + *pPla = info.GetPlane(); +} + +// part of c_m3d but idk a name for it yet +extern "C" bool fn_803350A0(const cM3dGPla *, mMtx_c *); + +bool dBgWTime::GetTriPnt(cBgS_PolyInfo const &info, mVec3_c *pA, mVec3_c *pB, mVec3_c *pC) const { + mMtx_c mtx; + + if (!fn_803350A0(&info.GetPlane(), &mtx)) { + return false; + } + + pA->set(0.f, 0.f, 1.f); + pB->set(1.f, 0.f, -1.f); + pC->set(-1.f, 0.f, -1.f); + + PSMTXMultVec(mtx, *pA, *pA); + PSMTXMultVec(mtx, *pB, *pB); + PSMTXMultVec(mtx, *pC, *pC); + + *pA += info.GetField0x20(); + *pB += info.GetField0x20(); + *pC += info.GetField0x20(); + + return true; +} + +const cM3dGAab *dBgWTime::GetBnd() const { + return &mBnd; +} + +u32 dBgWTime::GetGrpInf(cBgS_PolyInfo const &) const { + return 0; +} + +void dBgWTime::OffMoveFlag() {} + +void dBgWTime::vt_0x3C() { + mPartitionInfo.fn_803391f0(&mBnd); +} + +bool dBgWTime::LineCheck(cBgS_LinChk *pLine) { + mVec3_c &linStart = (mVec3_c &)pLine->GetLinStart(); + mVec3_c &linEnd = (mVec3_c &)pLine->GetLinEnd(); + + bool bStart = mCyl.Cross(linStart); + bool bEnd = mCyl.Cross(linEnd); + + if (bStart && bEnd) { + return false; + } + + if (!bStart && bEnd) { + if (!pLine->ChkFrontFlag()) { + return false; + } + } else if (bStart && !bEnd) { + if (!pLine->ChkBackFlag()) { + return false; + } + } else if (!pLine->ChkFrontFlag()) { + return false; + } + + cM3dGLin lin; + lin.Set(linStart, linEnd); + mVec3_c vec0; + mVec3_c vec1; + if (!cM3d_Cross_CylLin(&mCyl, &lin, vec0, vec1)) { + return false; + } + if (!fn_803537a0(&vec0, pLine)) { + return false; + } + fn_80353a00(pLine, &vec0); + linEnd = vec0; + return true; +} + +bool dBgWTime::GroundCross(cBgS_GndChk *) { + return false; +} + +void dBgWTime::ShdwDraw(cBgS_ShdwDraw *) {} + +void dBgWTime::CaptPoly(dBgS_CaptPoly &) {} + +bool dBgWTime::WallCorrect(dBgS_Acch *) { + // TODO - false return to satisfy warning + return false; +} + +bool dBgWTime::WallCorrectSort(dBgS_Acch *pAcch) { + return WallCorrect(pAcch); +} + +bool dBgWTime::RoofChk(dBgS_RoofChk *) { + return false; +} + +bool dBgWTime::SplGrpChk(dBgS_SplGrpChk *) { + return false; +} + +bool dBgWTime::SphChk(dBgS_SphChk *pSph, void *pDat) { + mVec3_c a, b, c; + cM3dGPla pla; + mVec3_c cylSphDiff = mCyl.mCenter - pSph->mCenter; + f32 SphRad = pSph->mRadius; + f32 dist = EGG::Math::sqrt(cylSphDiff.x * cylSphDiff.x + cylSphDiff.z * cylSphDiff.z); + f32 CylRad = mCyl.mRadius; + if (dist > SphRad + CylRad || dist < CylRad - SphRad) { + return false; + } + mVec3_c diff = pSph->mCenter - mCyl.mCenter; + diff.y = 0.0f; + + f32 mag = VEC3Len(diff); + if (cM3d_IsZero(mag)) { + return false; + } + + diff *= 1.0f / mag; + diff *= mCyl.mRadius; + + mVec3_c adj; + + adj.y = pSph->mCenter.y + diff.y; + adj.x = mCyl.mCenter.x + diff.x; + adj.z = mCyl.mCenter.z + diff.z; + + if (!fn_803537a0(&cylSphDiff, pSph)) { + fn_80353a00(pSph, &adj); + + GetTriPnt(*pSph, &a, &b, &c); + + sVtx[0].x = a.x; + sVtx[0].y = a.y; + sVtx[0].z = a.z; + sVtx[1].x = b.x; + sVtx[1].y = b.y; + sVtx[1].z = b.z; + sVtx[2].x = c.x; + sVtx[2].y = c.y; + sVtx[2].z = c.z; + pla = pSph->GetPlane(); + pSph->mField_0x80 = dist; + pSph->mField_0x84.set(adj.x, adj.y, adj.z); + pSph->mCallback(pSph, sVtx, 0, 1, 2, &pla, pDat); + return true; + } + return false; +} + +s32 dBgWTime::GetGrpRoomIndex(cBgS_PolyInfo const &) const { + return 0x3F; +} + +s32 dBgWTime::GetExitId(cBgS_PolyInfo const &) { + return 0xFF; +} + +s32 dBgWTime::GetZTargetThrough(cBgS_PolyInfo const &) { + return 0; +} + +int dBgWTime::GetSpecialCode(cBgS_PolyInfo const &) { + return 0; +} + +int dBgWTime::GetSpecialCode(int) { + return 0; +} + +int dBgWTime::GetCode0_0x30000000(cBgS_PolyInfo const &) { + return 0; +} + +u32 dBgWTime::GetPolyObjThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolyCamThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolyLinkThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolyArrowThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolySlingshotThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolyBeetleThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolyClawshotThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolyBombThrough(int) { + return 0; +} + +u32 dBgWTime::GetPolyWhipThrough(int) { + return 0; +} + +u32 dBgWTime::GetShdwThrough(int) { + return 0; +} + +u32 dBgWTime::GetUnderwaterRoofCode(int) { + return 1; +} + +int dBgWTime::GetCode0_0x80000000(cBgS_PolyInfo const &) { + return 0; +} + +int dBgWTime::GetLinkNo(cBgS_PolyInfo const &) { + return 0xFF; +} + +s32 dBgWTime::GetWallCode(cBgS_PolyInfo const &) { + return 2 /* Cannot Run Up */; +} + +int dBgWTime::GetPolyAtt0Material(cBgS_PolyInfo const &) { + return 0; +} + +int dBgWTime::GetPolyAtt0(cBgS_PolyInfo const &) { + return 0; +} + +int dBgWTime::GetPolyAtt1(cBgS_PolyInfo const &) { + return 0; +} + +int dBgWTime::GetGroundCode(cBgS_PolyInfo const &) { + return 6 /* POLY_GROUND_6 */; +} + +u32 dBgWTime::GetCode1_0x02000000(int) { + return 0; +} + +u32 dBgWTime::GetCode1_0x04000000(int) { + return 0; +} + +u32 dBgWTime::GetCode1_0x08000000(int) { + return 0; +} + +u32 dBgWTime::GetLightingCode(cBgS_PolyInfo const &) { + return 0xF; +} + +s32 dBgWTime::GetCamMoveBG(cBgS_PolyInfo const &) { + return 0; +} + +s32 dBgWTime::GetRoomCamId(cBgS_PolyInfo const &) { + return 0; +} + +s32 dBgWTime::GetRoomPathId(cBgS_PolyInfo const &) { + return 0xFF; +} + +s32 dBgWTime::GetRoomPathPntNo(cBgS_PolyInfo const &) { + return 0xFF; +} + +void dBgWTime::CrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) {} + +void dBgWTime::TransPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) {} + +void dBgWTime::MatrixCrrPos(cBgS_PolyInfo const &, void *, bool, mVec3_c *, mAng3_c *, mAng3_c *) {} + +bool dBgWTime::GetIsDraw(int) { + return false; +} + +void dBgWTime::DrawOnMap(int, bool) {} diff --git a/src/d/col/c/c_bg_s_chk.cpp b/src/d/col/c/c_bg_s_chk.cpp new file mode 100644 index 00000000..358601d0 --- /dev/null +++ b/src/d/col/c/c_bg_s_chk.cpp @@ -0,0 +1,11 @@ +#include "d/col/c/c_bg_s_chk.h" + +cBgS_Chk::cBgS_Chk() + : mPolyPassChk(nullptr), mGrpPassChk(nullptr), mActorId(0), mField_0x0C(0), mField_0x0E(1), mField_0x10(1) {} + +cBgS_Chk::~cBgS_Chk() {} + +void cBgS_Chk::SetActorID(u32 *pId) { + u32 id = pId ? *pId : 0; + mActorId = id; +} diff --git a/src/d/col/c/c_bg_s_gnd_chk.cpp b/src/d/col/c/c_bg_s_gnd_chk.cpp new file mode 100644 index 00000000..ec9e6986 --- /dev/null +++ b/src/d/col/c/c_bg_s_gnd_chk.cpp @@ -0,0 +1,18 @@ +#include "d/col/c/c_bg_s_gnd_chk.h" + +cBgS_GndChk::cBgS_GndChk() { + mPos = mVec3_c::Zero; + mField_0x74 = 1; +} + +cBgS_GndChk::~cBgS_GndChk() {} + +void cBgS_GndChk::SetPos(const mVec3_c &pPos) { + mPos.x = pPos.x; + mPos.y = pPos.y; + mPos.z = pPos.z; +} + +void cBgS_GndChk::SetPos(const mVec3_c *pPos) { + mPos = *pPos; +} diff --git a/src/d/col/c/c_bg_s_lin_chk.cpp b/src/d/col/c/c_bg_s_lin_chk.cpp new file mode 100644 index 00000000..aeeb0359 --- /dev/null +++ b/src/d/col/c/c_bg_s_lin_chk.cpp @@ -0,0 +1,29 @@ +#include "d/col/c/c_bg_s_lin_chk.h" + +cBgS_LinChk::cBgS_LinChk() { + Ct(); +} + +cBgS_LinChk::~cBgS_LinChk() {} + +void cBgS_LinChk::Ct() { + mVec3_c set = mVec3_c::Zero; + mLin.Set(set, set); + mField_0x6C = set; + mPreRoofChk = false; + mPreWallChk = false; + mPreGroundChk = false; + mFrontFlag = true; + mBackFlag = false; + mHit = false; +} + +void cBgS_LinChk::Set2(const mVec3_c &start, const mVec3_c &end, u32 id) { + mLin.Set(start, end); + mField_0x6C = end; + mActorId = id; + mHit = false; + ClearPi(); +} + +void cBgS_LinChk::SetEnd(const mVec3_c *) {} diff --git a/src/d/col/c/c_bg_s_poly_info.cpp b/src/d/col/c/c_bg_s_poly_info.cpp new file mode 100644 index 00000000..c1f4ecb4 --- /dev/null +++ b/src/d/col/c/c_bg_s_poly_info.cpp @@ -0,0 +1,35 @@ + +#include "d/col/c/c_bg_s_poly_info.h" + +#include "d/col/bg/d_bg_s.h" + +bool cBgS_PolyInfo::ChkSetInfo() const { + if (mPolyIndex == 0xFFFF || mBgIndex == BG_ID_MAX) { + return false; + } + return true; +} + +void cBgS_PolyInfo::SetPolyInfo(const cBgS_PolyInfo &other) { + *this = other; +} + +bool cBgS_PolyInfo::ChkSafe(const void *pBg, s32 id) const { + if (unk_0x04 == pBg && mActorPId == id) { + return true; + } + return false; +} + +bool cBgS_PolyInfo::ChkBgIndex() const { + return mBgIndex != BG_ID_MAX; +} + +mAng cBgS_PolyInfo::GetAngle(mAng angle) const { + cM3dGPla pla; + if (!dBgS::GetInstance()->GetTriPla(*this, &pla)) { + return mAng(0); + } else { + return pla.GetAngle(angle); + } +} diff --git a/src/d/col/c/c_bg_s_shdw_draw.cpp b/src/d/col/c/c_bg_s_shdw_draw.cpp new file mode 100644 index 00000000..9c49c36a --- /dev/null +++ b/src/d/col/c/c_bg_s_shdw_draw.cpp @@ -0,0 +1,22 @@ +#include "d/col/c/c_bg_s_shdw_draw.h" + +cBgS_ShdwDraw::cBgS_ShdwDraw() { + mpPla = nullptr; +} + +cBgS_ShdwDraw::~cBgS_ShdwDraw() {} + +void cBgS_ShdwDraw::Set(const mVec3_c &start, const mVec3_c &end) { + mBnd.Set(start, end); +} + +void cBgS_ShdwDraw::SetCallback(cBgS_ShdwDraw_Callback pCallback) { + mpCallback = pCallback; +} + +void cBgS_ShdwDraw::SetP(cM3dGPla *pPla) { + mpPla = pPla; +} +void cBgS_ShdwDraw::Calc(cM3dGTri *, mVec3_c *, mVec3_c *, mVec3_c *) { + // TODO +} diff --git a/src/d/col/c/c_bg_w.cpp b/src/d/col/c/c_bg_w.cpp new file mode 100644 index 00000000..8794e181 --- /dev/null +++ b/src/d/col/c/c_bg_w.cpp @@ -0,0 +1,21 @@ +#include "d/col/c/c_bg_w.h" + +cBgW_BgId::cBgW_BgId() { + Ct(); +} + +cBgW_BgId::~cBgW_BgId() {} + +void cBgW_BgId::Regist(int id) { + m_id = id; +} + +void cBgW_BgId::Release() { + Ct(); +} + +bool cBgW_BgId::ChkUsed() const { + // What?? + u16 id = GetId(); + return id <= BG_ID_MAX - 1; +} diff --git a/src/d/col/c/c_cc_d.cpp b/src/d/col/c/c_cc_d.cpp new file mode 100644 index 00000000..e69de29b diff --git a/src/d/col/c/c_m2d.cpp b/src/d/col/c/c_m2d.cpp new file mode 100644 index 00000000..717536e1 --- /dev/null +++ b/src/d/col/c/c_m2d.cpp @@ -0,0 +1,3 @@ +#include "d/col/c/c_m2d.h" + +void cM2d_CrossCirLin(cM2dGCir &, float, float, float, float, float *, float *) {} diff --git a/src/d/col/c/c_m3d.cpp b/src/d/col/c/c_m3d.cpp new file mode 100644 index 00000000..9ade21dc --- /dev/null +++ b/src/d/col/c/c_m3d.cpp @@ -0,0 +1,242 @@ +#include "d/col/c/c_m3d.h" + +#include "d/col/c/c_m3d_g_aab.h" +#include "d/col/c/c_m3d_g_cir.h" +#include "d/col/c/c_m3d_g_cps.h" +#include "d/col/c/c_m3d_g_cyl.h" +#include "d/col/c/c_m3d_g_lin.h" +#include "d/col/c/c_m3d_g_pla.h" +#include "d/col/c/c_m3d_g_sph.h" +#include "d/col/c/c_m3d_g_tri.h" +#include "d/col/c/c_m3d_g_unk.h" +#include "egg/math/eggMath.h" +#include "m/m_vec.h" +#include "math.h" +#include "nw4r/math/math_types.h" +#include "rvl/MTX.h" + +using namespace nw4r::math; +using namespace EGG; + +const f32 G_CM3D_F_ABS_MIN = 32 * FLT_EPSILON; + +inline void cM3d_Cross(const VEC3 *pVecA, const VEC3 *pVecB, const VEC3 *pVecC, VEC3 *pVecOut) { + VEC3 tmp1; + VEC3 tmp2; + VEC3Sub(&tmp1, pVecB, pVecA); + VEC3Sub(&tmp2, pVecC, pVecA); + + VEC3Cross(pVecOut, &tmp1, &tmp2); +} + +bool cM3d_Len2dSqPntAndSegLine(f32, f32, f32, f32, f32, f32, f32 *, f32 *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Len3dSqPntAndSegLine(const cM3dGLin *, const VEC3 *, VEC3 *, f32 *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +f32 cM3d_SignedLenPlaAndPos(const cM3dGPla *, const VEC3 *) { + // TODO - returns 0.0f to satisfy warning + return 0.0f; +} + +void cM3d_CalcPla(const VEC3 *pVecA, const VEC3 *pVecB, const VEC3 *pVecC, VEC3 *pVecOut, f32 *pD) { + cM3d_Cross(pVecA, pVecB, pVecC, pVecOut); + f32 mag = VEC3Len(pVecOut); + if (fabsf(mag) > 0.05f) { + VEC3Scale(pVecOut, pVecOut, Math::inv(mag)); + f32 dot = VEC3Dot(pVecOut, pVecA); + *pD = -dot; + } else { + pVecOut->y = 0.0f; + *pD = 0.0f; + pVecOut->z = 0.0f; + pVecOut->x = 0.0f; + } +} +int cM3d_Check_LinLin(const cM3dGLin *, const cM3dGLin *, f32 *, f32 *) { + // TODO - returns false to satisfy warning + return 0; +} +bool cM3d_Cross_LinPla(const cM3dGLin *, const cM3dGPla *, VEC3 *, bool, bool) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_MinMaxBoxLine(const VEC3 *, const VEC3 *, const VEC3 *, const VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_InclusionCheckPosIn3PosBox3d(const VEC3 *, const VEC3 *, const VEC3 *, const VEC3 *, f32) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossX_Tri(const cM3dGTri *, const VEC3 *, f32) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossX_Tri(const cM3dGTri *, const VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossY_Tri(const cM3dGTri *, const VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossY_Tri_Front(const VEC3 &, const VEC3 &, const VEC3 &, const VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossY_Tri(const cM3dGTri *, const VEC3 *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossY_Tri(const cM3dGTri *, const VEC3 *, f32) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossY_Tri(const cM3dGTri *, const VEC3 *, const cM3d_Range *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossZ_Tri(const cM3dGTri *, const VEC3 *, f32) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossZ_Tri(const cM3dGTri *, const VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_CrossZ_Tri(const cM3dGTri *, const VEC3 *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_LinTri(const cM3dGLin *, const cM3dGTri *, VEC3 *, bool, bool) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_LinTri( + const cM3dGLin *, const VEC3 *, const VEC3 *, const VEC3 *, const cM3dGPla *, VEC3 *, bool, bool +) { + // TODO - returns false to satisfy warning + return false; +} + +bool cM3d_Cross_LinTri_Easy(const cM3dGTri *pTri, const VEC3 *pPos) { + if ((cM3d_IsZero(pTri->mNormal.x) || cM3d_CrossX_Tri(pTri, pPos)) && + (cM3d_IsZero(pTri->mNormal.y) || cM3d_CrossY_Tri(pTri, pPos)) && + (cM3d_IsZero(pTri->mNormal.z) || cM3d_CrossZ_Tri(pTri, pPos))) { + return true; + } + return false; +} + +bool cM3d_Cross_SphPnt(const cM3dGSph *pSph, const VEC3 *pPos) { + f32 r2 = pSph->GetR(); + return VEC3DistSq(pSph->GetC(), pPos) < r2 * r2; +} + +bool cM3d_Cross_LinSph(const cM3dGLin *, const cM3dGSph *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_LinSph_CrossPos(const cM3dGSph &, const cM3dGLin &, VEC3 *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CylSph(const cM3dGCyl *, const cM3dGSph *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CylSph(const cM3dGCyl *, const cM3dGSph *, VEC3 *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_SphSph(const cM3dGSph *, const cM3dGSph *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_SphSph(const cM3dGSph *, const cM3dGSph *, f32 *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_SphSph(const cM3dGSph *, const cM3dGSph *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} + +void cM3d_CalcSphVsTriCrossPoint(const cM3dGSph *pSph, const cM3dGTri *pTri, VEC3 *pPnt) { + VEC3 scale, add; + PSVECAdd(pTri->mA, pTri->mB, add); + PSVECScale(add, scale, 0.5f); + f32 mag = VEC3DistSq(&scale, &pSph->GetC()); + if (cM3d_IsZero(mag)) { + *pPnt = pSph->GetC(); + return; + } + f32 a = pSph->GetR() / mag; + cM3d_InDivPos2(&pSph->GetC(), &scale, a, pPnt); +} +bool cM3d_Cross_SphTri(const cM3dGSph *, const cM3dGTri *, VEC3 *, f32 *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CylCyl(const cM3dGCyl *, const cM3dGCyl *, f32 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CylCyl(const cM3dGCyl *, const cM3dGCyl *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CylTri(const cM3dGCyl *, const cM3dGTri *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +int cM3d_Cross_CylLin(const cM3dGCyl *, const cM3dGLin *, VEC3 *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +int cM3d_Cross_CylPntPnt(const cM3dGCyl *, const VEC3 *, const VEC3 *, VEC3 *, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CylPnt(const cM3dGCyl *, const VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CpsSph_CrossPos(const cM3dGCps &, const cM3dGSph &, const VEC3 &, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CpsSph(const cM3dGCps &, const cM3dGSph &, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_TriTri(const cM3dGTri &, const cM3dGTri &, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_Cross_CpsTri(const cM3dGCps &, cM3dGTri, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +void cM3d_CalcVecZAngle(const VEC3 &, mAng3_c *) {} +void cM3d_PlaneCrossLineProcWork(f32, f32, f32, f32, f32, f32, f32, f32 *, f32 *) {} +int cM3d_2PlaneCrossLine(const cM3dGPla &, const cM3dGPla &, cM3dGLin *) { + // TODO - returns false to satisfy warning + return false; +} +bool cM3d_3PlaneCrossPos(const cM3dGPla &, const cM3dGPla &, const cM3dGPla &, VEC3 *) { + // TODO - returns false to satisfy warning + return false; +} +f32 cM3d_lineVsPosSuisenCross(const cM3dGLin *, const VEC3 *, VEC3 *) { + // TODO - returns 0.0f to satisfy warning + return 0.0f; +} +f32 cM3d_lineVsPosSuisenCross(const VEC3 &, const VEC3 &, const VEC3 &, VEC3 *) { + // TODO - returns 0.0f to satisfy warning + return 0.0f; +} diff --git a/src/d/col/c/c_m3d_g_aab.cpp b/src/d/col/c/c_m3d_g_aab.cpp new file mode 100644 index 00000000..37b797cf --- /dev/null +++ b/src/d/col/c/c_m3d_g_aab.cpp @@ -0,0 +1,122 @@ +#include "d/col/c/c_m3d_g_aab.h" + +#include "rvl/MTX.h" + +void cM3dGAab::SetMin(const mVec3_c &min) { + if (mMin.x > min.x) { + mMin.x = min.x; + } + if (mMin.y > min.y) { + mMin.y = min.y; + } + if (mMin.z > min.z) { + mMin.z = min.z; + } +} + +void cM3dGAab::SetMax(const mVec3_c &max) { + if (mMax.x < max.x) { + mMax.x = max.x; + } + if (mMax.y < max.y) { + mMax.y = max.y; + } + if (mMax.z < max.z) { + mMax.z = max.z; + } +} + +void cM3dGAab::CalcCenter(mVec3_c ¢er) const { + PSVECAdd(mMin, mMax, center); + PSVECScale(center, center, 0.5f); +} + +void cM3dGAab::PlusR(f32 r) { + mMin -= r; + mMax += r; +} + +void cM3dGAab::Clamp(const mVec3_c &in, mVec3_c &out) const { + f32 x = in.x; + if (x < mMin.x) { + x = mMin.x; + } + if (x > mMax.x) { + x = mMax.x; + } + out.x = x; + + f32 y = in.y; + if (y < mMin.y) { + y = mMin.y; + } + if (y > mMax.y) { + y = mMax.y; + } + out.y = y; + + f32 z = in.z; + if (z < mMin.z) { + z = mMin.z; + } + if (z > mMax.z) { + z = mMax.z; + } + out.z = z; +} + +void cM3dGAab::Set(const cM3dGSph &sph) { + mVec3_c min, max; + min = max = sph.GetC(); + + f32 r = sph.GetR(); + + f32 ratio = sph.mRatio; + if (ratio < 1.0f) { + ratio = 1.0f; + } + f32 h = r * ratio; + + min.x -= r; + min.y -= h; + min.z -= r; + + max.x += r; + max.y += h; + max.z += r; + + Set(min, max); +} + +bool cM3dGAab::Cross(const mVec3_c &pos) const { + if ((mMin.x < pos.x && pos.x < mMax.x) && (mMin.y < pos.y && pos.y < mMax.y) && + (mMin.z < pos.z && pos.z < mMax.z)) { + return true; + } + return false; +} + +void cM3dGAab::SetBounds(const mVec3_c &pntA, const mVec3_c &pntB) { + if (pntA.x < pntB.x) { + mMin.x = pntA.x; + mMax.x = pntB.x; + } else { + mMin.x = pntB.x; + mMax.x = pntA.x; + } + if (pntA.y < pntB.y) { + mMin.y = pntA.y; + mMax.y = pntB.y; + } else { + mMin.y = pntB.y; + mMax.y = pntA.y; + } + if (pntA.z < pntB.z) { + mMin.z = pntA.z; + mMax.z = pntB.z; + } else { + mMin.z = pntB.z; + mMax.z = pntA.z; + } + PlusR(1.0f); +} diff --git a/src/d/col/c/c_m3d_g_cir.cpp b/src/d/col/c/c_m3d_g_cir.cpp new file mode 100644 index 00000000..83481d11 --- /dev/null +++ b/src/d/col/c/c_m3d_g_cir.cpp @@ -0,0 +1,7 @@ +#include "d/col/c/c_m3d_g_cir.h" + +/** + * File Not Used + * + * cM3dGCir vtable could be from here or in c_m3d + */ diff --git a/src/d/col/c/c_m3d_g_cps.cpp b/src/d/col/c/c_m3d_g_cps.cpp new file mode 100644 index 00000000..8d84457e --- /dev/null +++ b/src/d/col/c/c_m3d_g_cps.cpp @@ -0,0 +1,47 @@ +#include "d/col/c/c_m3d_g_cps.h" + +#include "d/col/c/c_m3d.h" +#include "nw4r/math.h" + +cM3dGCps::cM3dGCps() { + mField_0x1C = 0.0f; + mField_0x20 = 0; + mFlags = 0; +} + +void cM3dGCps::SetR(f32 r) { + if (r < 0.0f) { + r = 0.0f; + } + mRadius = r; + mField_0x1C = (double)r; // huh +} + +void cM3dGCps::Set_0x1C(f32 f) { + mField_0x1C = f; +} + +void cM3dGCps::Set(const mVec3_c &start, const mVec3_c &end, f32 r) { + cM3dGLin::Set(start, end); + SetR(r); +} + +bool cM3dGCps::fn_80337f30(cM3dGUnk *unk, mVec3_c *vec) { + return fn_80336d90(this, unk, vec); +} + +bool cM3dGCps::fn_80337f40(const mVec3_c &v) const { + f32 r2 = mRadius * mRadius; + if (!(mFlags & 1) && PSVECSquareDistance(mStart, v) <= r2) { + return true; + } + if (!(mFlags & 2) && PSVECSquareDistance(mEnd, v) <= r2) { + return true; + } + f32 tmp; + mVec3_c tmpv; + if (cM3d_Len3dSqPntAndSegLine(this, v, tmpv, &tmp, nullptr) && tmp <= r2) { + return true; + } + return false; +} diff --git a/src/d/col/c/c_m3d_g_cyl.cpp b/src/d/col/c/c_m3d_g_cyl.cpp new file mode 100644 index 00000000..6a4bfdf6 --- /dev/null +++ b/src/d/col/c/c_m3d_g_cyl.cpp @@ -0,0 +1,86 @@ +#include "d/col/c/c_m3d_g_cyl.h" + +#include "d/col/c/c_m3d.h" +#include "m/m_vec.h" + +void cM3dGCyl::SetC(const mVec3_c &c, f32 radius, f32 height) { + SetC(c); + SetR(radius); + SetH(height); +} + +void cM3dGCyl::SetC(const mVec3_c &c) { + mCenter = c; +} + +void cM3dGCyl::SetH(f32 h) { + if (h < 0.0f) { + h = 0.0f; + } + mHeight = h; +} + +void cM3dGCyl::SetR(f32 r) { + if (r < 0.0f) { + r = 0.0f; + } + mRadius = r; +} + +bool cM3dGCyl::fn_803380e0(cM3dGUnk *unk, mVec3_c *vec) { + return fn_80336110(this, unk, vec); +} + +bool cM3dGCyl::fn_803380f0(cM3dGUnk *unk, f32 *vec) { + return fn_803364e0(this, unk, vec); +} + +bool cM3dGCyl::Cross(const mVec3_c &pnt) const { + if ((mCenter.y > pnt.y) || (mCenter.y + mHeight < pnt.y)) { + return false; + } + f32 x_dist = mCenter.x - pnt.x; + f32 z_dist = mCenter.z - pnt.z; + return x_dist * x_dist + z_dist * z_dist > mRadius * mRadius ? false : true; +} + +void cM3dGCyl::Clamp(const mVec3_c &in, mVec3_c &out) const { + f32 floor = mCenter.y; + mVec3_c diff = in - mCenter; + f32 ceil = floor + mHeight; + f32 dist_sq = diff.x * diff.x + diff.z * diff.z; + f32 dist = EGG::Math::sqrt(dist_sq); + + if (ceil < in.y) { + if (dist < mRadius) { + out.x = in.x; + out.y = ceil; + out.z = in.z; + } else { + f32 scale = mRadius / dist; + out.x = mCenter.x + scale * (in.x - mCenter.x); + out.y = ceil; + out.z = mCenter.z + scale * (in.z - mCenter.z); + } + } else if (floor > in.y) { + if (dist < mRadius) { + out.x = in.x; + out.y = floor; + out.z = in.z; + } else { + f32 scale = mRadius / dist; + out.y = floor; + out.x = mCenter.x + scale * (in.x - mCenter.x); + out.z = mCenter.z + scale * (in.z - mCenter.z); + } + } else { + if (dist < mRadius) { + out = in; + } else { + f32 scale = mRadius / dist; + out.y = in.y; + out.x = mCenter.x + scale * (in.x - mCenter.x); + out.z = mCenter.z + scale * (in.z - mCenter.z); + } + } +} diff --git a/src/d/col/c/c_m3d_g_lin.cpp b/src/d/col/c/c_m3d_g_lin.cpp new file mode 100644 index 00000000..e602ba11 --- /dev/null +++ b/src/d/col/c/c_m3d_g_lin.cpp @@ -0,0 +1,22 @@ +#include "d/col/c/c_m3d_g_lin.h" + +void cM3dGLin::SetStartEnd(const VEC3 &start, const VEC3 &end) { + mStart = start; + mEnd = end; +} + +void cM3dGLin::SetStartEnd(const mVec3_c *start, const mVec3_c *end) { + SetStartEnd(*start, *end); +} + +void cM3dGLin::CalcPos(mVec3_c *out, f32 scale) const { + mVec3_c tmp; + PSVECSubtract(mEnd, mStart, tmp); + PSVECScale(tmp, tmp, scale); + PSVECAdd(tmp, mStart, *out); +} + +void cM3dGLin::SetStart(const mVec3_c &start) { + // This just feels weird + mStart = start; +} diff --git a/src/d/col/c/c_m3d_g_pla.cpp b/src/d/col/c/c_m3d_g_pla.cpp new file mode 100644 index 00000000..0773ca4a --- /dev/null +++ b/src/d/col/c/c_m3d_g_pla.cpp @@ -0,0 +1,39 @@ + +#include "d/col/c/c_m3d_g_pla.h" + +#include "d/col/c/c_m3d.h" + +bool cM3dGPla::CrossInfLin(const mVec3_c &start, const mVec3_c &end, mVec3_c &out) const { + f32 tmp1 = getPlaneFunc(start); + f32 tmp2 = getPlaneFunc(end); + + if (cM3d_IsZero(tmp1 - tmp2)) { + out = end; + return false; + } + + f32 pF = tmp1 / (tmp1 - tmp2); + cM3d_InDivPos2(&start, &end, pF, &out); + return true; +} + +bool cM3dGPla::getCrossYLessD(const mVec3_c &point, f32 *out) const { + if (cM3d_IsZero(mNormal.y)) { + return false; + } else { + *out = (-mNormal.x * point.x - mNormal.z * point.z) / mNormal.y; + return true; + } +} + +mAng cM3dGPla::GetAngle(mAng ang) const { + mAng angleY = GetAngleY(); + // Regswap + angleY = angleY - ang; + f32 dist = GetXZDist() * angleY.cos(); + return cM::atan2s(dist, mNormal.y); +} + +mAng cM3dGPla::GetNegativeAngle(mAng ang) const { + return -GetAngle(ang); +} diff --git a/src/d/col/c/c_m3d_g_sph.cpp b/src/d/col/c/c_m3d_g_sph.cpp new file mode 100644 index 00000000..cc1d1c1d --- /dev/null +++ b/src/d/col/c/c_m3d_g_sph.cpp @@ -0,0 +1,63 @@ +#include "d/col/c/c_m3d_g_sph.h" + +#include "m/m_vec.h" + +cM3dGSph::cM3dGSph() { + mRatio = 1.0f; +} + +void cM3dGSph::SetC(const mVec3_c *c) { + mCenter = *c; +} + +void cM3dGSph::Set(const mVec3_c *c, f32 r) { + SetC(c); + SetR(r); +} + +void cM3dGSph::SetR(f32 r) { + if (r < 0.0f) { + r = 0.0f; + } + mRadius = r; +} + +void cM3dGSph::SetC(f32 x, f32 y, f32 z) { + mVec3_c c(x, y, z); + SetC(&c); +} + +bool cM3dGSph::fn_80338750(cM3dGUnk *pUnk, mVec3_c *pOut) { + return fn_80337690(pUnk, this, pOut); +} + +bool cM3dGSph::fn_80338760(cM3dGUnk *pUnk, f32 *pOut) { + return fn_80337780(pUnk, this, pOut); +} + +f32 cM3dGSph::GetYDist(f32 r) const { + f32 b = mRadius * mRadius - (r - mCenter.y) * (r - mCenter.y); + if (b < 0.0f) { + return 0.0f; + } + return nw4r::math::FSqrt(b); +} + +bool cM3dGSph::Cross(const cM3dGTri *pTri, f32 *p2, mVec3_c *p3) { + return cM3d_Cross_SphTri(this, pTri, nullptr, p2, p3); +} + +void cM3dGSph::Clamp(const mVec3_c &in, mVec3_c &out) const { + f32 dist = EGG::Math::sqrt(VEC3DistSq(mCenter, in)); + + if (dist < mRadius) { + out = in; + } else { + f32 a = mRadius / dist; + out = (in - mCenter) * a + mCenter; + } +} + +void cM3dGSph::SetRatio(f32 ratio) { + mRatio = ratio; +} diff --git a/src/d/col/c/c_m3d_g_tri.cpp b/src/d/col/c/c_m3d_g_tri.cpp new file mode 100644 index 00000000..e8d1b128 --- /dev/null +++ b/src/d/col/c/c_m3d_g_tri.cpp @@ -0,0 +1,10 @@ +#include "d/col/c/c_m3d_g_tri.h" + +using nw4r::math::VEC3; + +void cM3dGTri::SetPos(const VecType *vA, const VecType *vB, const VecType *vC) { + mA = *vA; + mB = *vB; + mC = *vC; + cM3d_CalcPla(&mA, &mB, &mC, &mNormal, &mD); +} diff --git a/src/d/col/c/c_m3d_g_unk.cpp b/src/d/col/c/c_m3d_g_unk.cpp new file mode 100644 index 00000000..c1e5fe04 --- /dev/null +++ b/src/d/col/c/c_m3d_g_unk.cpp @@ -0,0 +1,133 @@ +#include "d/col/c/c_m3d_g_unk.h" + +#include "d/col/c/c_m3d.h" +#include "d/col/c/c_m3d_g_aab.h" + +cM3dGUnk::cM3dGUnk() { + mMin.set(0.0f, 0.0f, 0.0f); + mMax.set(0.0f, 0.0f, 0.0f); + mField_0x78.set(0.0f, 0.0f, 0.0f); + mField_0x84.set(0.0f, 0.0f, 0.0f); + mField_0x90.set(0.0f, 0.0f, 0.0f); + mField_0x9C.set(0.0f, 0.0f, 0.0f); + mField_0xA8.set(0.0f, 0.0f, 0.0f); + mField_0xB4 = 0; + mVirtCenter.set(0.0f, 0.0f, 0.0f); + mField_0xC4 = 0.0f; + PSMTXIdentity(mMtx); + PSMTXIdentity(mInvMtx); +} + +void cM3dGUnk::Set(const mVec3_c &vA, const mVec3_c &vB) { + mMin = vA; + mMax = vB; + + mField_0x84 = (mMin + mMax) * 0.5f; + mField_0x90 = mMin - mField_0x84; + mField_0x9C = mMax - mField_0x84; + mField_0xA8 = (mMax - mMin) * 0.5f; + + Update(); +} + +void cM3dGUnk::Update() { + mVec3_c a, b; + PSMTXMultVec(mMtx, mMin, a); + PSMTXMultVec(mMtx, mMax, b); + mField_0x78.x = (a.x + b.x) * 0.5f; + mField_0x78.y = (a.y + b.y) * 0.5f; + mField_0x78.z = (a.z + b.z) * 0.5f; + if (!PSMTXInverse(mMtx, mInvMtx)) { + PSMTXIdentity(mInvMtx); + } +} + +void cM3dGUnk::GetStartEnd(mVec3_c &start, mVec3_c &end) { + start = mMin; + end = mMax; +} + +void cM3dGUnk::fn_80338c30(cM3dGCps *pCps, mVec3_c *pVec) { + fn_80336d90(pCps, this, pVec); +} + +bool cM3dGUnk::fn_80338c40(cM3dGUnk *pUnk, mVec3_c *pVec) { + nw4r::math::VEC3 tmp; + if (fn_803354e0(this, pUnk, &tmp)) { + *pVec = tmp; + return true; + } + return false; +} + +bool cM3dGUnk::fn_80338ca0() { + return false; +} + +bool cM3dGUnk::fn_80338cb0(cM3dGCyl *pCyl, mVec3_c *pVec) { + return fn_80336110(pCyl, this, pVec); +} + +bool cM3dGUnk::fn_80338cc0(cM3dGCyl *pCyl, f32 *pF) { + return fn_803364e0(pCyl, this, pF); +} + +bool cM3dGUnk::fn_80338cd0(cM3dGSph *pSph, mVec3_c *pVec) { + return fn_80337690(this, pSph, pVec); +} + +bool cM3dGUnk::fn_80338ce0(cM3dGSph *pSph, f32 *pF) { + return fn_80337780(this, pSph, pF); +} + +void cM3dGUnk::Set(const mMtx_c &mtx) { + mMtx.set(mtx); + Update(); +} + +void cM3dGUnk::Set(const mVec3_c &vec, const mAng &ang) { + mMtx_c mtx; + PSMTXIdentity(mtx); + mtx.YrotS(ang); + mtx.SetTranslation(vec); + Set(mtx); +} + +bool cM3dGUnk::Cross(const mVec3_c &vec) { + mVec3_c tmp; + PSMTXMultVec(mInvMtx, vec, tmp); + if ((tmp.x < mMin.x)) { + return false; + } + if (tmp.x > mMax.x) { + return false; + } + if (tmp.y < mMin.y) { + return false; + } + if (tmp.y > mMax.y) { + return false; + } + if (tmp.z < mMin.z) { + return false; + } + if (tmp.z > mMax.z) { + return false; + } + return true; +} + +void cM3dGUnk::Clamp(const mVec3_c &in, mVec3_c &out) { + mVec3_c tmp1, tmp2; + PSMTXMultVec(mInvMtx, in, tmp1); + cM3dGAab aab; + aab.Set(mMin, mMax); + aab.Clamp(tmp1, tmp2); + PSMTXMultVec(mMtx, tmp2, out); +} + +void cM3dGUnk::fn_80338f30(f32 f0, f32 f1) { + mMtx.xw += f0; + mMtx.zw += f1; + Update(); +} diff --git a/src/d/col/c/c_partition.cpp b/src/d/col/c/c_partition.cpp new file mode 100644 index 00000000..40621b14 --- /dev/null +++ b/src/d/col/c/c_partition.cpp @@ -0,0 +1,11 @@ +#include "d/col/c/c_partition.h" + +cPartition::cPartition() { + mX = 0; + mY = 0; + mZ = 0; +} + +cPartition::~cPartition() {} + +// TODO diff --git a/src/toBeSorted/cc/d_cc_d.cpp b/src/d/col/cc/d_cc_d.cpp similarity index 88% rename from src/toBeSorted/cc/d_cc_d.cpp rename to src/d/col/cc/d_cc_d.cpp index 5a894ad0..146b3121 100644 --- a/src/toBeSorted/cc/d_cc_d.cpp +++ b/src/d/col/cc/d_cc_d.cpp @@ -1,7 +1,7 @@ #include +#include #include #include -#include inline bool cM3d_IsZero(f32 f); @@ -26,7 +26,7 @@ void d_cc_d_float_order() { } // Very certain -void dCcD_DivideArea::SetArea(Aabb const &aab) { +void dCcD_DivideArea::SetArea(cM3dGAab const &aab) { Set(aab.mMin, aab.mMax); mScaledXDiff = 1.0f / 32.0f * (mMax.x - mMin.x); @@ -53,38 +53,10 @@ inline bool cM3d_IsZero(f32 f) { } static u32 const l_base[32] = { - 0x00000001, - 0x00000003, - 0x00000007, - 0x0000000F, - 0x0000001F, - 0x0000003F, - 0x0000007F, - 0x000000FF, - 0x000001FF, - 0x000003FF, - 0x000007FF, - 0x00000FFF, - 0x00001FFF, - 0x00003FFF, - 0x00007FFF, - 0x0000FFFF, - 0x0001FFFF, - 0x0003FFFF, - 0x0007FFFF, - 0x000FFFFF, - 0x001FFFFF, - 0x003FFFFF, - 0x007FFFFF, - 0x00FFFFFF, - 0x01FFFFFF, - 0x03FFFFFF, - 0x07FFFFFF, - 0x0FFFFFFF, - 0x1FFFFFFF, - 0x3FFFFFFF, - 0x7FFFFFFF, - 0xFFFFFFFF, + 0x00000001, 0x00000003, 0x00000007, 0x0000000F, 0x0000001F, 0x0000003F, 0x0000007F, 0x000000FF, + 0x000001FF, 0x000003FF, 0x000007FF, 0x00000FFF, 0x00001FFF, 0x00003FFF, 0x00007FFF, 0x0000FFFF, + 0x0001FFFF, 0x0003FFFF, 0x0007FFFF, 0x000FFFFF, 0x001FFFFF, 0x003FFFFF, 0x007FFFFF, 0x00FFFFFF, + 0x01FFFFFF, 0x03FFFFFF, 0x07FFFFFF, 0x0FFFFFFF, 0x1FFFFFFF, 0x3FFFFFFF, 0x7FFFFFFF, 0xFFFFFFFF, }; // TODO @@ -271,11 +243,11 @@ dCcD_ShapeAttr5::dCcD_ShapeAttr5() {} dCcD_ShapeAttr5::~dCcD_ShapeAttr5() {} void dCcD_ShapeAttr5::init(const dCcD_SrcAabbAttr &src) { - setMinMax(mVec3_c(src.minX, src.minY, src.minZ), mVec3_c(src.maxX, src.maxY, src.maxZ)); + Set(mVec3_c(src.minX, src.minY, src.minZ), mVec3_c(src.maxX, src.maxY, src.maxZ)); } mVec3_c *dCcD_ShapeAttr5::getVirtualCenter() { - return &mVirtualCenter; + return &mVirtCenter; } dCcD_ShapeAttr1::dCcD_ShapeAttr1() {} @@ -290,13 +262,13 @@ dCcD_ShapeAttr3::dCcD_ShapeAttr3() {} dCcD_ShapeAttr3::~dCcD_ShapeAttr3() {} void dCcD_ShapeAttr3::init(const dCcD_SrcCylAttr &src) { - setR(src.mRadius); - setH(src.mHeight); + SetR(src.mRadius); + SetH(src.mHeight); mVec3_c v; v.z = 0.0f; v.y = 0.0f; v.x = 0.0f; - setC(v); + SetC(v); } mVec3_c *dCcD_ShapeAttr3::getVirtualCenter() { @@ -307,12 +279,12 @@ dCcD_ShapeAttr4::dCcD_ShapeAttr4() {} dCcD_ShapeAttr4::~dCcD_ShapeAttr4() {} void dCcD_ShapeAttr4::init(const dCcD_SrcSphAttr &src) { - setR(src.mRadius); + SetR(src.mRadius); mVec3_c v; v.z = 0.0f; v.y = 0.0f; v.x = 0.0f; - setC(v); + SetC(v); } mVec3_c *dCcD_ShapeAttr4::getVirtualCenter() { diff --git a/src/toBeSorted/cc/d_cc_shape_colliders.cpp b/src/d/col/cc/d_cc_shape_colliders.cpp similarity index 90% rename from src/toBeSorted/cc/d_cc_shape_colliders.cpp rename to src/d/col/cc/d_cc_shape_colliders.cpp index 3d9ddfe5..1c85dd3c 100644 --- a/src/toBeSorted/cc/d_cc_shape_colliders.cpp +++ b/src/d/col/cc/d_cc_shape_colliders.cpp @@ -1,6 +1,6 @@ +#include +#include #include -#include -#include dCcD_Unk1::dCcD_Unk1() {} dCcD_Unk1::~dCcD_Unk1() {} @@ -18,7 +18,7 @@ void *dCcD_Unk1::dCcD_GObjInf_0x0C() { } void dCcD_Unk1::unknownCalc() { - PSVECSubtract(*&field_0x0C, *&field_0x00, *getAtVec()); + PSVECSubtract(mCps.mEnd, mCps.mStart, *getAtVec()); } dCcD_Empty::dCcD_Empty() {} @@ -52,12 +52,12 @@ void *dCcD_Cyl::dCcD_GObjInf_0x0C() { void dCcD_Cyl::setCenter(const mVec3_c &c) { setAtVec(mVec3_c::Zero); - setC(c); + SetC(c); } void dCcD_Cyl::moveCenter(const mVec3_c &c) { setAtVec(c - GetC()); - setC(c); + SetC(c); } dCcD_Sph::dCcD_Sph() {} @@ -70,17 +70,17 @@ void dCcD_Sph::init(const dCcD_SrcSph &src) { void dCcD_Sph::setCenter(const mVec3_c &c) { setAtVec(mVec3_c::Zero); - setC(c); + SetC(&c); } void dCcD_Sph::moveCenter(const mVec3_c &c) { setAtVec(c - GetC()); - setC(c); + SetC(&c); } void dCcD_Sph::setCenterAndAtVec(const mVec3_c &a, const mVec3_c &b) { setAtVec(b); - setC(a); + SetC(&a); } void *dCcD_Sph::dCcD_GObjInf_0x0C() { diff --git a/src/d/lyt/d_structd.cpp b/src/d/lyt/d_structd.cpp index 30f46873..d4b5f2e7 100644 --- a/src/d/lyt/d_structd.cpp +++ b/src/d/lyt/d_structd.cpp @@ -1,19 +1,16 @@ #include -namespace d2d -{ - +namespace d2d { + dLytStructDList::dLytStructDList() { field_0x18 = true; sInstance = this; } - dLytStructDList *dLytStructDList::create(EGG::Heap *heap) { - return new(heap) dLytStructDList(); + return new (heap) dLytStructDList(); } - void dLytStructDList::appendToList1(dLytStructD *other) { mList1.insert(other); } diff --git a/src/toBeSorted/arc_callback_handler.cpp b/src/toBeSorted/arc_callback_handler.cpp index 0bfd7f96..9b79d21c 100644 --- a/src/toBeSorted/arc_callback_handler.cpp +++ b/src/toBeSorted/arc_callback_handler.cpp @@ -1,23 +1,24 @@ +#include +#include #include #include #include -#include -#include #include -#include #include +#include +#include +#include ArcCallbackHandler ArcCallbackHandler::sInstance; -#define NAME_DZB 'dzb ' -#define NAME_G3D 'g3d ' -#define NAME_KCL 'kcl ' +#define NAME_DZB 'dzb ' +#define NAME_G3D 'g3d ' +#define NAME_KCL 'kcl ' #define NAME_OARC 'oarc' #define NAME_RARC 'rarc' extern "C" void FUN_804a7260(nw4r::g3d::ResMdl, const char *prefix); - void BindSystemModelsAndLighting(nw4r::g3d::ResFile file) { nw4r::g3d::ResFile sysFile = OarcManager::sInstance->getMdlFromArc2("System"); if (sysFile.mFile.IsValid()) { @@ -48,9 +49,6 @@ void BindSystemModelsAndLighting(nw4r::g3d::ResFile file) { } } -extern "C" void fn_8033A140(void *data); -extern "C" void dBgWKCol__initKCollision(void *dat); - void ArcCallbackHandlerBase::CreateArcEntry(void *data, const char *path) { if (mPrefix == NAME_G3D) { nw4r::g3d::ResFile file = data; @@ -58,9 +56,9 @@ void ArcCallbackHandlerBase::CreateArcEntry(void *data, const char *path) { file.Bind(); BindSystemModelsAndLighting(file); } else if (mPrefix == NAME_KCL) { - dBgWKCol__initKCollision(data); + dBgWKCol::initKCollision(data); } else if (mPrefix == NAME_DZB) { - fn_8033A140(data); + cBgS::ConvDzb(data); } else if (mPrefix == NAME_OARC) { SizedString<64> oarcPath = path; char buf[64]; diff --git a/src/toBeSorted/cc/d_cc_m3d.cpp b/src/toBeSorted/cc/d_cc_m3d.cpp deleted file mode 100644 index 1f2ab896..00000000 --- a/src/toBeSorted/cc/d_cc_m3d.cpp +++ /dev/null @@ -1,33 +0,0 @@ -#include -#include -#include - - -using namespace nw4r::math; - -inline VEC3 cM3d_Cross(const VEC3 *pVecA, const VEC3 *pVecB, const VEC3 *pVecC, VEC3 *pVecOut) { - VEC3 tmp1; - VEC3 tmp2; - VEC3Sub(&tmp1, pVecB, pVecA); - VEC3Sub(&tmp2, pVecC, pVecA); - - VEC3Cross(pVecOut, &tmp1, &tmp2); -} - -inline f32 cM3d_Dot(const VEC3 *pVecA, const VEC3 *pVecB) { - return VEC3Dot(pVecA, pVecB); -} - -void cM3d_CalcPla(const VEC3 *pVecA, const VEC3 *pVecB, const VEC3 *pVecC, VEC3 *pVecOut, f32 *pD) { - cM3d_Cross(pVecA, pVecB, pVecC, pVecOut); - f32 mag = VEC3Len(pVecOut); - if (fabsf(mag) > 0.05f) { - VEC3Scale(pVecOut, pVecOut, 1.0f / mag); - *pD = -cM3d_Dot(pVecOut, pVecA); - } else { - pVecOut->y = 0.0f; - *pD = 0.0f; - pVecOut->z = 0.0f; - pVecOut->x = 0.0f; - } -} diff --git a/src/toBeSorted/cc/d_cc_m3d_g_cyl.cpp b/src/toBeSorted/cc/d_cc_m3d_g_cyl.cpp deleted file mode 100644 index f166c335..00000000 --- a/src/toBeSorted/cc/d_cc_m3d_g_cyl.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -void cM3dGCyl::setC(const mVec3_c &c, f32 radius, f32 height) { - setC(c); - setR(radius); - setH(height); -} - -void cM3dGCyl::setC(const mVec3_c &c) { - mCenter = c; -} - -void cM3dGCyl::setH(f32 h) { - if (h < 0.0f) { - h = 0.0f; - } - mHeight = h; -} - -void cM3dGCyl::setR(f32 r) { - if (r < 0.0f) { - r = 0.0f; - } - mRadius = r; -} diff --git a/src/toBeSorted/cc/d_cc_m3d_g_sph.cpp b/src/toBeSorted/cc/d_cc_m3d_g_sph.cpp deleted file mode 100644 index b4f12a06..00000000 --- a/src/toBeSorted/cc/d_cc_m3d_g_sph.cpp +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include - -cM3dGSph::cM3dGSph() { - field_0x10 = 1.0f; -} - -void cM3dGSph::setC(const mVec3_c &c) { - mCenter = c; -} - -void cM3dGSph::set(const mVec3_c &c, f32 r) { - setC(c); - setR(r); -} - -void cM3dGSph::setR(f32 r) { - if (r < 0.0f) { - r = 0.0f; - } - mRadius = r; -} - -void cM3dGSph::setC(f32 x, f32 y, f32 z) { - setC(mVec3_c(x, y, z)); -} diff --git a/src/toBeSorted/dowsing_target.cpp b/src/toBeSorted/dowsing_target.cpp index 84eea947..277a5883 100644 --- a/src/toBeSorted/dowsing_target.cpp +++ b/src/toBeSorted/dowsing_target.cpp @@ -5,19 +5,12 @@ #include #include -typedef TList DowsingList; +typedef TList DowsingList; DowsingList DOWSING_LISTS[8]; static const int DOWSING_TARGET_STORY_FLAGS[8] = { - 100, - 105, - 100, - 104, - 108, - 110, - 109, - 102, + 100, 105, 100, 104, 108, 110, 109, 102, }; DowsingTarget::~DowsingTarget() { @@ -56,7 +49,7 @@ void DowsingTarget::getPosition(mVec3_c &position) { mMtx_c mtx2; PSMTXTrans(mtx.m, mpActor->position.x, mpActor->position.y, mpActor->position.z); mtx.YrotM(mpActor->rotation.y); - PSMTXScale(mtx2.m, mpActor->scale.x, mpActor->scale.y, mpActor->scale.z); + PSMTXScale(mtx2.m, mpActor->mScale.x, mpActor->mScale.y, mpActor->mScale.z); PSMTXConcat(mtx.m, mtx2.m, mtx.m); PSMTXMultVec(mtx.m, mOffset, position); } @@ -80,9 +73,9 @@ bool DowsingTarget::hasDesertNodeDowsing() { bool DowsingTarget::hasAnyTrialDowsing() { // TODO more complicated code return ItemFlagManager::sInstance->getFlag(187) && !StoryFlagManager::sInstance->getCounterOrFlag(93) || - ItemFlagManager::sInstance->getFlag(188) && !StoryFlagManager::sInstance->getCounterOrFlag(97) || - ItemFlagManager::sInstance->getFlag(189) && !StoryFlagManager::sInstance->getCounterOrFlag(98) || - ItemFlagManager::sInstance->getFlag(193) && !StoryFlagManager::sInstance->getCounterOrFlag(99); + ItemFlagManager::sInstance->getFlag(188) && !StoryFlagManager::sInstance->getCounterOrFlag(97) || + ItemFlagManager::sInstance->getFlag(189) && !StoryFlagManager::sInstance->getCounterOrFlag(98) || + ItemFlagManager::sInstance->getFlag(193) && !StoryFlagManager::sInstance->getCounterOrFlag(99); } bool DowsingTarget::hasSacredWaterDowsing() { @@ -132,10 +125,10 @@ bool DowsingTarget::hasDowsingInSlot(int slot) { if (slot == 0) { return hasZeldaDowsing() || hasAnyTrialDowsing() || hasSacredWaterDowsing() || hasSandshipDowsing() || - hasTadtoneDowsing() || hasPropellerDowsing() || hasWaterBasinDowsing(); + hasTadtoneDowsing() || hasPropellerDowsing() || hasWaterBasinDowsing(); } else if (slot == 2) { return hasCrystalBallDowsing() || hasPumpkinDowsing() || hasNewPlantSpeciesDowsing() || hasKikwiDowsing() || - hasKeyPieceDowsing() || hasDesertNodeDowsing() || hasPartyWheelDowsing(); + hasKeyPieceDowsing() || hasDesertNodeDowsing() || hasPartyWheelDowsing(); } else if (StoryFlagManager::sInstance->getCounterOrFlag(DOWSING_TARGET_STORY_FLAGS[slot])) { // TODO small instruction shuffle return true; @@ -146,8 +139,9 @@ bool DowsingTarget::hasDowsingInSlot(int slot) { #define MYCLAMP(low, high, x) ((x) < (low) ? (low) : ((x) > (high) ? (high) : (x))) -DowsingTarget *DowsingTarget::getDowsingInfo(const mVec3_c &playerPosition, const mVec3_c &dowsingDirection, f32 *p3, - f32 *p4, f32 *intensity, int slot) { +DowsingTarget *DowsingTarget::getDowsingInfo( + const mVec3_c &playerPosition, const mVec3_c &dowsingDirection, f32 *p3, f32 *p4, f32 *intensity, int slot +) { if (slot >= 8) { return nullptr; } @@ -199,9 +193,9 @@ void DowsingTarget::init() {} void DowsingTarget::execute() {} // Not sure what this is -inline static TListNode *getNode(u8 slot, DowsingTarget *t) { +inline static TListNode *getNode(u8 slot, DowsingTarget *t) { if (t->mLink.mpNext == nullptr || t->mLink.mpPrev == nullptr) { - return &DOWSING_LISTS[slot].mNode; + return &DOWSING_LISTS[slot].mStartEnd; } else { return &t->mLink; } @@ -213,7 +207,7 @@ static bool insertDowsingTarget(DowsingTarget *target) { return false; } - if (getNode(slot, target) != &DOWSING_LISTS[slot].mNode) { + if (getNode(slot, target) != &DOWSING_LISTS[slot].mStartEnd) { return false; } DOWSING_LISTS[slot].insert(target); @@ -226,7 +220,7 @@ static bool removeDowsingTarget(DowsingTarget *target) { return false; } - if (getNode(slot, target) != &DOWSING_LISTS[slot].mNode) { + if (getNode(slot, target) != &DOWSING_LISTS[slot].mStartEnd) { DOWSING_LISTS[slot].remove(target); return true; } diff --git a/tools/custom/rel_sieve.py b/tools/custom/rel_sieve.py index db094b56..009bd769 100644 --- a/tools/custom/rel_sieve.py +++ b/tools/custom/rel_sieve.py @@ -30,7 +30,6 @@ BLOCKING_SYMBOLS = [ ['fn_800C3EC0', 'ActorEventFlowManagerRelated::checkEventFinished'], ['fn_800275C0', 'EffectsStruct::ctor'], ['fn_80027610', 'EffectsStruct::ctor'], - ['fn_80341A70', 'checkCollision'], ['fn_80016C10', 'AnimModelWrapper::ctor'], ['fn_802E32B0', 'm2d::FrameCtrl_c::setFrame'], ['fn_802F04A0', 'mFader_c::draw'], @@ -45,9 +44,6 @@ BLOCKING_SYMBOLS = [ ['fn_801BB6F0', 'getCamera'], ['fn_800225F0', 'something light'], ['fn_80179250', 'shutter fence list'], - ['fn_8033AB50', 'getCollisionCheckContext'], - ['fn_8033F150', 'fn_8033F150'], - ['fn_80341040', 'fn_80341040'], ['fn_383_D10', 'getAcOStageSink_ptr'], ]