recrangle multiple fixture

Hello, I think, that I am new in here. How can I create multiple fixture of a 3 rectangles ?
Is this correct ?

b2BodyDef bd;
bd.type = b2_dynamicBody;
b2Body* body = m_world->CreateBody(&bd);

b2FixtureDef fd;
fd.shape = &circleShape;
fd.density = 1;

b2PolygonShape polygonShape;
fd.shape = &polygonShape;

polygonShape.SetAsBox( 1, 1 ); // create first rectangle at 0,0, width 2, height 2
body->CreateFixture(&fd);

polygonShape.SetAsBox( 1, 1 ); // create second rectangle at 0,0; width 2, height 2
polygonShape.centroid = -1, 0; // move rectangle center to -1,0
body->CreateFixture(&fd); // create fixture with the first rectangle

polygonShape.SetAsBox( 1, 1 ); // create second rectangle at 0,0; width 2, height 2
polygonShape.centroid = +1, 0; // move rectangle center to +1,0
body->CreateFixture(&fd); // create fixture with the first rectangle
The SetAsBox function has two versions. One version takes a parameter to let you move the position of the box:
Code:
        /// Build vertices to represent an oriented box.
        /// @param hx the half-width.
        /// @param hy the half-height.
        /// @param center the center of the box in local coordinates.
        /// @param angle the rotation of the box in local coordinates.
        void SetAsBox(float32 hx, float32 hy, const b2Vec2& center, float32 angle);

If you use a nice IDE, it should let you know about these things, or you can check the headers to see what functions are available, eg:
http://code.google.com/p/box2d/source/b ... gonShape.h
OK, thanks. And for what the m_centroid is for ?
I don't think the centroid is intended to be used directly - those variables could probably be private...

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