summaryrefslogtreecommitdiff
path: root/world/src/mesh.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2025-01-20 19:49:46 +0100
committermetamuffin <metamuffin@disroot.org>2025-01-20 19:49:46 +0100
commit2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0 (patch)
tree82da40367ae89e9217c207ffda7a87ed12a24ef1 /world/src/mesh.rs
parentbde0d7d3cc05752977b84a35821481e0e791febe (diff)
downloadweareserver-2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0.tar
weareserver-2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0.tar.bz2
weareserver-2e3912fbc8d0e2c100a8d75bd2e8d3a579d25db0.tar.zst
armature
Diffstat (limited to 'world/src/mesh.rs')
-rw-r--r--world/src/mesh.rs22
1 files changed, 22 insertions, 0 deletions
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,