Hey there Commander!
I posted on the Slick forum, which has a Phys2d subforum about Box2D, basically Kevin doesn't have time to do a full port, but he is willing to help. ewjordan (mostly) and already have a 1.0.0 alpha version working... some tiny features to polish, a few demos to upload to the to-be-made sourceforge page and we are up and running!
Source code is always downloadable from the SVN repository at sourceforge, but I think that soon we will do a release, and of course post about it on the javagaming forum. Of course, testers, bug reports, improvements and suggestions (donations also, why not 🙄) will be most welcomed
salute!
Nice work guys! Functions very well here 😀 . Can't wait for a release.
Cheers,
Keith 🤓
Considering a .NET port... easier to take java and port or C++?
Java's all ported to classes and references (not pointers)?
J
Hmm, I don't know much about .NET so I'm not sure that I can really point the way as to which port would be easier. Yes, everything is changed from pointers to refs, so if C# requires that, the Java version might be an easier transition; there were also a lot of issues in getting object initializations and copies to happen correctly, as C++ does a lot of this stuff implicitly whereas Java makes you actually force it in a lot of cases. On the other hand, I suspect that a lot of the tougher things we had to deal with to achieve a Java version (stuff where the appropriate syntax just doesn't exist in Java) will be easier in C#, which was explicitly designed to leverage a lot of C/C++ knowledge. Also, we don't have any of Erin's memory-management code, so if you were planning to take that over, the Java version won't help at all.
Also, JBox2D is currently based off of the Box2D 1.0.0 code, though we're hoping to get it updated soon. We just turned out to be far enough along with the 1.0.0 port by the time all the updates came out that it made more sense to finish it up before updating. So you might either want to start off with the 1.3.0 C++ version and refer to the Java version if you have problems, or wait until we get our version up to date.
Also, doing a port of a port could lead to a telephone-like situation, where errors that we've made during translation get compounded by another round of translation. So keep all of this in mind; my suggestion is probably to go from the C++ but to take a look at the Java if you have any problems.
Here's a question for Erin, primarily: we're updating towards 1.4.0 now, and most of the structural changes are done (yay!), so all that's left is pretty much to add the gear and pulley joints, then we'll be in line and current. However, I've still been unable to get rid of one minor problem, even after updating all the code and literally checking each file side by side to make sure we've got all the stuff in there.
The problem is that if I run with assertions enabled, we're tripping one on the equivalent of line 56 in b2ContactSolver.cpp:
b2Assert(manifold->pointCount > 0);
That's within the constructor for b2ContactSolver, in the j loop over the manifolds in a contact. It always seems to happen when it checks manifolds[0] on something whose AABB collides with something else when the objects themselves don't actually collide.
If I just disable the assertion, everything seems to run without trouble, so I'm really not sure what's going on. Do you have any idea what might be going on here, and if it's something that I should be very concerned about?
Ah, perfect - thank you, that led me right to the spot. I was reading an array length (Java stores them with the array) instead of the pointCount variable, which didn't work because the arrays are all initialized to the same size, empty or not.
This should be done in a day or two now, I'll post a note here with some demos when I get those last few files ported.