Wow weird. Is that a 'debug draw' rendering of the scene?
Yes.
I use Slick 2D for rendering.
I can see from your scene that you are no newbie, but just in case... is the polygon wound the right way?
I might be a newbie since I don't understand what you mean by "polygon wound" 😛
Do you mean if the corners of the polygon are read in the correct order, like, clockwise or counterclockwise?
Yes, I think I'm creating the polygons the right way, as far as that goes.
Yeah that's right. This sounds like a bug somewhere. The only thing that is a little unusual is the large sizes of your dimensions but it should still work ok.
Is this an up-to-date version? I seem to recall toucansam updated the java port recently, maybe you could check into that.
The dimensions are large because I give them as pixels (when zoom is in 1:1 ratio), but then I have a method to convert the dimensions into smaller values so that it's fine for JBox2D. I have a very recent version of the Java port, and I don't think such a huge and obvious bug could be in the port. The problem must be in the way I use it.
Have you tried to make a static body where the origin is far away outside of the body?
For instance, if the origin is at 0,0 then the actual shape would be somewhere around 10,10 which is a huge offset in JBox2D's coordinate system.
I don't know if the origin (that is used when a body is created) is used for the collision detection at all, but at least by tweaking it I managed to fix one of the walls.
The location of the body's reference point aka location should not make any difference, especially for static bodies. It's more likely that the locations of the fixture itself that has relevance...
Are you able to narrow this down to a very small test case that shows these symptoms? You might be able to get that nice person 'Somebody' to look at it. It seems like something that should be looked at. I still have my doubts that it is happening in the C++ version.
can you verify which version of the engine you're using?