Skip to content

Commit

Permalink
switch to debug logs
Browse files Browse the repository at this point in the history
  • Loading branch information
cbournhonesque-sc committed Dec 21, 2023
1 parent 83adcad commit 4f12f13
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 14 deletions.
16 changes: 8 additions & 8 deletions examples/replication_groups/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ pub(crate) fn interpolate(
assert_eq!(tail_status.current, parent_status.current);
*tail = tail_start_value.clone();
*parent_position = pos_start.clone();
info!(
debug!(
?tail,
?parent_position,
"after interpolation; CURRENT = START"
Expand All @@ -296,7 +296,7 @@ pub(crate) fn interpolate(
assert_eq!(tail_status.current, parent_status.current);
*tail = tail_end_value.clone();
*parent_position = pos_end.clone();
info!(
debug!(
?tail,
?parent_position,
"after interpolation; CURRENT = END"
Expand Down Expand Up @@ -324,13 +324,13 @@ pub(crate) fn interpolate(
!= tail_start_value.0.front().unwrap().0
{
tail.0.push_front(tail_end_value.0.front().unwrap().clone());
info!("ADD POINT");
debug!("ADD POINT");
}
// the path is straight! just move the head and adjust the tail
*parent_position =
PlayerPosition::lerp(pos_start.clone(), pos_end.clone(), t);
tail.shorten_back(parent_position.0, tail_length.0);
info!(
debug!(
?tail,
?parent_position,
"after interpolation; FIRST SEGMENT"
Expand Down Expand Up @@ -371,7 +371,7 @@ pub(crate) fn interpolate(
// now move the head by `pos_distance_to_do` while remaining on the tail path
for i in (0..segment_idx).rev() {
let dist = segment_length(parent_position.0, tail_end_value.0[i].0);
info!(
debug!(
?i,
?dist,
?pos_distance_to_do,
Expand All @@ -380,7 +380,7 @@ pub(crate) fn interpolate(
"in other segments"
);
if pos_distance_to_do < 1000.0 * f32::EPSILON {
info!(?tail, ?parent_position, "after interpolation; ON POINT");
debug!(?tail, ?parent_position, "after interpolation; ON POINT");
// no need to change anything
continue 'outer;
}
Expand All @@ -406,7 +406,7 @@ pub(crate) fn interpolate(
.1
.get_tail(tail_end_value.0[i].0, dist - pos_distance_to_do);
tail.shorten_back(parent_position.0, tail_length.0);
info!(?tail, ?parent_position, "after interpolation; ELSE");
debug!(?tail, ?parent_position, "after interpolation; ELSE");
continue 'outer;
}
}
Expand All @@ -419,7 +419,7 @@ pub(crate) fn interpolate(
.1
.get_tail(pos_end.0, dist - pos_distance_to_do);
tail.shorten_back(parent_position.0, tail_length.0);
info!(?tail, ?parent_position, "after interpolation; ELSE FIRST");
debug!(?tail, ?parent_position, "after interpolation; ELSE FIRST");
}
}
}
Expand Down
8 changes: 2 additions & 6 deletions examples/replication_groups/shared.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,10 @@ pub struct SharedPlugin;

impl Plugin for SharedPlugin {
fn build(&self, app: &mut App) {
app.add_plugins(WorldInspectorPlugin::new());
app.add_systems(Update, draw_snakes);
}
}

// head
// snake

// This system defines how we update the player's positions when we receive an input
pub(crate) fn shared_movement_behaviour(position: &mut PlayerPosition, input: &Inputs) {
const MOVE_SPEED: f32 = 10.0;
Expand Down Expand Up @@ -121,13 +117,13 @@ pub(crate) fn draw_snakes(
if position.0.x != points.0.front().unwrap().0.x
&& position.0.y != points.0.front().unwrap().0.y
{
info!("DIAGONAL");
debug!("DIAGONAL");
}
// draw the rest of the lines
for (start, end) in points.0.iter().zip(points.0.iter().skip(1)) {
gizmos.line_2d(start.0, end.0, color.0);
if start.0.x != end.0.x && start.0.y != end.0.y {
info!("DIAGONAL");
debug!("DIAGONAL");
}
}
}
Expand Down

0 comments on commit 4f12f13

Please sign in to comment.