Search Unity

What are the value ranges for coefficient of friction for Physics Materials?

Discussion in 'Physics' started by majeric, Oct 16, 2015.

  1. majeric

    majeric

    Joined:
    Aug 17, 2010
    Posts:
    89
    The 3D ones suggest that the are between 0 and 1. The 2D Physics Materials don't list them.

    Seriously Unity needs to up their documentation game. Their examples and documentation are seriously spartan.
     
  2. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,496
    You mean the documentation doesn't say 'A value of zero indicates a surface with no friction while a value of 1 indicates maximum friction (eg, rubber).'. :)

    These are the recommended ranges you refer to. Of course, as you could easily see in the editor, it does allow you to go above 1 as some users want to do that. In this case, like every 2D physics value that is not allowed to go to infinite, it is clamped at 100000.
     
  3. majeric

    majeric

    Joined:
    Aug 17, 2010
    Posts:
    89
    Fair enough. The Manual to the Scripting API is just inconsistent. The 3D materials list the range but the 2D materials do not. And a values between 0 and 1 are generally absolute scales so what does it *mean* to go above 1? Does the co-efficient reflect the kind of table found in this chart? Would including this chart in the documentation be useful?

    I am under the impression that a coefficient is a relationship of two materials rather than the value of a single material. If I create a coefficient value to reflect "glass" and one to reflect "rubber", how do I ensure that they interact correctly with each other?

    I mean to provide "PhysicsMaterial.friction" is the "A value of zero indicates a surface with no friction while a value of 1 indicates maximum friction (eg, rubber)." is kind of the minimum definition without providing enough information on how to use it correctly or effectively. One ends up having to experiment. Heck, having the underlying code's formulas for how the functionality is derived would at least provide some context.

    Also, why is the Networking API in the Manual section and not in the Scripting API section?

    I don't think my criticism is without merit.
     
  4. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,496
    S_Darkwell likes this.
  5. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    S_Darkwell likes this.
  6. S_Darkwell

    S_Darkwell

    Joined:
    Oct 20, 2013
    Posts:
    320
    @MelvMay: I second @Edy's sentiment! It would be fantastic to see the 3D friction coefficient function as well!
     
  7. MelvMay

    MelvMay

    Unity Technologies

    Joined:
    May 24, 2013
    Posts:
    11,496
    I'm not on the 3D physics team but I did a quick Google search and found it here: nVidia PhysX docs

    I think the material doc explains it well though.
     
    Last edited: Oct 19, 2015
  8. MortenSkaaning

    MortenSkaaning

    Joined:
    Jan 16, 2015
    Posts:
    120
    PhysX doesn't expose a callback for combining friction values.
    What scenarios do you have where the PhysicMaterialCombine is not enough?
     
  9. Edy

    Edy

    Joined:
    Jun 3, 2010
    Posts:
    2,510
    I don't have a specific scenario. Just saw that the friction combine method in Box2D is sqrt(a*b). We don't have that in PhysX (we have a*b).

    As Erin Catto has chosen sqrt(a*b) instead of a*b as global friction combine function in Box2D, then I'm pretty sure that he has very good reasons for it. I would love to find out why. Maybe this approach is closer to what happens in reality?

    Comparing the plots of the functions, sqrt(a*b) seems to provide more friction overall:

    upload_2015-10-20_18-19-10.png upload_2015-10-20_18-20-11.png

    It's simply a curiosity, I'm not really dying for a new 3D friction combine method. But maybe PhysX might want to consider adopting it in a future version.
     
    Last edited: Oct 20, 2015
  10. MortenSkaaning

    MortenSkaaning

    Joined:
    Jan 16, 2015
    Posts:
    120
    it looks cool, but I prefer not to make changes to PhysX unless we have some hard pressed usecases.