Ok, that makes sense.
I have another question:
The accumulated normal impulse is clamped, not the normal impulse calculated in every iteration, correct?
I wondering about the following scenario:
A Box (A) is colliding head on with another Box (B) in free space.
Both boxes have a elasticity of 1.0:
A-> <-B
Collision is detected -> an Arbiter is created.
In The first iterarion, impulse is calculated and applied, the scene should now look like this:
<-A B->
(Which is already the correct outcome).
But now the second iteration comes.
The calculated impulse is negative! But since the accumulated impulse at this point should be zero, the impulse is not clamped.
The result is obvious wrong!
Thanks for clearing things up!
Nathan
Box2D Demo & Tutorial
-
- Posts: 23
- Joined: Fri Dec 08, 2006 10:16 am
-
- Posts: 5
- Joined: Sat Dec 10, 2005 2:51 am
Hi I?ve recently rewrote my physics engine called Physics 2D the newer version is called Physics2D.Net and it is completely written in C#.
The reason I?m posting about this in this thread is that it uses the Algorithms from Box2D. You can download a 2 day old version on SF.Net.
And I had a problem with making a large pyramid like the one in the demo, with the version that splits the impulses The problem was that if I added too many block the pyramid the blocks on the bottom and middle would start shaking very rapidly and the whole thing would start sliding and shifting. I realized this problem was do to the high bias factor but didn?t want to lower it for non-stacking objects. So this is how I solved the problem: during collision detection I have each Body count how many other bodies it is colliding with. Then during the prestep part I calculate a biasMultiplier:
float biasMultiplier = 1/Pow(Min(b1.CollisionCount, b2.CollisionCount),2);
And multiply it against bias for each contact in the arbiter.
This works rather well. The pyramid is a lot more stable.
The reason I?m posting about this in this thread is that it uses the Algorithms from Box2D. You can download a 2 day old version on SF.Net.
And I had a problem with making a large pyramid like the one in the demo, with the version that splits the impulses The problem was that if I added too many block the pyramid the blocks on the bottom and middle would start shaking very rapidly and the whole thing would start sliding and shifting. I realized this problem was do to the high bias factor but didn?t want to lower it for non-stacking objects. So this is how I solved the problem: during collision detection I have each Body count how many other bodies it is colliding with. Then during the prestep part I calculate a biasMultiplier:
float biasMultiplier = 1/Pow(Min(b1.CollisionCount, b2.CollisionCount),2);
And multiply it against bias for each contact in the arbiter.
This works rather well. The pyramid is a lot more stable.
-
- Posts: 197
- Joined: Sat Aug 19, 2006 11:52 pm
-
- Posts: 5
- Joined: Sat Dec 10, 2005 2:51 am
-
- Posts: 231
- Joined: Tue Feb 20, 2007 4:56 pm
-
- Posts: 197
- Joined: Sat Aug 19, 2006 11:52 pm
-
- Posts: 5
- Joined: Sat Dec 10, 2005 2:51 am
Well the code that?s on sourceforge uses the original version of sequential impulses. But I also have been working implementing his newer version (split impulses) and that is what this fix is for. Right now I have the split and non split versions of the Erin Catto?s solver algorithm. My engine supports more then one solver.
-
- Posts: 5
- Joined: Sat Dec 10, 2005 2:51 am
I have released a new version with split impulses.
and my project has moved to google code.
http://physics2d.googlepages.com/
and my project has moved to google code.
http://physics2d.googlepages.com/