Hi !
Featured games (85)
games approved by the League of Dukes
Games in Showcase (636)
Games in Android Showcase (178)
games submitted by our members
Games in WIP (688)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  JBox2D  (Read 6339 times)
0 Members and 1 Guest are viewing this topic.
Offline quixote_arg

Junior Devvie

Projects: 1


« Posted 2007-10-20 16:20:26 »


We've released the first beta of JBox2D, a Java port of Erin Catto's Box2D

Check out some demos at, source code is hosted at

Soon (technical problems!) we'll host the first jar release, in the meantime play with the demos and check out the source code

As usual, comments, suggestions et al are most welcomed
Offline Matzon

JGO Knight

Medals: 19
Projects: 1

I'm gonna wring your pants!

« Reply #1 - Posted 2007-10-20 18:40:45 »

how does it compare to phys2d ?

Offline kevglass

« JGO Spiffy Duke »

Medals: 272
Projects: 25
Exp: 18 years

Coder, Trainee Pixel Artist, Game Reviewer

« Reply #2 - Posted 2007-10-20 20:59:51 »

Awesome stuff guys, just tried it out locally on my current game - very promising.

Box2D (not Lite) has a few new joints and compound shapes that I'm interested in. The really great feature thats been promised by Erin is continuous collision detection. If that goes in, gets ported to Java and proves to be performant enough I'm loving it! Smiley


Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline Matzon

JGO Knight

Medals: 19
Projects: 1

I'm gonna wring your pants!

« Reply #3 - Posted 2007-10-21 05:29:38 »

nice job. However I am a bit concerned about the structure of the code. Looks very un-java (package names for instance). Good do with a refactor.
Of course the structure might be as it is to ease porting ?

Offline Orangy Tang

JGO Kernel

Medals: 57
Projects: 11

Monkey for a head

« Reply #4 - Posted 2007-10-21 11:16:30 »

Looks good but runs very slowly here (1-2fps). Is that because of unoptimised JBox2D code or because of Processing?

[ - Play Growth Spurt, Rescue Squad and Snowman Village ] [ Rebirth - game resource library ]
Offline quixote_arg

Junior Devvie

Projects: 1


« Reply #5 - Posted 2007-10-21 14:34:03 »

it's an alpha/beta release, where the demos are working and that's it

we still need a lot of work in making it java-friendly, optimizations, etc

stay tuned!
Offline ewjordan

Junior Devvie

« Reply #6 - Posted 2008-03-30 08:31:50 »

Just wanted to bump this thread and take the opportunity to post a link to the latest JBox2d demos applet:

I just finished up porting version 2.0 of Box2d, which now has continuous collision detection (turned on on a per-body basis, though everything is swept against static objects).  We're not quite at the release stage yet (mainly just working on documentation/cleanup/optimization now, as well as porting the rest of the examples), but anyone that's interested is encouraged to grab a recent build from our SVN repo at  A not-quite-as-recent .zip file is also available at, but that's not updated as often.

There's a Box2d Java thread at the Box2d forums (, feel free to drop a line if you have problems or anything like that.  I'll post here as well when we officially release.

BTW, if you're getting low frame rates, it's a bit of both Processing and JBox2d at fault, Processing because I put it into full software rendering mode for best compatibility (Java2d mode was really causing problems on some computers, dropping frames and all that), which doesn't work very quickly with a 640x480 canvas and thousands of lines to draw, JBox2d because I haven't optimized this version at all yet (I know where most of the time is spent, though, so that will come - probably a factor of 2 improvement, if I had to guess).  The stress test examples aren't meant to run at 60 fps, I use those for optimization purposes, but most of the others should run at least usably on a recent computer (I get roughly 60 on all of them except the stress tests on my Macbook Pro 2.4 ghz).  Soon I'll get some OpenGL accelerated tests up so we can see what it's like with the hardware in control of the graphics.
Online EgonOlsen
« Reply #7 - Posted 2008-03-30 09:43:30 »

The demo applet doesn't work:  Cry

Exception in thread "Thread-15" java.lang.NoClassDefFoundError: javax/vecmath/Color3f
   at org.jbox2d.testbed.AbstractExample.<clinit>(Unknown Source)
   at org.jbox2d.testbed.TestbedMain.setup(Unknown Source)
   at processing.core.PApplet.handleDisplay(
   at processing.core.PGraphics.requestDisplay(

Offline ewjordan

Junior Devvie

« Reply #8 - Posted 2008-03-30 10:21:46 »

Ah, crap.  I must have vecmath installed locally (I guess OS X does by default).  Well, I'll have to work this out tomorrow, this might take some debugging (my build script for whatever reason won't let me add vecmath.jar when it does its thing)...sorry about that!

Gotta get rid of that vecmath dependency anyways, since it's GPL and JBox2d is trying to be zlib-only - I guess this gives me a good excuse to make that a priority!

Nevermind, fixed it just now - took out the vecmath stuff (was just using Color3f as a holder anyways) and replaced it with my own code.  Sorry I missed that at first!

One thing I notice that still really disturbs me, the memory usage goes up and up if you keep reloading the applet...I suspect that means the previously loaded copies never unload (I also had to remove any static state variables or I discovered they never get reset when you reload - some searching shows that this is Not A Bug, but man, is that irritating and unexpected!).  Eventually I run out of heap space and the browser sometimes even crashes.  Does anyone know a way around that, or is it just another one of those things that make Java suck in the browser? (It also might be a Processing bug, I'm not sure - if Processing's internals hold on to a single static reference to my controller, that's going to leak the entire active heap right there)
Online EgonOlsen
« Reply #9 - Posted 2008-03-30 13:54:22 »

Works fine now... Grin Great work, i like the demos.

Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline ewjordan

Junior Devvie

« Reply #10 - Posted 2008-05-08 22:34:24 »

Just figured I'd post an update here - I just finished updating JBox2d to version 2.0.1 of Box2d.  Continuous collision detection is pretty stable now, and most things seem in line with the C++ engine.

JBox2d is released under the zlib license.

Bug reports/feature requests are best directed to this thread at the Box2d forums:

Some links:

- Demos (Note: this is still the 2.0.0 demo set, I'm still getting around to updating it to 2.0.1)
- Homepage (also not updated recently)
- SF page
- Snapshot .zip file of project
- SVN repo:
- Full .jar (1.2 MB, with Javadocs, source, examples) - note that this also depends on Processing's core.jar (LGPL license) in order to run the testbed
- Trimmed .jar (156 kb, library only), should have no external dependencies

Also, as a plug, my brothers (mostly) and I (a bit) are currently working on Pulpfizz, a Pulpcore/JBox2d integration under a BSD license that will hopefully turn into a full featured and easy way to make 2d physics based games, wrapping and simplifying the JBox2d API a bit and tuning it specifically for Pulpcore.  The project is still pretty young, it's only been in development for a few weeks, but amongst ourselves we're now doing a bi-weekly game making contest using the engine, so it's going to see a lot of development and use over the next months - if you're interested in using Pulpcore with JBox2d it's probably worth keeping an eye on, it will likely be the easiest way to do so once it's mature.
Pages: [1]
  ignore  |  Print  
You cannot reply to this message, because it is very, very old.

Dwinin (73 views)
2015-11-07 13:29:08

Rems19 (81 views)
2015-10-31 01:36:56

Rems19 (78 views)
2015-10-31 01:32:37

williamwoles (107 views)
2015-10-23 10:42:59

williamwoles (93 views)
2015-10-23 10:42:45

Jervac_ (111 views)
2015-10-18 23:29:12

DarkCart (135 views)
2015-10-16 00:58:11

KaiHH (118 views)
2015-10-11 14:10:14

KaiHH (157 views)
2015-10-11 13:26:18

BurntPizza (172 views)
2015-10-08 03:11:46
Rendering resources
by Roquen
2015-11-13 14:37:59

Rendering resources
by Roquen
2015-11-13 14:36:58

Math: Resources
by Roquen
2015-10-22 07:46:10

Networking Resources
by Roquen
2015-10-16 07:12:30

Rendering resources
by Roquen
2015-10-15 07:40:48

Math: Inequality properties
by Roquen
2015-10-01 13:30:46

Math: Inequality properties
by Roquen
2015-09-30 16:06:05

HotSpot Options
by Roquen
2015-08-29 11:33:11 is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!