Static/Dynamic friction in Physics2D Material?

Hi. I’m trying to accurately simulate high-school level physics in a 2D environment for an educational physics game.

The thing is, unlike the case in 3D, 2D physics materials don’t have separate parameters for static and dynamic friction. Am I missing something, and it’s going to work fine? Or do I need to code it myself?

Also, how is the coefficient of friction calculated, using the friction parameter for both interacting materials? I want to let the players change it according to their own calculations.

Thank you!

1 Answer

1

Unity uses Box2D so you can always look-up this kind information if you search for information on Box2D.

You can look-up friction on the Box2D manual:
http://www.box2d.org/manual.html

Here’s the relevant friction ‘mixing’ code:
https://code.google.com/p/box2d/source/browse/trunk/Box2D/Box2D/Dynamics/Contacts/b2Contact.h

Yup, it all there! Thanks! A quick answer for the future generations: Static and dynamic friction are simulated, but handled by the same parameter. The friction coefficient is the square root of the product of the two materials' friction parameters. Multipy that by the normal force and you get the friction force.

The original link is dead. That is because Box2D moved to Github. You can find the source [here] (https://github.com/behdad/box2d/blob/master/Box2D/Box2D/Dynamics/Contacts/b2Contact.h) now :)