figure 1 |
Of course this means reworking an obstacle class to be more like a system of equations instead of just using an array of lines to increment through the obstacles to bypass. By comparing obstacle endpoints and startpoints with each other. The ones that are shared will then be considered one object. Thus, a solution path around that object involves skirting the edges of the lines of the obstacle themselves, and then computing the shortest path. I don't know why I didn't think of doing something along these lines before in all honesty.
I'll set up the class to have a flag to be checked if the obstacle is more than a simple line or not. If it's not, then a simple startpoint to obstacle end or start point and then to destination will suffice. If it's flagged, than the line of the other obstacle parts will be copied and shifted by X closer to the start position, and a little bit longer than the obstacle line so it moves past it.
I'm so excited to code this and fix it!
No comments:
Post a Comment