my code for the hello Box2d looks like this:
int main()
{
b2World world(b2Vec2(0.0, -9.8));
b2BodyDef bodyDef;
bodyDef.position.Set(3.0, 3.0);
bodyDef.angle = 0.0f;
bodyDef.type = b2_dynamicBody;
b2PolygonShape shape;
shape.SetAsBox(10, 10);
b2FixtureDef fixtureDef;
fixtureDef.shape = &shape;
fixtureDef.density = 1.0f;
fixtureDef.friction = 0.3f;
body = world.CreateBody(&bodyDef);
body->CreateFixture(&fixtureDef);
while(true)
{
world.Step(1/60, 10, 8);
std::cout << body->GetPosition().y << std::endl;
//world.ClearForces();
}
}What am I doing wrong?






