Bullets and thin walls

Hi,

The following screenshot shows several dynamic bodies (balls) falling on static ones (walls).

Attachment:
jbox2D-incorrent_collision_detection.png
jbox2D-incorrent_collision_detection.png [ 10.75 KiB | Viewed 488 times ]


Except for the for one, all of the balls penetrate into the walls. My first attempt was to set the balls as bullets (Body.setBullet(true)). The second one was to enable continuous physics (World.setContinuousPhysics(true)). None of the attempts solve the problem.
I did it based on the documentation, wiki and this thread.

I should say the walls are made by combining several shapes. The wall that isn't penetrated is made of "large" squares, while the others are made of small and thin rectangles and L shapes. It seems that the thin bodies are at fault, but the wall labeled A is larger and is penetrated (but still made of thin shapes).

I'd appreciate any clarification/solution. Just ask if you need more information.
Thank you.
You seem very thorough so I hate to ask but do you specify shapes in a counter clockwise direction?
The single shapes alone are specified in clockwise direction.
Okay, because if I specify them clockwise things go through as well.

EDIT: This makes sense if you use setAsBox() on the large square.
is this solved? counter-clockwise works?
Sorry for the late response.

I altered the thickness of the walls and the order the points are defined. Here are the results:

  • Thickness = 0.2, CW -> FAIL (original test case I posted above)
  • Thickness = 0.2, CCW -> FAIL
  • Thickness = 0.4, CCW -> SUCCESS
  • Thickness = 0.3, CCW -> SUCCESS
  • Thickness = 0.2, CCW -> SUCCESS
  • Thickness = 0.2, CW -> SUCCESS

Note: thickness is relative to the shape's dimensions and ranges from 0.0 to 1.0 (think of textures coordinates). It isn't a measure of world or pixel units.

As you can see, I ended up with the original test case, but this time it works and there's no need to set the balls as bullets or enable continuous physics. The first platform (A) still has a problem, though - only the inner points are combined and it still can be penetrated.

I'll investigate more on this and post if necessary.
Glad to see you are making progress. Truthfully, I can't really comprehend what you are up to. Does this have to do with an editor?
Strange. Now, only shapes declared in CCW order works fine. Well, as long as it works correctly...

Michiel wrote:
Truthfully, I can't really comprehend what you are up to. Does this have to do with an editor?

I'm sorry but, unfortunately, I'm not allowed to tell more about it.

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