Skip to content

Commit

Permalink
Slice KCol
Browse files Browse the repository at this point in the history
  • Loading branch information
em-eight authored and riidefi committed Nov 25, 2023
1 parent 0445202 commit 0807f87
Show file tree
Hide file tree
Showing 11 changed files with 606 additions and 5 deletions.
4 changes: 3 additions & 1 deletion mkwutil/sections.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def __contains__(self, key) -> bool:
Slice(name="DOL/DWC", start=0x800CC7E4, stop=0x800EF378, section="text"),
Slice(name="DOL/SPY", start=0x800EF378, stop=0x80123F88, section="text"),
Slice(name="DOL/RVL", start=0x80123F88, stop=0x8020F62C, section="text"),
#Slice(name="DOL/HBM", start=0x80173E08, stop=0x80192F7C, section="text"), # part of RVL
Slice(name="DOL/EGG", start=0x8020F62C, stop=0x80244DD4, section="text"),
]

Expand Down Expand Up @@ -78,7 +79,8 @@ def __contains__(self, key) -> bool:
Slice(name="REL/SND", start=0x806F62FC, stop=0x8071B808, section="text"),
Slice(name="REL/AI", start=0x80725FDC, stop=0x8074BB34, section="text"),
Slice(name="REL/GEO/2", start=0x807519C8, stop=0x8077EE80, section="text"),
Slice(name="REL/ITEM", start=0x8079754C, stop=0x807BD1D0, section="text"),
Slice(name="REL/ITEM", start=0x8079754C, stop=0x807BD96C, section="text"),
Slice(name="REL/FIELD", start=0x807BD96C, stop=0x807DC8C8, section="text"),
Slice(name="REL/UI/CTRL", start=0x807E093C, stop=0x807F9278, section="text"),
Slice(name="REL/GEO/3", start=0x807F9278, stop=0x8081A690, section="text"),
Slice(name="REL/GEO", start=0x8081A690, stop=0x8082F3C8, section="text"),
Expand Down
7 changes: 5 additions & 2 deletions pack/rel_objects.txt
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,10 @@ out/ObjTaimatsu.o
out/rel/text_806deb40_80786e60.o
out/BoxColManager.o
out/BoxColUnit.o
out/rel/text_80786f98_8088f400.o
out/rel/rodata_808a4804_808b2bd0.o
out/rel/text_80786f98_807bdc5c.o
out/rel/rodata_808a4804_808a66d8.o
out/KCollisionOctree.o
out/rel/text_807c25cc_8088f400.o
out/rel/rodata_808a66fc_808b2bd0.o
out/rel/data_808bcfd0_808dd3d4.o
out/rel/bss_809c1996_809c4f90.o
4 changes: 4 additions & 0 deletions pack/rel_slices.yml
Original file line number Diff line number Diff line change
Expand Up @@ -190,3 +190,7 @@ source/game/geo/BoxColManager.cpp:
source/game/geo/BoxColUnit.cpp:
text: [0x80786ed0, 0x80786f98]
rodata: [0x808a4800, 0x808a4804]

source/game/field/KCollisionOctree.cpp:
text: [0x807bdc5c, 0x807c25cc]
rodata: [0x808a66d8, 0x808a66fc]
4 changes: 2 additions & 2 deletions pack/symbols.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28767,8 +28767,8 @@ global:
0x807bdd7c: 'unk_807bdd7c'
0x807bddbc: 'unk_807bddbc'
0x807bddfc: 'unk_807bddfc'
0x807bdf54: 'unk_807bdf54'
0x807be030: 'kcl_find_tri_list'
0x807bdf54: 'getVertex__Q25Field16KCollisionOctreeFfRCQ23EGG8Vector3fRCQ23EGG8Vector3fRCQ23EGG8Vector3fRCQ23EGG8Vector3f'
0x807be030: 'searchBlock__Q25Field16KCollisionOctreeFRCQ23EGG8Vector3f'
0x807be12c: 'unk_807be12c'
0x807be3c4: 'unk_807be3c4'
0x807bf4c0: 'unk_807bf4c0'
Expand Down
36 changes: 36 additions & 0 deletions source/game/field/KCollision.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@

#pragma once

#include "rk_types.h"

#include "egg/math/eggVector.hpp"

namespace Field {
struct KCollisionHeader {
u32 pos_data_offset;
u32 nrm_data_offset;
u32 prism_data_offset;
u32 block_data_offset;
f32 prism_thickness;
EGG::Vector3f area_min_pos;
u32 area_x_width_mask;
u32 area_y_width_mask;
u32 area_z_width_mask;
u32 block_width_shift;
u32 area_x_blocks_shift;
u32 area_xy_blocks_shift;
f32 sphere_radius;
};

struct KCollisionPrism {
// inlined after KCollisionOctree ctor I think ~KCollisionPrism() {}

f32 height;
u16 pos_i;
u16 fnrm_i;
u16 enrm1_i;
u16 enrm2_i;
u16 enrm3_i;
u16 attribute;
};
}
Loading

0 comments on commit 0807f87

Please sign in to comment.