| Crates.io | simple_flowfield |
| lib.rs | simple_flowfield |
| version | 2.0.0 |
| created_at | 2025-09-17 11:48:52.47549+00 |
| updated_at | 2025-11-06 19:48:52.239185+00 |
| description | A very barebones flowfield pathfinding library. |
| homepage | |
| repository | https://github.com/arashm-gh/simple_flowfield |
| max_upload_size | |
| id | 1843155 |
| size | 31,480 |
flowfield is a rust crate for quickly and easily implementing a FlowField pathfinding system into your project.
it works for both 3d and 2d!
Use:
cargo add simple_flowfield
use simple_flowfield::*;
// define the entire grid map
let grid = grid::Grid2D::new(100, 100);
// define the flowfield for a single target
let fieldA = field::FlowField2D::new(&grid, (49, 91));
// initalize an agent
let mut agent = agent::Agent2D::new(0, 0);
// returns a (i32, i32)
let result = fieldA.get_direction_at(agent.x, agent.y);
// add obstacles in the grid
grid.set_rect_obstacle(40, 0, 3, 34, true);
// every agent can work with a different flow field
let fieldB = field::FlowField2D::new(&grid, (0, 0));
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.