Jump to content

  • Log In with Google      Sign In   
  • Create Account

FREE SOFTWARE GIVEAWAY

We have 4 x Pro Licences (valued at $59 each) for 2d modular animation software Spriter to give away in this Thursday's GDNet Direct email newsletter.


Read more in this forum topic or make sure you're signed up (from the right-hand sidebar on the homepage) and read Thursday's newsletter to get in the running!


Questions about position correction


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.

  • You cannot reply to this topic
2 replies to this topic

#1 Finalspace   Members   -  Reputation: 333

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.


Sponsor:

#2 Randy Gaul   Members   -  Reputation: 544

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



#3 Finalspace   Members   -  Reputation: 333

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.






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.



PARTNERS