I have a ball that fall on another and fall on a static ground. The problem is that they won't ever stop rolling, even with high friction settings for both the ball and the ground (1.0f).
It moves about less than a pixel per second but it still moves! Is there any way to stop it completely or I have to manually do it when its speed is very small? Thanks for reading.
Code:
Baseball::Baseball(b2World* world)
{
sf::Image *temp = gImageManager.getResource("baseball.png");
m_sprite.SetImage(*temp,true);
m_bodyDef.type = b2_dynamicBody;
m_body = world->CreateBody(&m_bodyDef);
m_shape = new b2CircleShape();
m_shape->m_radius = m_sprite.GetSize().x/2 * METERS_PER_PIXEL;
m_fixtureDef.shape = m_shape;
m_fixtureDef.density = 1000.0f;
m_fixtureDef.restitution = 0.546f;
m_fixtureDef.friction = 20.0f;
m_body->CreateFixture(&m_fixtureDef);
}
{
sf::Image *temp = gImageManager.getResource("baseball.png");
m_sprite.SetImage(*temp,true);
m_bodyDef.type = b2_dynamicBody;
m_body = world->CreateBody(&m_bodyDef);
m_shape = new b2CircleShape();
m_shape->m_radius = m_sprite.GetSize().x/2 * METERS_PER_PIXEL;
m_fixtureDef.shape = m_shape;
m_fixtureDef.density = 1000.0f;
m_fixtureDef.restitution = 0.546f;
m_fixtureDef.friction = 20.0f;
m_body->CreateFixture(&m_fixtureDef);
}
It moves about less than a pixel per second but it still moves! Is there any way to stop it completely or I have to manually do it when its speed is very small? Thanks for reading.