I need another convex-triangle collision algorithm

Post Reply
snake5
Posts: 13
Joined: Tue Mar 01, 2011 4:04 pm

I need another convex-triangle collision algorithm

Post by snake5 »

I noticed that convex-triangle mesh collisions are resolved to a convex-triangle(convex) collision algorithm. Since I don't want the edges to make my game characters(*1) jump and I don't need my bodies (like the parts of a ragdoll) to get stuck between the sides of a wall or something like that, I thought that changing the collision algorithm here could help. The requirements for the algorithm are simple - do everything just like before, just avoid generating triangle backface and edge intersection points.(*2)

So here's where I need your help.
0. Is this a good idea? I'd like to know all the possible problems I could encounter and if I haven't noticed something that will need to be done in the process of adding a new convex-triangle algorithm.
1. If there is an algorithm already prepared to do everything I want, just not enabled, I'd like to know about it.
2. If there is no algorithm, I will probably build and add one myself. I'm counting on the support of the existing convex-convex algorithm and would want to simply remove the invalid contacts. Any information that could help me pinpoint the exact pieces in code that I must modify would be appreciated.
3. The last step - putting the updated algorithm in the system. I noticed that there's an algorithm lookup system that tries to find the right algorithm. For me to get what I want I would need the lookup system to make a distinction between convex objects and triangles. Can the system do that at the moment or do I have to "short-circuit" the convex-concave algorithm?

P.S. I'm using Bullet 2.76

*1) My game characters are convex hulls, with one bottom vertex, one top vertex and four side vertices.
A height-stretched version of this one: http://img.tfd.com/wn/1E/6CA3D-regular-octahedron.gif
*2) I know that it's possible to patch the contact points in the callback but I'd rather avoid having them at all. If I understand the system correctly, that could speed up collision processing too.

UPDATE: After a tiny bit of poking around the engine, I've found that I can override the default collision configuration to include a different convex-triangle algorithm. All that's left is copying the convex-convex algorithm and removing triangle edge/backface intersection point generation. As I still haven't understood all the convex/gjk/minkowski stuff, I could use some help here.
robb
Posts: 3
Joined: Wed Jul 16, 2014 9:16 am

Re: I need another convex-triangle collision algorithm

Post by robb »

Hey there!

I am actually looking into doing exactly this same thing...
Did you find any answers/figure out how to do this?

Thanks!
Post Reply