summaryrefslogtreecommitdiff
path: root/world/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'world/src/main.rs')
-rw-r--r--world/src/main.rs22
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 {