I have a car, set up in Box2D as a rectangle connected with two wheels using
The wheels are defined as follows:
FixtureDef wheelFixtureDef = new FixtureDef(); wheelFixtureDef.density = 1.f; wheelFixtureDef.shape = wheelShape; wheelFixtureDef.friction = 0.98f; wheelFixtureDef.restitution = 0.3f; // wheel joint (only one of the wheels has the motor enabled) wheelJointDef.dampingRatio = 0.9f; wheelJointDef.frequencyHz = 20.0f; wheelJointDef.motorSpeed = 15.4f; wheelJointDef.maxMotorTorque = 100.f;
And the ground:
FixtureDef groundFixtureDef = new FixtureDef(); groundFixtureDef.density = 0.f; groundFixtureDef.friction = 1.0f;
Still, when trying to climb that hill in the picture, the wheels reach a stage where they just keep slipping, and it slides back down.
Why does it slip even though the friction coefficients are set high? How can I make it overcome that hill?