diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-12 12:08:56 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-12 12:08:56 +0100 |
commit | 7121bb7c49fcf5b24795c77100cb1ff46097ecb6 (patch) | |
tree | 8a8ea6cbbca75a8aa8e0394d07cfe4a3a0817e94 /world/src/main.rs | |
parent | c626006c767f21d1ba0d452b64e244c7d69fa09b (diff) | |
download | weareserver-7121bb7c49fcf5b24795c77100cb1ff46097ecb6.tar weareserver-7121bb7c49fcf5b24795c77100cb1ff46097ecb6.tar.bz2 weareserver-7121bb7c49fcf5b24795c77100cb1ff46097ecb6.tar.zst |
add scale and z_up arguments
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index 72e7df2..0decba6 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -44,7 +44,7 @@ use weareshared::{ }; #[derive(Parser)] -struct Args { +pub struct Args { address: SocketAddr, /// Path to a glTF file, binary or json format scene: PathBuf, @@ -64,11 +64,15 @@ struct Args { #[arg(short, long)] webp: bool, /// Add skybox - #[arg(short, long)] + #[arg(long)] skybox: Option<PathBuf>, /// Override prefab name #[arg(short, long)] name: Option<String>, + #[arg(short, long)] + scale: Option<f32>, + #[arg(short, long)] + z_up: bool, } fn main() -> Result<()> { @@ -87,7 +91,7 @@ fn main() -> Result<()> { let mut prefab = Prefab::default(); - prefab.name = args.name.or(gltf + prefab.name = args.name.clone().or(gltf .default_scene() .map(|n| n.name()) .flatten() @@ -96,15 +100,7 @@ fn main() -> Result<()> { for node in gltf.nodes() { if let Some(mesh) = node.mesh() { info!("--- MESH ---"); - import_mesh( - mesh, - &buffers, - &store, - path_base, - &node, - &mut prefab, - args.webp, - )?; + import_mesh(mesh, &buffers, &store, path_base, &node, &mut prefab, &args)?; } let (position, _, _) = node.transform().decomposed(); if let Some(light) = node.light() { @@ -121,7 +117,7 @@ fn main() -> Result<()> { })?, )); } - import_physics(&gltf, &node, &mut prefab, &store, &buffers)?; + import_physics(&gltf, &node, &mut prefab, &store, &buffers, &args)?; } if let Some(skybox) = args.skybox { |