diff --git a/src/projection.rs b/src/projection.rs index e6a2fd8..7c9dfa6 100644 --- a/src/projection.rs +++ b/src/projection.rs @@ -45,7 +45,7 @@ pub fn make_projection_rh_from_frustum_reversed( ) -> Mat4 { assert!(z_near > 0.0 && z_far > 0.0); - info!("near {:?}", z_near); + // info!("near {:?}", z_near); // // reversed z 0..1 projection @@ -132,7 +132,7 @@ pub fn create_offaxis_matrices( let bottom = vec_up_normalized.dot(frustum_left) * z_near / dist; // bottom screen edge let top = vec_up_normalized.dot(frustum_up) * z_near / dist; // distance eye from screen - info!("l r b t {} {} {} {}", left, right, bottom, top); + // info!("l r b t {} {} {} {}", left, right, bottom, top); // create a view frustum let projection_matrix = diff --git a/src/tracker.rs b/src/tracker.rs index 90b98ab..f416101 100644 --- a/src/tracker.rs +++ b/src/tracker.rs @@ -35,22 +35,29 @@ pub struct Tracker; impl FromWorld for Tracker { fn from_world(world: &mut World) -> Self { + + info!("Test here!"); + let (sender, receiver): (_, Receiver) = channel(); std::thread::spawn(move || { - let addr: SocketAddr = "127.0.0.1:3883".parse().unwrap(); + + // 212.201.64.122 | 127.0.0.1 + let addr: SocketAddr = "212.201.64.122:3883".parse().unwrap(); let mut stream = TcpStream::connect(addr).unwrap(); stream.set_nodelay(true).unwrap(); - + // We first write our cookie, then read and check the server's cookie, before the loop. write_cookie(&mut stream, CookieData::from(MAGIC_DATA)).unwrap(); let cookie_buf = read_cookie(&mut stream).unwrap(); let mut cookie_buf = Bytes::from(&cookie_buf[..]); + CookieData::unbuffer_ref(&mut cookie_buf) .and_then(|msg| check_ver_nonfile_compatible(msg.version)) .unwrap(); + // Not actually doing anything with the messages here, just receiving them and printing them. loop { let mut buf = BytesMut::new(); @@ -84,7 +91,7 @@ impl FromWorld for Tracker { match result { - Ok(result) => { eprintln!("Ok! {:?}",result.body);}, + Ok(result) => { eprintln!("Pose from tracker {:?}",result.body);}, Err(_) => {} } diff --git a/src/viewer.rs b/src/viewer.rs index 51f6e76..65408c8 100644 --- a/src/viewer.rs +++ b/src/viewer.rs @@ -50,7 +50,7 @@ pub fn apply_viewer_to_projections( *transform = Transform::from_matrix(view.inverse()); - info!("Viewer {:?}", viewer.position); + // info!("Viewer {:?}", viewer.position); // *transform = Transform::from_translation(eye).looking_at(Vec3::ZERO, Vec3::Y); });