Function planetkit::movement::move_forward [] [src]

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

Returns an error if pos and dir do not point at an edge of the current cell; it's illegal to move toward a cell vertex.

Behaviour is undefined if pos and dir are not already in their canonical form; i.e. if pos is on the boundary of two root quads, then dir points into that quad or along its edge, but not out.

This extends to behaviour being undefined if pos lies outside the bounds of its root quad.

Both these cases will panic in debug mode.