Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by matyicsapo · Oct 08, 2010 at 05:38 PM · physicsdocumentationorderphysicmaterialpriority

Physic Material Friction Combine Mode lack of documentation?

Tested stuff:

There were 2 objects with different Physic Materials: A, B

A moved on B acting as ground

In each case only!! the Friction Combine Mode was changed

FCM - Friction Combine Mode

DST - distance travelled over time T

The combine modes in order(the numbers between the parentheseses below correspond to these):

  1. Average
  2. Multiply
  3. Minimum
  4. Maximum


  • A.FCM = Multiply(2); B.FCM = Multiply(2) | DST = DST1
  • A.FCM = Average(1); B.FCM = Multiply(2) | DST = DST1
  • A.FCM = Multiply(2); B.FCM = Average(1) | DST = DST1
  • A.FCM = Average(1); B.FCM = Average(1) | DST = DST2

    // DST changed => Multiply(2) overwrote Average(1) in case 2. and 3.

    A.FCM = Minimum(3); B.FCM = Multiply(2) | DST = DST3

    // DST changed => Minimum(3) overwrote Multiply(2)

  • A.FCM = Multiply(2); B.FCM = Minimum(3) | DST = DST3
  • A.FCM = Minimum(3); B.FCM = Minimum(3) | DST = DST3

  • I sincerely think I'm right that the cause is the combine modes' order where later ones have higher priority and thus overwrite the ones with lower priority and the friction value used as the friction value for the friction between the 2 colliding objects is determined by this single combine mode.

    My problem is that I haven't heard anyone mention this and the bigger problem is that even now after a quick(too quick) googling I didn't find any mention of this.

    To make it so that noone may say that this should've gone to the forum instead let me make a few simple questions out of all this.

    Am I right? Why haven't I found any mention of this phenomenon? Should one know this off the cuff?

    Comment
    Add comment · Show 3
    10 |3000 characters needed characters left characters exceeded
    ▼
    • Viewable by all users
    • Viewable by moderators
    • Viewable by moderators and the original poster
    • Advanced visibility
    Viewable by all users
    avatar image skovacs1 · Oct 08, 2010 at 05:58 PM 0
    Share

    This isn't anything that would be sent to the forum because it's asking about a specific Unity implementation rather than a subjective opinions about something. Wouldn't it just be simpler to ask "How does the Physic $$anonymous$$aterial Friction Combine $$anonymous$$ode work?" and then simply elaborated on your experiment and question?

    avatar image matyicsapo · Oct 08, 2010 at 06:05 PM 0
    Share

    well yeah you're right - thanks, really; hopefully next time I won't forget this part

    avatar image Keshav · Aug 07, 2013 at 05:15 AM 0
    Share

    Good question matyicsapo. I was also interested in finding the priority of friction combine. Found the same relationship presented here and now i see this post.

    2 Replies

    · Add your reply
    • Sort: 
    avatar image
    2
    Best Answer

    Answer by skovacs1 · Oct 08, 2010 at 06:28 PM

    This is undocumented functionality.

    From my tests, the friction combine mode used uses the largest PhysicMaterialCombine in the PhysicMaterialCombine enumeration of the two materials.

    The enumeration is something like:

    enum PhysicMaterialCombine {
        Average = 0,
        Multiply = 1,
        Minumum = 2,
        Maximum = 3
    };
    

    and the combination function for let's say dynamic friction would be something like:

    var dynamicFriction : float = object1.collider.material.dynamicFriction;
    switch((PhysicMaterialCombine)
            Mathf.Max(object1.collider.material.frictionCombine,
                     object2.collider.material.frictionCombine)) {
        case PhysicMaterialCombine.Average:
            dynamicFriction += object2.collider.material.dynamicFriction;
            dynamicFriction /= 2.0;
            break;
        case PhysicMaterialCombine.Multiply:
            dynamicFriction *= object2.collider.material.dynamicFriction;
            break;
        case PhysicMaterialCombine.Minumum:
            dynamicFriction = Mathf.Min(dynamicFriction,
                                        object2.collider.material.dynamicFriction);
            break;
        case PhysicMaterialCombine.Maximum:
            dynamicFriction = Mathf.Max(dynamicFriction,
                                        object2.collider.material.dynamicFriction);
            break;
    }
    

    I believe it is also the same for the bounceCombine.

    Comment
    Add comment · Show 1 · Share
    10 |3000 characters needed characters left characters exceeded
    ▼
    • Viewable by all users
    • Viewable by moderators
    • Viewable by moderators and the original poster
    • Advanced visibility
    Viewable by all users
    avatar image matyicsapo · Oct 08, 2010 at 06:36 PM 0
    Share

    now that's very clear :D, thanks

    avatar image
    1

    Answer by BenTristem · Aug 04, 2015 at 03:14 PM

    Hey, we've just done some testing for our Game Physics Course, and we think the order of precedence is Max, Mult, Min, Average in decreasing order. Hopefully this table below will help..

    Table of friction combination in Unity


    gp-s04-03-section-notes001.png (421.4 kB)
    Comment
    Add comment · Share
    10 |3000 characters needed characters left characters exceeded
    ▼
    • Viewable by all users
    • Viewable by moderators
    • Viewable by moderators and the original poster
    • Advanced visibility
    Viewable by all users

    Your answer

    Hint: You can notify a user about this post by typing @username

    Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

    Follow this Question

    Answers Answers and Comments

    2 People are following this question.

    avatar image avatar image

    Related Questions

    Physic Material Component reference 1 Answer

    How does priority/ simultaneity work in Unity? 2 Answers

    What is the appropriate value of Friction Direction 2? 1 Answer

    ForceMode.Acceleration estimated dst != covered dst with a single Addforce in effect 1 Answer

    Question on Physic Materials, Rigibodies, and Acelleration 0 Answers


    Enterprise
    Social Q&A

    Social
    Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

    Footer

    • Purchase
      • Products
      • Subscription
      • Asset Store
      • Unity Gear
      • Resellers
    • Education
      • Students
      • Educators
      • Certification
      • Learn
      • Center of Excellence
    • Download
      • Unity
      • Beta Program
    • Unity Labs
      • Labs
      • Publications
    • Resources
      • Learn platform
      • Community
      • Documentation
      • Unity QA
      • FAQ
      • Services Status
      • Connect
    • About Unity
      • About Us
      • Blog
      • Events
      • Careers
      • Contact
      • Press
      • Partners
      • Affiliates
      • Security
    Copyright © 2020 Unity Technologies
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell My Personal Information
    • Cookies Settings
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Explore
    • Topics
    • Questions
    • Users
    • Badges