2.0 Progress Update

2.0 is making good progress. It is a big task. Keep in mind that this is a hobby for me, so my time allowance is limited.

Anyhow, there is a neat test in the SVN test bed now. It shows a ball and stick ping-ponging at high speed inside a room with thin walls. The walls are hyper-elastic but the ball-vs-stick collision is inelastic. This leads to some interesting behavior, as well as stressing the CCD code heavily. You can also throw the bomb in there for extra excitement.

Due to the hyper-elastic walls, I found some things could move so fast that some numerical errors happened. So I have introduced some velocity limits that are reasonably generous. Hopefully you agree when you see how fast things move in the test.

My favorite part of the test is running in single step mode. Press the single step button, then press the space bar down with the single step button still in focus. With auto-repeat on the keyboard, you can control the movement of simulated time by tapping and/or holding the space bar. Watch as the fast rotating stick and the fast moving circle come into almost perfect contact and then move on. This shows why I picked a CCD method that handles rotations.

I have just a couple more features to add for 2.0 and some documentation work. I'd like to make 2.0 a solid release, so it would be nice to get some volunteers to test a release candidate once I reach feature completion. I'll post here when the release candidate is ready.

Cheers,
Erin
I'm keen to help test.
I am currently messing around with Box2D 1.4.3 for a project, but there are some new features in 2.0 that I'll make use of (Ray cast, sensors).
When you have a RC ready I'll be more than happy to use it and start implementing those features into my project 🙂

Thanks for Box2D, it is awesome!
Hi,

After checking out the svn version, I have updated my patch against the svn version and updated my cmake files.

You can retrieve it in patch_svn.tar.gz files.

To apply the patch, fetch the svn version, go to box2d directory, untar patch_svn.tar.gz (tar xfvz patch_svn.tar.gz), patch the source code using patch -p 1 < patch_against_svn.diff, then run 'cmake .' and make. Wait the end of the compilation and run the demo with ./Examples/framework.

Yannig
danzel wrote:some new features in 2.0 that I'll make use of (Ray cast, sensors).


Those are both in 2.0? I didn't think those were coming for awhile now.. *runs off to check TODO.txt* Wow... Ooh..and a car example. I'm very very excited about this! These are all things I wanted in my project, so I'll be sure to make heavy use of them and report any bugs.
I can't wait, I can't wait. I'm more excited than... well than a lot of thing...but most of the saying that fit here are pretty rude, so I'll leave it up to your imagination.

I'd be willing to help if there's anything I can do.
Great job Erin. 🙂
I can't wait for a stable release of 2.0.
Update:
Most features are in for 2.0 and the SVN version is fairly stable. I still need to develop some new tests and update the manual.

Continuous Physics Update:
I decided I didn't like the visible stalling seen from not conserving time. I am presently trying to develop a full time step solution. This is a research project with many avenues to explore. Sorry for the delay, but I decided to have a "when it's done" policy for 2.0. We will all benefit from a quality release.
I decided I didn't like the visible stalling seen from not conserving time. I am presently trying to develop a full time step solution.

I think this is a great idea, even if it is a tricky open problem - I would love to hear about any experiments or possible approaches that you are playing around with.

From what I can tell, the situation seems to be that you can achieve any two of the following:

1) Time is conserved
2) An upper bound can be placed on the real time taken per step
3) Physics is done "properly," meaning that collisions are resolved in the proper TOI-sorted order and without any hacks

The conflict arises because an unbounded number of collisions may happen amongst a very small number of objects in one time step (put a moving circle in a box and by tightening the box around the circle you can cause as many collisions per step as you desire).

I think the key will be to figure out a way to violate 3) in the least offensive manner, such that for simple situations (only a few collisions per step/per body) everything is simulated perfectly, but if there are large numbers of collisions you are able to terminate the collision loop in a plausible way without actually handling each collision separately.

One early termination hack that I considered was to position correct each body out of the swept volume of the other bodies and apply an impulse proportional to the distance deltas, but I never actually tried it. There are some problems that I never worked out good solutions to (doesn't take rotation or momenta of swept bodies into consideration, for one, and static bodies really need to be separately considered), but I didn't spend much time on it, so it might be workable. Projection is pretty much the only way I can think of to deal with a heavy thin plank sweeping through a swarm of particles in one time step if you don't want to simulate each collision and calculate all those TOIs but you also don't want any particles to be left in the space that is swept through.
Update:

The SVN version now has full step continuous physics. The bouncy room no longer has stalling artifacts. Same for the pyramid.

I'm using contact islands to solve TOI events. These islands don't include slow contacts or joints. So you will seem some contraint errors. I'm trying to keep the TOI islands small for performance.

Time of impact is now computed by using progressively smaller core shapes. If the solver can't recover then eventually the shapes will tunnel. This progression was necessary avoid making leaps of faith when resolving overlap.

It seems that I have solved the major problems I was having with continuous physics. So unless something else comes up, 2.0 should be advancing smoothly now.
Looking really good, Erin.
Great work 😀

Original thread: https://box2d.org/forum/viewtopic.php?t=246