Dermiste wrote:
All right that's what I thought ... do you know if somehow it's possible to do it only with one shape ?
In the current release state of Box2D AS3 2.1a, unfortunately not, and the hidden-and-non-working way does not technically create one shape either. Here's a post about it with one of the developers of the AS3 port:
viewtopic.php?f=8&t=4651There are b2EdgeShapes (which are infinitely thin lines that stuff can collide with), but they can only be static. You only have to specify the ends as vertices, so you don't have to worry about angles and sizes of polygons. I'm not sure if b2EdgeShapes work in 2.1a because I've never used them.
In the old Box2D version (2.0.x), you can use b2EdgeChainDef to make a bunch of b2EdgeShapes, but it can only be static (cannot move). The b2EdgeChainDef does not work with 2.1a simply because it's old code that's carried over from 2.0.x and Box2D 2.1 does not use shape definitions.