I'm writing a 3D game engine, and the current collision detection doesn't return the point of collision. Is there any fast collision detection algorithm for tetrahedra (or maybe 3D triangle), that returns the point of collision?
Asked
Active
Viewed 436 times
0
-
[GJK](https://en.wikipedia.org/wiki/Gilbert%E2%80%93Johnson%E2%80%93Keerthi_distance_algorithm) is a very efficient general-purpose algorithm that relies on [*simplices*](https://en.wikipedia.org/wiki/Simplex) – which in 3D are tetrahedrons, so it could be something to look at. – meowgoesthedog Jan 10 '19 at 10:21
-
Thank you for the answer! I'm having a hard time finding any source on the supporting functions to get the furthest point of the object in a direction. Do you have any source of that? – Jan 10 '19 at 19:24
-
Search for an implementation of GJK in a language you are familiar with - there are guaranteed to be many. – meowgoesthedog Jan 10 '19 at 20:13
-
I am now using GJK and EPA, but they're only providing the collision depth and normal. How can I get the point from them? I've read about finding the collision feature (point/edge/face), and from that clipping the point, but I haven't found any sources of it – Jan 14 '19 at 23:22
-
EPA produces contact points too - that's its purpose as an add-on to GJK. See e.g. [here](http://allenchou.net/2013/12/game-physics-contact-generation-epa/) – meowgoesthedog Jan 14 '19 at 23:51
-
Thank you very much! With the links you sent along with this: https://sainarayan.me/2017/09/24/3d-physics-engine-using-gjk-epa-and-sequential-impulse-solver/ I've been able to make it work. If you would write those in an answer, I'd gladly accept it – Jan 16 '19 at 22:54
-
Nice to hear that you've made it work! Unfortunately the community doesn't really like link-only posts :D (something to note for the future should you decide to write answers) – meowgoesthedog Jan 16 '19 at 23:13
-
[We had a question related to this on GameDev.StackExchange](https://gamedev.stackexchange.com/q/183120/39518) - would you be interested in sharing your solution as an Answer? – DMGregory Jun 02 '20 at 01:51