summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-21 16:49:08 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-21 16:49:08 +0100
commit51f5c31108ffa00381b6cd7c9d32d6a332356267 (patch)
tree30e96faaf8662c3cdc62dc1c9f9b5d743e4be6f6
parent758793bccbea3a176c4f587c1733ac3b90045a78 (diff)
downloadweareserver-51f5c31108ffa00381b6cd7c9d32d6a332356267.tar
weareserver-51f5c31108ffa00381b6cd7c9d32d6a332356267.tar.bz2
weareserver-51f5c31108ffa00381b6cd7c9d32d6a332356267.tar.zst
add debug code for armature
-rw-r--r--world/src/main.rs39
1 files changed, 39 insertions, 0 deletions
diff --git a/world/src/main.rs b/world/src/main.rs
index 67a7c5d..61f895f 100644
--- a/world/src/main.rs
+++ b/world/src/main.rs
@@ -123,6 +123,45 @@ fn main() -> Result<()> {
.map(|(trans, node)| {
let mut prefab = Prefab::default();
+ // if let Some(skin) = node.skin() {
+ // eprintln!("{:?}", skin.joints().map(|j| j.name()).collect::<Vec<_>>());
+ // if let Some(root) = skin.skeleton() {
+ // fn traverse(
+ // ars: &mut (&mut Vec<String>, &mut Vec<Affine3A>, &mut Vec<u16>),
+ // trans: Affine3A,
+ // parent: Option<u16>,
+ // node: &Node,
+ // ) {
+ // let trans = trans * transform_to_affine(node.transform());
+ // let ind = ars.0.len() as u16;
+ // // print!("{} ", node.index());
+ // ars.0.push(node.name().unwrap_or("").to_owned());
+ // ars.1.push(trans);
+ // ars.2.push(parent.unwrap_or(ind));
+ // for c in node.children() {
+ // traverse(ars, trans, Some(ind), &c);
+ // }
+ // }
+ // let mut name = Vec::new();
+ // let mut transform = Vec::new();
+ // let mut parent = Vec::new();
+ // traverse(
+ // &mut (&mut name, &mut transform, &mut parent),
+ // Affine3A::IDENTITY,
+ // None,
+ // &root,
+ // );
+ // // println!();
+ // let armature = Armature {
+ // name: Some(name),
+ // parent: Some(parent),
+ // transform: Some(transform),
+ // };
+ // let armature = store.set(&armature)?;
+ // // eprintln!("{armature:?}")
+ // }
+ // }
+
if let Some(mesh) = node.mesh() {
import_mesh(
mesh,