Hey guys.
I was reading the tutorials on Emanuele Feronato's site (GREAT STUFF BTW, CHECK THIS OUT!: http://www.emanueleferonato.com/2009/04/06/two-ways-to-make-box2d-cars/), and I saw the tutorial on how to make a car (the second example, with suspension).
My problem is that I'm changing the torque of the wheels and they dance all over the place when I run to fast.
So, I guess my problem is in the next few lines (because if I comment them, they dance even more).
What's the problem?
Can anyone explain how they work?
Thanks!
I was reading the tutorials on Emanuele Feronato's site (GREAT STUFF BTW, CHECK THIS OUT!: http://www.emanueleferonato.com/2009/04/06/two-ways-to-make-box2d-cars/), and I saw the tutorial on how to make a car (the second example, with suspension).
My problem is that I'm changing the torque of the wheels and they dance all over the place when I run to fast.
So, I guess my problem is in the next few lines (because if I comment them, they dance even more).
What's the problem?
Code:
spring1.SetMaxMotorForce(30+Math.abs(800*Math.pow(spring1.GetJointTranslation(), 2)));
spring1.SetMotorSpeed((spring1.GetMotorSpeed() - 10 * spring1.GetJointTranslation()) * (5)/Constantes.RATIO);
spring2.SetMaxMotorForce(30+Math.abs(800*Math.pow(spring2.GetJointTranslation(), 2)));
spring2.SetMotorSpeed( -4 * Math.pow(spring2.GetJointTranslation(), 1));
spring1.SetMotorSpeed((spring1.GetMotorSpeed() - 10 * spring1.GetJointTranslation()) * (5)/Constantes.RATIO);
spring2.SetMaxMotorForce(30+Math.abs(800*Math.pow(spring2.GetJointTranslation(), 2)));
spring2.SetMotorSpeed( -4 * Math.pow(spring2.GetJointTranslation(), 1));
Can anyone explain how they work?
Thanks!