diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-20 19:49:46 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-20 19:49:46 +0100 |
commit | 2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0 (patch) | |
tree | 82da40367ae89e9217c207ffda7a87ed12a24ef1 /world | |
parent | bde0d7d3cc05752977b84a35821481e0e791febe (diff) | |
download | weareserver-2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0.tar weareserver-2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0.tar.bz2 weareserver-2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0.tar.zst |
armature
Diffstat (limited to 'world')
-rw-r--r-- | world/src/main.rs | 1 | ||||
-rw-r--r-- | world/src/mesh.rs | 22 |
2 files changed, 23 insertions, 0 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index a2d25ca..67a7c5d 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -122,6 +122,7 @@ fn main() -> Result<()> { .par_iter() .map(|(trans, node)| { let mut prefab = Prefab::default(); + if let Some(mesh) = node.mesh() { import_mesh( mesh, diff --git a/world/src/mesh.rs b/world/src/mesh.rs index 3d9ee8d..1b25cbe 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -74,6 +74,24 @@ pub fn import_mesh( }) .transpose()?; + let va_joint_index = reader + .read_joints(0) + .map(|iter| { + let a = iter.into_u16().collect::<Vec<_>>(); + debug!("{} vertex joint indecies", a.len()); + Ok::<_, anyhow::Error>(store.set(&a)?) + }) + .transpose()?; + + let va_joint_weight = reader + .read_weights(0) + .map(|iter| { + let a = iter.into_f32().collect::<Vec<_>>(); + debug!("{} vertex joint weights", a.len()); + Ok::<_, anyhow::Error>(store.set(&a)?) + }) + .transpose()?; + let va_texcoord = reader .read_tex_coords(0) .map(|iter| { @@ -325,6 +343,7 @@ pub fn import_mesh( let mesh = store.set(&MeshPart { name, index, + armature: None, g_albedo, g_alpha, g_metallic, @@ -343,6 +362,8 @@ pub fn import_mesh( va_texcoord, va_albedo, va_alpha, + va_joint_index, + va_joint_weight, tex_albedo, tex_normal, tex_roughness, @@ -353,6 +374,7 @@ pub fn import_mesh( tex_thickness, tex_occlusion, // not supported by gltf + hint_mirror: None, // TODO va_transmission: None, va_emission: None, va_metallic: None, |