Simple problem I'm struggling to figure out a solution for…
Here's an image with explanations:
- track is made of sections
- sections are made of quads
- spheres indicate section centers
- magenta line means section has a junction
- blue/orange lines mean section is a junction (start/inside)
- triangle is the player
I get the wrong way by doing dot(ship direction, section forward)
, this works fine when there is no junction.
To try address this when there is one, I do dot
twice, 1st with section, 2nd with junction then do dot = max(dot1, dot2)
.
I also lower the dot threshold a bit for this particular case.
It looks better but still doesn't feel quite right…
Any clues in getting this more robust are welcome!
Thank you 😁