I had everything working fine with a box, which I defined as per the hello world example.
But I want to use a circle, so I create it like so:
bodyDef.type = b2_dynamicBody;
b2Body* body = bw->CreateBody(&bodyDef);
// Define another box shape for our dynamic body.
circle.m_radius = 7.0f;
// Define the dynamic body fixture.
fixtureDef.shape = &circle;
// Set the box density to be non-zero, so it will be dynamic.
fixtureDef.density = gPuckDensity;
// Override the default friction.
fixtureDef.friction = gPuckFriction;
fixtureDef.restitution = 0.8;
When I apply force to it - exactly the same force as the box, which worked fine - it starts off going in the right direction and then moves very quickly off the bottom left of the screen! Have I left something out?? The circles also DO NOT collide with my other shapes, just roll over them.