pub struct MdlFace {
pub plane_normal: [f32; 3],
pub plane_distance: f32,
pub surface_id: u32,
pub adjacent: [u16; 3],
pub vertex_indices: [u16; 3],
}Expand description
A face in the binary MaxFace format (32 bytes on disk).
Contains geometric data for rendering and collision: a plane equation, surface material ID, face adjacency indices, and vertex indices.
Layout verified via Ghidra struct MaxFace (32 bytes, /KotOR Types/Rendering)
and cross-checked with the 0x1A vertex-index offset constant used in both
MdlNodeDanglyMesh::InternalGenVertices and MdlNodeAnimMesh::InternalGenVertices.
See docs/notes/mdl_mdx.md §MdlNodeTriMesh.
Fields§
§plane_normal: [f32; 3]Face plane normal vector (3 × f32). MaxFace offset +0x00.
plane_distance: f32Face plane distance from origin (f32). MaxFace offset +0x0C.
surface_id: u32Surface material/type ID (u32). MaxFace offset +0x10.
adjacent: [u16; 3]Indices of the three adjacent faces (3 × u16). MaxFace offset +0x14.
vertex_indices: [u16; 3]Vertex indices into the mesh vertex array (3 × u16). MaxFace offset +0x1A.