Function planetkit::movement::step_forward_and_face_neighbor [] [src]

pub fn step_forward_and_face_neighbor(
    pos: &mut GridPoint3,
    dir: &mut Dir,
    resolution: [GridCoord; 2],
    last_turn_bias: &mut TurnDir
) -> Result<(), ()>

Move forward by one cell and ensure dir now points to a legal direction for continued movement.

Uses last_turn_bias to decide which direction to turn if we, land on a pentagon, and updates it to be its opposite. In this way we balance out the direction turned over time. This is not necessary for anything to work (we could always choose to turn left) but it's aesthetically nice.

See move_forward for more details`.