diff options
author | metamuffin <metamuffin@disroot.org> | 2025-01-06 22:36:03 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-01-06 22:36:03 +0100 |
commit | 45282d3a54cc50306383c41e4c7e3d982cac69d1 (patch) | |
tree | d9b9046dae519f1e48716a7497c1dc8505d5e4d8 /world/src | |
parent | 44ef37bca0aa633f8c59d849946faf2319c5446b (diff) | |
download | weareserver-45282d3a54cc50306383c41e4c7e3d982cac69d1.tar weareserver-45282d3a54cc50306383c41e4c7e3d982cac69d1.tar.bz2 weareserver-45282d3a54cc50306383c41e4c7e3d982cac69d1.tar.zst |
mesh not visible
Diffstat (limited to 'world/src')
-rw-r--r-- | world/src/main.rs | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/world/src/main.rs b/world/src/main.rs index d7272fe..2823540 100644 --- a/world/src/main.rs +++ b/world/src/main.rs @@ -23,6 +23,8 @@ struct Args { scene: PathBuf, #[arg(short, long)] push: bool, + #[arg(short, long)] + spin: bool, } fn main() -> Result<()> { @@ -99,7 +101,6 @@ fn main() -> Result<()> { } .write_alloc(), )?; - let mat = node.transform().matrix(); let aff = Affine3A::from_cols_array_2d(&[ [mat[0][0], mat[0][1], mat[0][2]], @@ -115,18 +116,20 @@ fn main() -> Result<()> { let ob = Object::new(); Packet::Add(ob, store.set(&prefab.write_alloc())?).write(&mut sock)?; - // let mut sock2 = sock.try_clone().unwrap(); - // thread::spawn(move || { - // let mut x = 0.; - // loop { - // Packet::Position(ob, Vec3A::ZERO, vec3a(x, x * 0.3, x * 0.1)) - // .write(&mut sock2) - // .unwrap(); - // sock2.flush().unwrap(); - // x += 0.1; - // sleep(Duration::from_millis(50)); - // } - // }); + if args.spin { + let mut sock2 = sock.try_clone().unwrap(); + thread::spawn(move || { + let mut x = 0.; + loop { + Packet::Position(ob, Vec3A::ZERO, vec3a(x, x * 0.3, x * 0.1)) + .write(&mut sock2) + .unwrap(); + sock2.flush().unwrap(); + x += 0.1; + sleep(Duration::from_millis(50)); + } + }); + } if args.push { store.iter(|d| { |