From 4e16902661bc659e28f81155887ec63dc5746546 Mon Sep 17 00:00:00 2001 From: Valentin Popov Date: Fri, 23 Oct 2026 13:20:59 +0400 Subject: feat(runtime): project initial Control mesh metadata --- crates/fparkan-msh/src/lib.rs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'crates/fparkan-msh/src') diff --git a/crates/fparkan-msh/src/lib.rs b/crates/fparkan-msh/src/lib.rs index b6459ab..4b561e7 100644 --- a/crates/fparkan-msh/src/lib.rs +++ b/crates/fparkan-msh/src/lib.rs @@ -140,7 +140,10 @@ pub struct Node { /// Raw fields of the standard 38-byte node layout that precede slot selection. #[derive(Clone, Copy, Debug, Eq, PartialEq)] pub struct Node38Metadata { - /// Unassigned source link value at byte offset two. + /// Raw Node38 header/flag word at byte offset zero. + pub header_flags: u16, + /// Source-local parent word at byte offset two; `0xFFFF` is the native + /// sentinel before component rebasing. pub parent_or_link_raw: u16, /// Offset into the type-19 frame map, or `0xFFFF` for no map. pub anim_map_start: u16, @@ -431,6 +434,7 @@ pub fn node38_metadata(model: &ModelAsset, node: NodeId) -> Option Option Option { @@ -1412,6 +1416,7 @@ mod tests { #[test] fn standard_node_exposes_fallback_pose_and_unassigned_link() { let mut node = node38([u16::MAX; 15]); + node[0..2].copy_from_slice(&0x8201_u16.to_le_bytes()); node[2..4].copy_from_slice(&7_u16.to_le_bytes()); node[4..6].copy_from_slice(&u16::MAX.to_le_bytes()); node[6..8].copy_from_slice(&0_u16.to_le_bytes()); @@ -1440,6 +1445,7 @@ mod tests { assert_eq!( node38_metadata(&model, NodeId(0)), Some(Node38Metadata { + header_flags: 0x8201, parent_or_link_raw: 7, anim_map_start: u16::MAX, fallback_key: 0, -- cgit v1.2.3