Questions about position correction

Started by
1 comment, last by Finalspace 9 years, 8 months ago

Hi there,

i implemented a simple 2d physics system based on the sequential impulse method presented by Erin Catto (2006).

In that paper, position corrections are resolved by adding a velocity bias to the velocity constraint impulse.

My initial tests for this system was like falling boxes from the sky, apply gravity, let it stack, slide a bit. Everything was working correctly, boxes stacks, penetration gets resolved and it was looking good.

Now i added a player rigid body which applies linear impulses to let it move/jump etc. and now the entire system fails.

If the player is penetrating a static body, like moving left and get pushed away to the right, it get half-stucked in the static body and will be pushed apart after a few frames - so that it just touches the static body on the right side.

My conclusion is that using velocity bias as position correction is not a good idea for a game after all - therefore i really want to know, what options do i have to solve this issue?

Advertisement

Post stabilization seems to be the state of the art. Here's what I think is the original paper on the idea: http://www.cs.rutgers.edu/~dpai/papers/ClinePai03.pdf

Erin Catto also talked about this in his last GDC lecture where he referred to the idea as "psuedo impulses". The idea seems to be to take the velocity Jacobian and use it to iteratively solve for position correction, even though the position function is non-linear.

This is all implemented in Box2D (look at the comments in b2Island.cpp, search for "NGS" which stands for Nonlinear Gauss-Seidel). There should be a lot of discussion on the Bullet forums about this idea too, like this: http://www.bulletphysics.org/Bullet/phpBB3/viewtopic.php?f=6&t=1644

Okay, that looks not that easy at all... and porting some parts of box2d seems to be stupid.

In the last 3 years i learned a ton about physics and all that stuff, but now its too much for me - and i know box2d or other physics engines do this much better.

I give up - i will use jbox2d instead.

This topic is closed to new replies.

Advertisement