I want to make a Billiards Games, but Box2D does not work well.
If ball move fast It can not hit other ball.
How can I solve this problem.
Thanks a lot!
b2BodyDef bodyDef;
b2CircleShape bodyShape;
b2FixtureDef fixtureDef;
bodyDef.type = b2_dynamicBody;
bodyDef.bullet = true;
bodyDef.position.Set(x / BOX_SCALE, y / BOX_SCALE);
bodyDef.linearDamping = 1.0f;
bodyDef.userData = m_userData;
bodyShape.m_radius = 11.0 / BOX_SCALE;
fixtureDef.shape = &bodyShape;
fixtureDef.density = 10.0f;
fixtureDef.friction = 0.0f;
fixtureDef.restitution = 1.0f;
m_body = g_world->CreateBody(&bodyDef);
m_body->CreateFixture(&fixtureDef);
If ball move fast It can not hit other ball.
How can I solve this problem.
Thanks a lot!
b2BodyDef bodyDef;
b2CircleShape bodyShape;
b2FixtureDef fixtureDef;
bodyDef.type = b2_dynamicBody;
bodyDef.bullet = true;
bodyDef.position.Set(x / BOX_SCALE, y / BOX_SCALE);
bodyDef.linearDamping = 1.0f;
bodyDef.userData = m_userData;
bodyShape.m_radius = 11.0 / BOX_SCALE;
fixtureDef.shape = &bodyShape;
fixtureDef.density = 10.0f;
fixtureDef.friction = 0.0f;
fixtureDef.restitution = 1.0f;
m_body = g_world->CreateBody(&bodyDef);
m_body->CreateFixture(&fixtureDef);