pub struct Mdl {Show 14 fields
pub root_node: MdlNode,
pub geometry_fn_ptr1: u32,
pub geometry_fn_ptr2: u32,
pub model_type: u8,
pub classification: u8,
pub subclassification: u8,
pub affected_by_fog: u8,
pub supermodel_name: String,
pub node_count: u32,
pub bounding_box: [f32; 6],
pub radius: f32,
pub animation_scale: f32,
pub animations: Vec<MdlAnimation>,
pub anim_root_node: Option<String>,
}Expand description
The high-level MDL container.
Every field is fully typed - the reader extracts all meaningful header data and the writer produces correct binary output from these fields alone.
Fields§
§root_node: MdlNodeThe root node of the model hierarchy.
geometry_fn_ptr1: u32Function pointer 1 from the geometry header (+0x00).
This is a leaked runtime vtable pointer from the BioWare toolset.
Used by kotorblender for K1/K2/Xbox game detection.
K1 PC value: 0x00413470.
geometry_fn_ptr2: u32Function pointer 2 from the geometry header (+0x04).
K1 PC value: 0x00405580.
model_type: u8Model type from geometry header (+0x4C). Always 2 for geometry models.
classification: u8Classification (0=Other, 1=Effect, 2=Tile, 4=Character, 8=Door).
subclassification: u8Subclassification byte (+0x51). Non-zero in ~196 vanilla K1 models.
affected_by_fog: u8Affected-by-fog flag (+0x53). 0 or 1.
supermodel_name: StringThe supermodel name (from header, +0x88).
node_count: u32Total node count (from header, +0x2C).
bounding_box: [f32; 6]Model bounding box (min_xyz, max_xyz) from header (+0x68..+0x7F).
radius: f32Model bounding sphere radius from header (+0x80).
animation_scale: f32Animation scale factor from header (+0x84). Default 1.0.
animations: Vec<MdlAnimation>Animations attached to this model.
anim_root_node: Option<String>Animation root node name, when different from the geometry root.
Head models set this to "neck_g" so the engine applies head
animations from the neck bone rather than the model root. When
None, the writer uses the geometry root offset for +0xA8.