Tuesday, February 9, 2010

stack in objc

for (float32 x =0.0f; x<300.0f; x=x+1.0f) {
float32 y=1.0f;
// Define the static body.
//Set up a 1m squared box in the physics world
b2BodyDef bodyDef;
bodyDef.type = b2_staticBody;

bodyDef.position.Set(x, y);
b2Body *body = world->CreateBody(&bodyDef);

// Define another box shape for our static body.
b2PolygonShape staticBox;
staticBox.SetAsBox(.5f, .5f);//These are mid points for our 1m box

// Define the static body fixture.
b2FixtureDef fixtureDef;
fixtureDef.shape = &staticBox;
fixtureDef.density = 1.0f;
fixtureDef.friction = 0.3f;

No comments: