diff options
author | metamuffin <metamuffin@disroot.org> | 2025-02-07 16:08:39 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2025-02-07 16:08:39 +0100 |
commit | 111b2e89fec8d035dc5cbb54cd0a4197c18b947e (patch) | |
tree | d78359d5fdeaf3f452ad6cf6089455ff11ea3bc3 /world/src/main.rs | |
parent | d7fdcfd791f011e33fb9720e7451e56410411e4f (diff) | |
download | weareserver-111b2e89fec8d035dc5cbb54cd0a4197c18b947e.tar weareserver-111b2e89fec8d035dc5cbb54cd0a4197c18b947e.tar.bz2 weareserver-111b2e89fec8d035dc5cbb54cd0a4197c18b947e.tar.zst |
new pose packet
Diffstat (limited to 'world/src/main.rs')
-rw-r--r-- | world/src/main.rs | 27 |
1 files changed, 23 insertions, 4 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 { |