Consider the following road network. The car (orange) needs to get to the red circle. It drives on the right hand side of the road and is initially facing down.
The shortest path is the blue one. But if it follows this path, it reaches the red circle on the wrong side of the road. To actually get to the red circle, it needs to take the green path - much longer. The pink dots represent the nodes - the road network is made up of modular road pieces. Each node also stores all the possible directions a vehicle could take from that piece.
How can I make a pathfinding algorithm that takes this into consideration?