Box2D Java

ewjordan wrote:
Just wanted to throw up a link to a JBox2d 2.0 testbed applet for you guys to check out: http://www.jbox2d.org/v2demos/
Anyone that has the time to respond, I'm interested in a few things:

1) Does the applet successfully load + run on your machine? If not, what is your setup (browser, Java version, OS)?
2) If you reload the page, does the applet still run?
3) What kind of frame rates are you getting on the stress tests? (Pyramid, Domino Tower, and Circles)

1) and 2) are important to me in my decision as to whether or not to switch away from an applet based demo to perhaps a Web Start one or something else. I'm trying a new applet loader Javascript trick that's supposed to somewhat ease the pain of applets, but I'm still skeptical...there are so many issues with applets that I'm starting to wonder whether it's even worth trying to deal with them at all.


Both 1) and 2) worked here. Applet loaded successfully, refreshing the page and it reloaded. However, I ended up having to kill the Firefox process (Windows XP) as Firefox started to behave erratically after closing the applet tab. It wouldn't respond to a "quote" on this reponse, etc. It's done that before a few times, might be related to the Javascript.

Frame rates were fairly consistent, 55-60 fps, except for the stress tests where the rate was down to 15-20.

Bill
It doesn't work for me: Vista, IE7 and the latest (6?) Java version. The old demo's work well though.
ewjordan wrote:
Just wanted to throw up a link to a JBox2d 2.0 testbed applet for you guys to check out: http://www.jbox2d.org/v2demos/


I get "Error: preloading class is missing" on Firefox/windows and a mostly blank screen on IE7.
In what shape is the source code? I tried downloading off the trunk, but it wasn't compiling for me. It looked like the packages were being rearranged, and not all the classes got moved. (Like "BoxDef")
Ok, screw the preloader stuff I was trying, I'll just embed the thing as a usual applet - the preloading is just not working consistently.

pcraven: sorry, I forgot to mention that - some of the files in the org.jbox2d.tests package are not compiling yet (neither is org.jbox2d.testbed.TimingTest or the util.* package), as I haven't translated them to 2.0 syntax. BoxDef, for instance, is gone altogether in 2.0, now replaced by PolygonDef::setAsBox(). Am I correct that those are the problems you're talking about? (if BoxDef is still there, that's an SVN update problem - your structure should match what you can browse at http://jbox2d.svn.sourceforge.net/viewv ... rg/jbox2d/)

Within the next couple days these things will all get finished and there should be no syntax errors in the project; until then, TestbedMain does not have any dependencies on anything old, so Eclipse should be able to compile it without problems if you tell it to ignore the errors when it complains, and the core of the engine should be fine (the org.jbox2d.collision/common/dynamics packages).

(Edit: the current SVN should now be error free, I removed the remaining unfinished demos and will add them in as I complete them)
Ok, the trunk compiles fine for me now.

I'm looking for a better way to get my 'intro' students to learn classes and such. The 'Alice' program is too easy and doesn't get them writing code. I was wondering if jBox2D would work.

I want to see if it could be mixed with Rhino so that students could type commands and see them play out in the virtual world. I'll have to get this to work in a windowed app, and not in an applet.

I'll let you know if I get anywhere on it.
pcraven wrote:
I'm looking for a better way to get my 'intro' students to learn classes and such. The 'Alice' program is too easy and doesn't get them writing code. I was wondering if jBox2D would work.

I want to see if it could be mixed with Rhino so that students could type commands and see them play out in the virtual world. I'll have to get this to work in a windowed app, and not in an applet.


That sounds great! Keep us posted!
BTW you can use the scripting api to interact with Rhino (which is already included in JDK 6)
Right, scripting in Java 1.6 is dead-simple. Plus, it is a lot of fun.
I've never used Rhino, but as long as you can figure out how to draw stuff and handle all the UI, it shouldn't be too difficult. The place to start is probably by implementing the org.jbox2d.dynamics.DebugDraw interface using whatever graphics library you prefer, then looking at org.jbox2d.testbed.AbstractExample (and maybe TestbedMain) and figuring out what functionality you need. I've tried to keep AbstractExample as neutral wrt drawing as I possibly could; I think the only place it really depends on Processing is for image handling, which I couldn't find any way around. Windowed vs. applet should not be a problem - TestbedMain itself will run as an app.

On another note, quixote_arg and I were talking the other day, and we might start to move towards PulpCore (http://www.interactivepulp.com/pulpcore/) for the testbed, or at least doing some demos in it. It seems to have quite a bit more speed for game stuff than Processing, without requiring signing like JOGL or LWJGL, and the applet loading is very smooth. Comments/suggestions are welcome from anyone that's used it, or has other suggestions (I'm still planning Slick demos, too, should be coming very soon now).
Big dap to all who is involved in JBox2D. I'm having fun playing with this library. I hope it keeps up with Box2D.

Thanks
Jeff

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