Pathfinding between collision objects

Hello,

I spent a lot of hours creating a program to find the path between collision objects using ray casting. Here I created a method using mainly mathematical calculations and ray casting to measure the distance to collision in the 360 ​​° spectrum. Here is my code for free use and to facilitate the development of your games. I would be very grateful if you post here any modifications to my code, even if it is just a small bug, or a change in some mechanisms for the better or a making code more minimalistic. The program works very fast, about 20 milliseconds on my computer, finding a path between about 4 collision objects. The program lists the individual points of the most effective path in the console, I have not yet worked on the visualization. I wish you good luck in using and editing.

Path finding.zip (25.3 KB)

7 Likes

Thank you for sharing the code! May I suggest that you share it on GitHub or similar service? This makes it easier for people to evaluate the code and also make contributions.

3 Likes

I admit that I don’t have GitHub yet, but I’ll set it up, thank you for the type.

Excellent! I noticed that you put the build folder under version control:

You can remove the build folder and add it to a .gitignore file.

And I added an issue I found with one of the function names.

3 Likes