Roquen, could you explain why SAT would be a poor choice in this case, and what method or methods you think should be preferred? I think that information would be very useful to the OP (and to anyone else, like me, who’s interested in these topics and always looking to expand their knowledge).
@The OP: Just in case Roquen doesn’t get around to elaborating, let me offer some counterpoint here. Although I’m always happy to be shown to be wrong, I’m not entirely sure Roquen is correct here, and in absence of supporting explanation I’d recommend not jumping to the conclusion that the SAT is a poor choice.
First of all, the bog-standard canonical axis-aligned box test that we all know and have seen implemented countless times is in fact the separating axis test, so obviously the SAT has valid applications.
Now, maybe this is why Roquen said ‘almost’. However, the question then becomes, if the SAT is good for axis-aligned boxes, why is it not applicable elsewhere, and at what point do other options start to look better?
In 3-d the SAT can be problematic in some cases due to numerical issues or excessive number of axes. However, these concerns don’t apply in the given context. If your triangles are axis-aligned like in your image, the SAT here is only a bit more involved than the axis-aligned box case, so it’s a little difficult for me to imagine why the SAT would suddenly become unsuitable in this case. Even if your triangles are arbitrary, you’re still only talking about 5 axes to test total.
Additionally, the discrete SAT for simple 2-d tests has the advantages of being entirely stable and robust (given good input), of handling all cases correctly (no concerns about containment or other special cases), and of being easily extended to return a minimum translational vector that can be used to resolve the intersection.
I do think this:
[quote]It’s only upsides is that it works and it’s simple to implement.
[/quote]
Is kind of interesting
What strikes me as amusing about this is that ‘it works and is simple to implement’ is really quite an endorsement! I mean really, as long as it’s also reasonably efficient (which it is in this case), what more could you ask for?
Anyway Roquen, I’m sure you have reasons for discouraging its use, but I think some elaboration would be helpful here.