Im trying to add friction to my physics engine.
-The collision point and normal
-Properties of both bodies:
*Center of mass
*angular and linear velocity
*angular and linear forces
So, how would i go about implementing friction?
Currently i am able to apply a force to a point on a body (which translates to linear force and torque)
I am able to do friction for surface on surface (its a top down 2d game) where i assume the other surface to have infinite mass. However this directly modifies the velocity and im not sure how to translate that to friction from collisions.
The internet didnt seem very helpful on this one, anyone care to explain how to make it all work? Preferably in a way that works smoothly and wont estimate the forces wrong and cause everything to explode.
I tried to use my getDeltaVelocityCuzOfFriction(VelocityDifference, frictionCoeff, normalForce) method but since i dont have a method of setting force directly at a point on the body, and i dont know how to get the normal force, i couldnt get it to work. There might be other problems with my collision response that cause it to not work but i cant be sure until i know the friction itself should work.