ravertass / PixelHunter1995

Point and click goodness
0 stars 0 forks source link

Path finding in walking area #109

Open Torakko opened 4 years ago

Torakko commented 4 years ago

Four cases:

1.Outside walking area: Go to closest edge vertex. Future improvement: Go to closest edge.

  1. In current polygon: Just go to click positin

  2. In adjacent polygon Go towards center of adjacent polygon (case 2 after crossed border) Future improvement: Go to closest point of border.

  3. In a non-adjacent polygon Use Dijkstras algorithm to find shortest path. Get next polygon in path and do as in 3.