Box2DDebugRenderer for Java?

Does JBox2d have a debug render class?
Are you talking about the engine's DebugDraw feature? Yes this implemented with J2D (and probably OpenGL in the future) and is used in the testbed.
How would I use this in my Slick 2d game. If you didn't know Slick2d is a library on top of LWJGL, which supports OPENGL, so I assume there should be a way to 'port' DebugDraw over to Slick2d game?

Could you show some example use of the code? I looked at the Jbox2d repository and all I saw where some functions with no code in them etc.
liamzebedee wrote:
Could you show some example use of the code? I looked at the Jbox2d repository and all I saw where some functions with no code in them etc.


Right, you were probably looking at the interface. The engine uses that interface to draw the world. You would have to make a class that implements that interface with code for draws with whatever Slick2d provides. You'll need a viewport transform in there as well for a camera. You can take a look at how the testbed does it:

DebugDrawJ2D:
http://code.google.com/p/jbox2d/source/ ... awJ2D.java

OBBViewportTransform (for the camera):
http://code.google.com/p/jbox2d/source/ ... sform.java
Ok so I've made my Slick2dDebugDraw class. A question. How would I set the appropriate OBBViewportTranform properties?
The viewport transforms determines how the various drawing inputs (shape positions, etc) are transformed before they are drawn. Thus it is effectively your camera. set the center of the "camera" by calling setCenter, and set the width and height of the view by calling setExtents (with the half-width and half-height)

In fact, there is a method called setCamera(x,y,scale) in there for you. scale is relative to the physics world. I would say 10 is a good scale.

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