🚧 wip: write a bogus joint
parent
4bd6d7d25d
commit
af7328ed05
24
src/main.rs
24
src/main.rs
|
@ -238,7 +238,7 @@ fn main () {
|
||||||
let ofs_text = offset;
|
let ofs_text = offset;
|
||||||
offset += num_text;
|
offset += num_text;
|
||||||
let ofs_joints = offset;
|
let ofs_joints = offset;
|
||||||
// offset += num_joints * 48;
|
offset += num_joints * 48;
|
||||||
|
|
||||||
let filesize = offset;
|
let filesize = offset;
|
||||||
let _ = offset;
|
let _ = offset;
|
||||||
|
@ -274,8 +274,8 @@ fn main () {
|
||||||
f.write_all (&(0u32.to_le_bytes ())).unwrap ();
|
f.write_all (&(0u32.to_le_bytes ())).unwrap ();
|
||||||
|
|
||||||
// num_joints, ofs_joints
|
// num_joints, ofs_joints
|
||||||
f.write_all (&(0u32.to_le_bytes ())).unwrap ();
|
f.write_all (&(num_joints.to_le_bytes ())).unwrap ();
|
||||||
f.write_all (&(0u32.to_le_bytes ())).unwrap ();
|
f.write_all (&(ofs_joints.to_le_bytes ())).unwrap ();
|
||||||
|
|
||||||
// num_poses, ofs_poses
|
// num_poses, ofs_poses
|
||||||
f.write_all (&(0u32.to_le_bytes ())).unwrap ();
|
f.write_all (&(0u32.to_le_bytes ())).unwrap ();
|
||||||
|
@ -351,7 +351,25 @@ fn main () {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Text
|
// Text
|
||||||
|
|
||||||
f.write_all (texts.as_bytes ()).unwrap ();
|
f.write_all (texts.as_bytes ()).unwrap ();
|
||||||
|
|
||||||
|
// Joints
|
||||||
|
|
||||||
|
for j in joints {
|
||||||
|
f.write_all (&(u32::to_le_bytes (j.name))).unwrap ();
|
||||||
|
f.write_all (&(i32::to_le_bytes (j.parent))).unwrap ();
|
||||||
|
|
||||||
|
for x in j.translate {
|
||||||
|
f.write_all (&(f32::to_le_bytes (x))).unwrap ();
|
||||||
|
}
|
||||||
|
for x in j.rotate {
|
||||||
|
f.write_all (&(f32::to_le_bytes (x))).unwrap ();
|
||||||
|
}
|
||||||
|
for x in j.scale {
|
||||||
|
f.write_all (&(f32::to_le_bytes (x))).unwrap ();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn gltf_node_get_mat4 (node: &gltf::Node) -> Mat4 {
|
fn gltf_node_get_mat4 (node: &gltf::Node) -> Mat4 {
|
||||||
|
|
Loading…
Reference in New Issue