diff options
Diffstat (limited to 'world/src')
-rw-r--r-- | world/src/main.rs | 27 | ||||
-rw-r--r-- | world/src/mesh.rs | 12 |
2 files changed, 25 insertions, 14 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index 37ea88a..081aa09 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -58,9 +58,7 @@ pub struct Args { /// Send all resources to the server then quit #[arg(short, long)] push: bool, - /// Spin the object - #[arg(long)] - spin: bool, + /// Remove all other object from the world #[arg(short, long)] clear: bool, @@ -84,8 +82,15 @@ pub struct Args { #[arg(long)] use_cache: bool, + /// Spins the object + #[arg(long)] + debug_spin: bool, + /// Adds a light #[arg(long)] debug_light: bool, + /// Wiggles joint index 6 + #[arg(long)] + debug_armature: bool, } fn main() -> Result<()> { @@ -291,7 +296,7 @@ fn main() -> Result<()> { sock.flush()?; } - if args.spin { + if args.debug_spin { let ob = obs[0]; let mut sock2 = sock.try_clone().unwrap(); thread::spawn(move || { @@ -306,6 +311,20 @@ fn main() -> Result<()> { } }); } + if args.debug_armature { + let ob = obs[0]; + let mut sock2 = sock.try_clone().unwrap(); + thread::spawn(move || { + let mut x = 0f32; + loop { + let a = Affine3A::from_rotation_y(x.sin()); + Packet::Pose(ob, vec![(6, a)]).write(&mut sock2).unwrap(); + sock2.flush().unwrap(); + x += 0.1; + sleep(Duration::from_millis(50)); + } + }); + } if args.push { if args.use_cache { diff --git a/world/src/mesh.rs b/world/src/mesh.rs index fa5dc4d..6fff9c4 100644 --- a/world/src/mesh.rs +++ b/world/src/mesh.rs @@ -18,10 +18,7 @@ use crate::{Args, TextureCache, load_texture}; use anyhow::Result; use gltf::{Mesh, Node, buffer::Data}; use log::{debug, info, warn}; -use std::{ - collections::{BTreeMap, BTreeSet}, - path::Path, -}; +use std::{collections::BTreeMap, path::Path}; use weareshared::{ Affine3A, Vec3A, resources::{MeshPart, Prefab}, @@ -91,11 +88,6 @@ pub fn import_mesh( .map(|x| x.map(|x| joint_index_map[&(si, x)])) .collect::<Vec<_>>(); debug!("{} vertex joint indecies", a.len()); - eprintln!( - "index {:?} {:?}", - node.name(), - a.iter().flatten().collect::<BTreeSet<_>>() - ); if a.len() != num_vertex { warn!("joint index count does not vertex count") } @@ -356,7 +348,7 @@ pub fn import_mesh( None }; - let armature = node.skin().map(|s| 0); + let armature = node.skin().map(|_| 0); let mesh = store.set(&MeshPart { name, |