pub struct MdlNode {
pub name: String,
pub parent_index: Option<u16>,
pub children: Vec<MdlNode>,
pub position: [f32; 3],
pub rotation: [f32; 4],
pub node_data: MdlNodeData,
pub controllers: Vec<MdlController>,
pub orphan_controller_data: Vec<f32>,
pub header_padding_02: [u8; 2],
pub header_padding_06: [u8; 2],
}Expand description
A node in the MDL hierarchy.
Fields§
§name: StringName of the node resolved from the model’s name table.
parent_index: Option<u16>Parent index (if any).
children: Vec<MdlNode>Child nodes attached to this node.
position: [f32; 3]Local position (x, y, z).
rotation: [f32; 4]Local orientation quaternion (w, x, y, z).
Matches the engine’s Quaternion struct field order (Ghidra-verified).
Identity quaternion is [1.0, 0.0, 0.0, 0.0].
node_data: MdlNodeDataType-specific node data (determines node type and carries type-specific fields).
Use MdlNodeData::flags() to get the binary flags for serialization.
controllers: Vec<MdlController>Controllers attached to this node.
orphan_controller_data: Vec<f32>Unreferenced controller data floats (key_count=0 but data_count>0).
Some vanilla nodes (especially in supermodel combat animations) carry a controller data array with no corresponding controller key headers. The engine reads both arrays independently, so we must preserve the data bytes for roundtrip fidelity even though no keys reference them.
header_padding_02: [u8; 2]Padding bytes from node header +0x02..+0x03 (between flags and node_id).
Preserved verbatim for roundtrip fidelity per the reserved field rule. Zero for newly constructed nodes.
header_padding_06: [u8; 2]Struct alignment padding from node header +0x06..+0x07 (2 bytes).
Always zero in vanilla files. Located between the u16 node_id duplicate and the u32 name pointer at +0x08.
The fields at +0x08 (name pointer) and +0x0C (parent pointer) are
relocated pointers handled by the writer; they are not stored here.
See docs/notes/mdl_mdx.md §MdlNode Binary Layout.
Implementations§
Source§impl MdlNode
impl MdlNode
Sourcepub fn is_emitter(&self) -> bool
pub fn is_emitter(&self) -> bool
Checks if this node contains emitter data (Flag 0x0004).
Sourcepub fn is_reference(&self) -> bool
pub fn is_reference(&self) -> bool
Checks if this node is a reference to another model (Flag 0x0010).
Sourcepub fn is_dangly(&self) -> bool
pub fn is_dangly(&self) -> bool
Checks if this node contains dangly mesh physics (Flag 0x0100).