This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
kirby64_the_crystal_shards:level_settings_blocks [2020/08/18 16:11] jesusyoshi54 [Camera&Kirby Nodes] |
kirby64_the_crystal_shards:level_settings_blocks [2021/04/09 18:18] someone2639 old revision restored (2020/09/15 11:30) |
||
---|---|---|---|
Line 87: | Line 87: | ||
Together the normals should solve the plane equation (see:[[http://mathworld.wolfram.com/Plane.html|link]]). | Together the normals should solve the plane equation (see:[[http://mathworld.wolfram.com/Plane.html|link]]). | ||
- | The list of normals always starts with (-1,-2,-3,-4) and is used to refer to walls, only solid collision has its normals listed. | + | The list of normals always starts with (-1,-2,-3,-4). |
Redundant normals are not repeated, but are just referenced multiple times (e.g. two triangles with norm Y==1 and offset==0 share their normal). | Redundant normals are not repeated, but are just referenced multiple times (e.g. two triangles with norm Y==1 and offset==0 share their normal). | ||
Line 106: | Line 106: | ||
Each triangle group represents one polygon index (0x6 in tri struct). The groups are defined by setting the msb at the last triangle in that group. This means any coplanar, connected N-gon will be a single polygon group. | Each triangle group represents one polygon index (0x6 in tri struct). The groups are defined by setting the msb at the last triangle in that group. This means any coplanar, connected N-gon will be a single polygon group. | ||
- | There should be an equal amount of items in the triangle list and triangle group list. | + | There should be an equal amount of items in the triangle list and triangle group list, but there may be repeats based on how the normal groups are split. |
+ | Triangles within groups are sorted by Y values. | ||
==== Normal Groups ==== | ==== Normal Groups ==== | ||
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. | 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. | ||
- | 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. | + | If a triangle group intersects a normal, then the group is split and the normal is repeated in both the left and right children. If that group shares a condition such as being breakable, then the entire group is repeated in the left and right branches. |
+ | |||
+ | Child indices of zero refer to leaf nodes, the tree start is defined in the collision header. | ||
<code c> | <code c> | ||
Line 136: | Line 138: | ||
/*0x0*/ u16 Num_Dynamic_Geo_Group_Members; //Number of connected triangles | /*0x0*/ u16 Num_Dynamic_Geo_Group_Members; //Number of connected triangles | ||
/*0x2*/ u16 Index_To_Dynamic_Geo_Group; //(0x30 in col header) | /*0x2*/ u16 Index_To_Dynamic_Geo_Group; //(0x30 in col header) | ||
- | /*0x4*/ u16 Unk_Index; //Gets stored to unk struct | + | /*0x4*/ u16 Layout_Number; //Linked display geometry to also remove |
}; | }; | ||
</code> | </code> | ||
Line 204: | Line 206: | ||
/*0x20*/ u16 (*Triangle_Norm_Cells)[][2]; | /*0x20*/ u16 (*Triangle_Norm_Cells)[][2]; | ||
/*0x24*/ u32 Len_Triangle_Norm_Cells; | /*0x24*/ u32 Len_Triangle_Norm_Cells; | ||
- | /*0x28*/ u32 Num_Floor_Norms; //Should be tri norm cells minus 1 | + | /*0x28*/ u32 Norm_Cell_BSP_Root; //Always last member |
/*0x2C*/ struct DynGeo_List (*Destructable_Groups)[]; | /*0x2C*/ struct DynGeo_List (*Destructable_Groups)[]; | ||
/*0x30*/ u16 (*Destructable Indices)[]; | /*0x30*/ u16 (*Destructable Indices)[]; |