Today I implemented the code for friction. It was a little more complicated than what I had in mind but in the end I understood all the code. However I then spent hours to try and make it work, and I still didn't manage.
Basically, as you can see from the gif, friction works fine if I don't enable rotations. However if I do, the objects stars to slide on the ground instead of stopping. I actually think I have found the problem: basically the friction considers also the linear velocity generated by the torque at the contact point, and it adds it to the linear velocity to compensate. This basically adds too much velocity, and the objects starts to move in the opposite direction instead of staying still.
Tomorrow I'll try and fix it my way, even though I'm not sure that the code I'm following is wrong, and it is possible that I made some mistake...

Nessun commento:
Posta un commento