• Create Account

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

2 replies to this topic

#1Finalspace  Members

831
Like
0Likes
Like

Posted 31 July 2014 - 07:33 AM

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?

Edited by Finalspace, 31 July 2014 - 07:34 AM.

C#, Java, JavaScript are nice languages - Very Easy to code with - BUT it shakes your brain when you swap back to C or any other low level language...

#2Randy Gaul  Members

2347
Like
0Likes
Like

Posted 31 July 2014 - 10:29 AM

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

#3Finalspace  Members

831
Like
0Likes
Like

Posted 01 August 2014 - 01:40 AM

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.

C#, Java, JavaScript are nice languages - Very Easy to code with - BUT it shakes your brain when you swap back to C or any other low level language...

Old topic!

Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.