PDA

View Full Version : Ragdoll physics, line vs polygon testing



Ingemar
20-08-2011, 05:46 AM
I am working on a ragdoll animation as part of a new game. Some of it was quite easy, I have a bunch of sticks connecting particles with rigid joints. No problem there. I can also collide the particles against a polygon. But I also need to collide the sticks against the polygon, and this is more complicated.

What strategy would you use for that problem? (I mean, except for using Newton or Chipmunk Physics.) I have a decent line-to-polygon test, but it is hard to avoid numerical problems, roundoff problems and violent jerks in the motion. My current approach is to push the stick if there are TWO intersections.

Any ideas? What strategy would you suggest?

Carver413
20-08-2011, 10:20 PM
you didn't really say if it was 2d or 3d so maybe this will help.
http://sourceforge.net/projects/pappe
and for 2d
http://lazarus.freepascal.org/index.php/topic,13626.0.html
don't know if they have what you want but perhaps they will be useful anyway

paul_nicholls
21-08-2011, 07:20 AM
Hi Ingemar, did you see this site?
http://www.gamedev.net/page/resources/_//feature/fprogramming/a-verlet-based-approach-for-2d-game-physics-r2714

Maybe you have, but if not, it might help :)

cheers,
Paul

Ingemar
21-08-2011, 11:18 AM
Hi Ingemar, did you see this site?
http://www.gamedev.net/page/resources/_//feature/fprogramming/a-verlet-based-approach-for-2d-game-physics-r2714

Maybe you have, but if not, it might help :)

cheers,
Paul

I have seen it but overlooked it, since the collision response part is a bit too brief, and that's the hard part! But I have tried the demo, and it works surprisingly well! So I guess I'd better give that collision response section another try.

And I do work in 2D. That's enough for a simple physics-based game.

Ingemar
22-08-2011, 05:26 AM
Thanks for the pointers! I think I have a working system now. BTW, here is the page that was my inspiration (although it lacks collision handling): http://www.aquinhasa.com/?p=56

paul_nicholls
22-08-2011, 05:41 AM
Thanks for the pointers! I think I have a working system now. BTW, here is the page that was my inspiration (although it lacks collision handling): http://www.aquinhasa.com/?p=56

That link doesn't work for me...can't find aquinhasa.com...

cheers,
Paul

Ingemar
22-08-2011, 02:36 PM
That link doesn't work for me...can't find aquinhasa.com...

cheers,
Paul
I just tried it again and it popped right up. Maybe it was temporarily down?

I don't know if my ragdoll will ever be perfect, now I have some problems with sticks passing through polygons again, but I think it is less common than before. The big step was to add a size to every particle, so the actual point is kept outside the polygon. Then I get less problems with numerical precision, which often occurred when a particle was right at an edge.

Ingemar
31-08-2011, 11:06 AM
you didn't really say if it was 2d or 3d so maybe this will help.
http://sourceforge.net/projects/pappe
and for 2d
http://lazarus.freepascal.org/index.php/topic,13626.0.html
don't know if they have what you want but perhaps they will be useful anyway

Now, Pappe does seem interesting. But it doesn't seem to support OSX. Is it mature enough to be worth porting?

BeRo
04-09-2011, 01:35 PM
Now, Pappe does seem interesting. But it doesn't seem to support OSX. Is it mature enough to be worth porting?

I'm the author of PAPPE. PAPPE itself is fully crossplatform, only the demo examples are still win32-only.

Carver413
04-09-2011, 03:58 PM
Now, Pappe does seem interesting. But it doesn't seem to support OSX. Is it mature enough to be worth porting?

I had the demo up and running back when I was still windows. I would say it would be worth the work to port the demo. I have planned to adapt it to my 3.3+ frame work, but havn't gotton that far yet. it's a shame that it isn't seeing more use. most people opt for newton or bullet. perhaps that is why BeRo hasn't really done much to it in a while. I myself like the Idea of having the code vs working with a LIB. JMonkey actually ported bullet to thier engine. too bad it's java.