Verlet and CCD (moving triangle vs. moving particle)

Please don't post Bullet support questions here, use the above forums instead.
speps
Posts: 1
Joined: Sat Oct 09, 2010 3:26 pm

Verlet and CCD (moving triangle vs. moving particle)

Post by speps »

Hello,

I am working on a simple project and for user manipulation I need to handle collisions between particles and triangles, both moving. The user can drag the particles and there are constraints maintaining them in place (distance constraints). I am using Verlet (basic version) for integration because it's easy to implement constraints and I didn't need anything more advanced.

While the user is dragging the particules (which are moved by the mouse and a distance constraint), I want to be able to handle the collision between the particles of the system and the triangles formed by some of these particles. No particle should be able to pass through the triangles.

Currently, I am using a simple segment-triangle intersection test. The segment being formed by the previous particle position and the current one and using only the current position of the triangle vertices. I tried to use the previous position of the triangle vertices too. The problem is that sometimes even when using both previous and current positions for triangle and particle, I have situations where the whole segment crosses both triangles :

Code: Select all

pc_pp -1 pc_ppp -1 pp_pp -1 pp_ppp -1 cpp False ccp False
pc_pp 1 pc_ppp 1 pp_pp 1 pp_ppp 1 cpp False ccp False
There are side tests between the particle position (current and previous) and the planes formed by the triangles (current and previous). Maybe there is a problem with how constraints move the position of the particles. Currently, I have an ApplyImpulse method which only modifies the current position of the particle.

I am currently a little stuck with my method, maybe someone else's perspective could help me. I tried to search for continuous collision detection and found this :
ftp://ftp.cs.ubc.ca/local/techreports/2 ... 009-03.pdf
which explains how to decompose two triangles into 3 tetrahedrons but it uses it for moving edge vs. moving edge tests.

EDIT : I found something here : http://www.geometrictools.com/SamplePhy ... eBody.html
The problem in my case is that because each vertex of the triangles can move independently, I have rotating triangles which can't be handled by the algorithm described here. Also, I read that sweep tests for rotating objects are not well handled in general. Maybe I need to find another solution to the initial problem, if anyone has suggestions.

Thanks!

Rémi.
raigan2
Posts: 197
Joined: Sat Aug 19, 2006 11:52 pm

Re: Verlet and CCD (moving triangle vs. moving particle)

Post by raigan2 »

For moving-point-vs-moving-triangle, this is the same problem as for e.g a cloth sim; the paper "Robust Treatment of Collisions, Contact and Friction for Cloth Animation" by Bridson/Fedkiw/Anderson suggests that you first solve a cubic equation to find the time at which the point and triangle are coplanar, and then do a point-in-triangle test to see if the collision actually happened.