Search Unity

Question How do you generate contacts in DOTS Physics?

Discussion in 'Physics for ECS' started by Mikael-H, May 3, 2020.

  1. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
  2. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Hey, adding contacts is not currently supported, sorry about that, documentation is a bit out of date. We are trying to think of the best way to implement this, but unfortunately it has a lot of implications to the rest of the physics pipeline and we need to be really careful.
     
  3. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
  4. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    I can imagine it does :)
    It opens up for quite amazing stuff though so I'm really rooting for you! (not that it necessarily helps you much but still... :) )

    I realize now I was looking at some old documentation yes...

    So I guess at this time it would be quite hard to implement a wheel collider then, right? My idea was that I would create a wheel collider that generates contacts so that the solver can handle them rather than using raycasts as in the samples. Otherwise I guess there will always be pretty strange behaviour when the static friction should make objects come to rest, right? Or am I missing some way to approach this?
     
    Last edited: May 5, 2020
  5. petarmHavok

    petarmHavok

    Joined:
    Nov 20, 2018
    Posts:
    461
    Thanks for rooting, it certainly helps! :)

    Regarding the wheel collider, I guess there is no easy way to do it with current options.

    Assuming you want to do a query (ray cast or collider cast) and then let some solver take care of it, maybe (just maybe) you can take a look at the SimplexSolver. Character controller does something similar - query the world, collect hits and convert them to constraints (the way it likes it), and calls SimplexSolver.Solve() to get a new velocity. Not sure if that's enough, could be. It definitely doesn't need to use impulse applying. Let me know if it feels right!

    In the meantime, I will (once again) think about adding the contacts to the pipeline.
     
    Mikael-H likes this.
  6. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Ok sounds like a good idea. Maybe I will just wait until out of preview instead, this is not a critical task at all. Just playing around a bit with physics + netcode to get a hang of how things will work in the future.

    I really like where all of this is going, keep up the good work!
     
    petarmHavok likes this.
  7. Mikael-H

    Mikael-H

    Joined:
    Apr 26, 2013
    Posts:
    309
    Also, thanks for taking the time to answer!
     
    petarmHavok likes this.