Question about coding a Collision Detection System

Please don't post Bullet support questions here, use the above forums instead.
Dani3L
Posts: 28
Joined: Tue Jun 30, 2009 6:56 am
Location: Switzerland

Question about coding a Collision Detection System

Post by Dani3L »

Hi

I'm a beginner in physics simulation. I'm trying to implement a C++ framework used to simulate collisions between rigid bodies in 3D.

I'm coding the collision detection system. For this, I use OBB to represent the shape of the bodies and I use a Separating Axis algorithm to compute the first time t0 when the first collision occur. If there is no collision for the next timestep dt, I advance the simulation of the timestep dt. If there is a collision at time t0 (t0 <= dt), I advance the simulation at time t0.

Now I have to compute the contact set of colliding bodies at time t0. For this I have the following Contact types :

Vertex-Vertex, Vertex-Edge, Edge-Edge, Vertex-Face, Edge-Face and Face-Face contact.

So for instance, if I have a Vertex-Edge collision, I will remember the Vertex point in the collision contact set.

The most complicated cases are Edge-Edge, Edge-Face and Face-Face collision because :

- For Edge-Edge => I have to compute the intersection between two Segments (an edge is represented by a Segment). We know that both Segments are on the same line.
- For Edge-Face => I have to compute the intersection between a Segment an a convex polygon (we know that the segment and the polygon are coplanar)
- For Face-Face => I have to compute the intersection between two coplanar polygons

I have data structures Segment (for segments in 3D that is represented by two points) and Polygon (that is a set of 3D points that define the polygon).

What I want to know is the following :

- Do you think the way I'm computing collision detection is a good one (By good one I do not mean the most efficient, because I'm a beginner, I first want to implement an algorithm that is easy to understant ) ?
- Do you know some algorithms to compute my Edge-Face and Face-Face intersections ? (I have already coded the Edge-Egde case)


I know that a lot of people in this forum knows a lot about collision detection so I just want some advice about my implementation. So thank you very much in advance.
Dani3L
Posts: 28
Joined: Tue Jun 30, 2009 6:56 am
Location: Switzerland

Re: Question about coding a Collision Detection System

Post by Dani3L »

Nobody can help me a little bit ?
Dirk Gregorius
Posts: 861
Joined: Sun Jul 03, 2005 4:06 pm
Location: Kirkland, WA

Re: Question about coding a Collision Detection System

Post by Dirk Gregorius »

Look at the presentations by E. Catto here: www.gphysics.com
aokman
Posts: 30
Joined: Thu Oct 01, 2009 2:17 pm

Re: Question about coding a Collision Detection System

Post by aokman »

I found some method to solve edge-face and face-face case.
The algorithm uses polyhedron clipping to clip edge against the polyhedron
which contains the face, or to clip one face of one polyhedron against
the polyhedron which contains the other face.

I downloaded a archive about the algorithm form internet, so I post it to
attachment here.

I hope it may help you.
You do not have the required permissions to view the files attached to this post.
Last edited by aokman on Tue Oct 06, 2009 5:43 am, edited 1 time in total.
Dani3L
Posts: 28
Joined: Tue Jun 30, 2009 6:56 am
Location: Switzerland

Re: Question about coding a Collision Detection System

Post by Dani3L »

Thank you very much. I'm gonna see all of this.