The rectangles look like the AABBs that Box2D uses to do efficient collision checks, usually you don't need to pay any attention to it at all. What is it preventing you from doing?
The small space could be the gap that is left between bodies to help them settle and keep stable. The default setting is 0.005 units which is five millimeters for typical usage. If this appears large in your scene, maybe your objects are very small?
@force- thanks, the problem is that as i mentioned in the figure , if i take two triangles and try and fit a square the way in pic the two triangles just get thrown away and there is huge gap also as they do not touch each other sides due to some reason may be the area that they cover in shape of a square, i had seen some box2d games where this is not the case and the objects also touch each other quite well, is that possible ??
It sounds like the triangle is not being defined properly. How are you defining it? By extending a shapes class? By using polygon vertices? You can turn debug draw on for the world to see how the shapes look to Box2D, that'll let you know where things are going wrong.
That gap looks to big to be the fault of the tiny "expansion" Box2D gives to shapes.
As mayo mentioned, turn debug draw on and see what kind of shapes is box2d actually using.
This is just a guess, but for the Box class, the Flash display object (sprite, movie clip) has to be centered.
I am using the shapes.Box class to define it, is there any other class that i can use for triangles....also how can i turn on debug draw, i can't seem to find the option 🙁
wck.World has a property, debugDraw. Set that to true before the world is created (added to stage) or use the component inspector on your world.
You can extend shapes.Poly3 if you want an easy way to make triangles. There's some triangles in the demos... look at how they are set up.
@mayo - thanks a lot ...
Regards
Jin