This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
kirby64_the_crystal_shards:level_settings_blocks [2020/05/27 12:19] jesusyoshi54 |
kirby64_the_crystal_shards:level_settings_blocks [2020/06/07 20:53] jesusyoshi54 [Normal Groups] |
||
---|---|---|---|
Line 110: | Line 110: | ||
==== Normal Groups ==== | ==== Normal Groups ==== | ||
- | The normal groups is a list that matches each normal to a triangle. It is formed in pairs with the first item being the index of the normal, and the second item being the index of the triangle. | + | The normal groups are a binary space partition tree of the level normals and corresponding triangles associated with those normals. Each normal group represents a node in the tree, and has a right and left child based on whether the ensemble of triangles is in front or behind the parent node. |
- | Normal groups are sorted by polygon index. Only floors & ceilings are referenced by the normal groups, walls are given the first index of the normals list (-1,-2,-3,-4). | + | The first index of the normal group is (-1,-2,-3,-4), the search through the tree starts at the last member in the array, indices of zero refer to leaf nodes. |
<code c> | <code c> | ||
Line 118: | Line 118: | ||
{ | { | ||
/*0x0*/ u16 Normal_Index; | /*0x0*/ u16 Normal_Index; | ||
- | /*0x2*/ u16 Next_Norm_Group; | + | /*0x2*/ u16 Left_Child; |
- | /*0x4*/ u16 Unk; | + | /*0x4*/ u16 Right_Child; |
/*0x6*/ u16 Tri_Cell_Index | /*0x6*/ u16 Tri_Cell_Index | ||
}; | }; |