Using box2d
(+cocos2d
iPhone) , i have to create a simple rect , that will be hollow- that means having a square , that i can put bodies into it (like a cage ) .
I need to create that body with 4 B2VEC
vectors .
How do i code that ?
The box2D
says that :
Polygons are solid and never hollow
b2vec2
Thanks .
ok , you can do it with a chain shape for example(docs) :
b2Vec2 vs[4];
vs[0].Set(1.7f, 0.0f);
vs[1].Set(1.0f, 0.25f);
vs[2].Set(0.0f, 0.0f);
vs[3].(-1.7f, 0.4f);
b2ChainShape chain;
chain.CreateChain(vs, 4);
//than construct a body with this fixture