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