Hey everyone, after creating a shape and body in a world with gravity i can use the debugger after a few seconds and see that it has fallen. my problem is that i cannot make a shape respond to ApplyForce with or without gravity. my code is below. thats in advance!
Code:
gravity = new b2Vec2(0.f, 0.f);
world = new b2World(*gravity);
.............
b2BodyDef bdBall;
bdBall.type = b2_dynamicBody;
bdBall.position.Set(0.f, 15.f);
ballBody = world->CreateBody(&bdBall);
b2CircleShape circleShape;
circleShape.m_radius = 1.f;
b2PolygonShape dynamicCircle;
dynamicCircle.SetAsBox(1.0f, 1.0f);
b2FixtureDef fixtureDef;
fixtureDef.shape = &dynamicCircle;
fixtureDef.density = 1.f;
fixtureDef.restitution = 1.f;
ballBody->CreateFixture(&fixtureDef);
ballBody->ApplyForce(b2Vec2(10.f, 10.f), ballBody->GetWorldCenter());
world = new b2World(*gravity);
.............
b2BodyDef bdBall;
bdBall.type = b2_dynamicBody;
bdBall.position.Set(0.f, 15.f);
ballBody = world->CreateBody(&bdBall);
b2CircleShape circleShape;
circleShape.m_radius = 1.f;
b2PolygonShape dynamicCircle;
dynamicCircle.SetAsBox(1.0f, 1.0f);
b2FixtureDef fixtureDef;
fixtureDef.shape = &dynamicCircle;
fixtureDef.density = 1.f;
fixtureDef.restitution = 1.f;
ballBody->CreateFixture(&fixtureDef);
ballBody->ApplyForce(b2Vec2(10.f, 10.f), ballBody->GetWorldCenter());