roy-t / AStar

A fast 2D path finding library based on the A* algorithm. Works with both grids and graphs. Supports any .NET variant that supports .NETStandard 2.0 or higher. This library has no external dependencies. The library is licensed under the MIT license.
http://roy-t.nl
MIT License
338 stars 60 forks source link

Added agent shape feature. #26

Closed mikkleini closed 4 years ago

mikkleini commented 5 years ago

Implemented feature request #25 I used locally modified Viewer project to test it. Would be nice to update Viewer project with agent shape selections and drawing, but not today.

mikkleini commented 5 years ago

Actually i forgot one thing - grid borders. Should keep required distance from that also.

roy-t commented 5 years ago

So cool that you've added this. I'm on vacation right now but back in a few days. Will take a look then 😁

mikkleini commented 5 years ago

Now the grid boundaries are taken into account also. Any part of agent can't get out of the grid. There was an easy but inefficient solution which would have required repeating calculations inside GetMovementOptions, so i created the boundary calculations once in path finding function.

With my first commit i broke the Viewer, now that's fixed as well.

roy-t commented 4 years ago

@mikkleini it looks great, I've merged it!