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)