diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-21 22:00:39 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-21 22:00:39 +0100 |
commit | 12bf2f3302efc9042f12ca17104928c35700c229 (patch) | |
tree | 7abf77d5b94308993c9d67f65413f8a8d698c685 /world/src | |
parent | 20d5d575ad84da3d37bd581425fc335016f33c82 (diff) | |
download | weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar.bz2 weareserver-12bf2f3302efc9042f12ca17104928c35700c229.tar.zst |
split shaders to individual files
Diffstat (limited to 'world/src')
-rw-r--r-- | world/src/main.rs | 1 | ||||
-rw-r--r-- | world/src/mesh.rs | 12 |
2 files changed, 11 insertions, 2 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index a31ef63..b5ce1a4 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -178,6 +178,7 @@ fn main() -> Result<()> { &mut prefab, &args, &texture_cache, + &armatures, )?; } let (position, _, _) = node.transform().decomposed(); diff --git a/world/src/mesh.rs b/world/src/mesh.rs index 1b25cbe..3d71939 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -21,7 +21,7 @@ use log::{debug, info}; use std::path::Path; use weareshared::{ Affine3A, Vec3A, - resources::{MeshPart, Prefab}, + resources::{Armature, MeshPart, Prefab}, store::ResourceStore, vec2, vec3a, }; @@ -36,6 +36,7 @@ pub fn import_mesh( prefab: &mut Prefab, args: &Args, texture_cache: &TextureCache, + armatures: &[Option<Armature>], ) -> Result<()> { Ok(for p in mesh.primitives() { let name = mesh.name().or(node.name()).map(|e| e.to_owned()); @@ -340,10 +341,17 @@ pub fn import_mesh( None }; + let mut armature = None; + if let Some(skin) = node.skin() { + if let Some(a) = &armatures[skin.index()] { + armature = Some(store.set(a)?); + } + } + let mesh = store.set(&MeshPart { name, index, - armature: None, + armature, g_albedo, g_alpha, g_metallic, |