Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Deformation on impact

Discussion in 'Physics' started by X0FloH, May 30, 2019.

  1. X0FloH

    X0FloH

    Joined:
    May 25, 2016
    Posts:
    7
    Hi, I have searched for a while and there is barely anything on creating a deformed mesh based on a collision, for example, driving into a sign bends the sign quite a bit, any help would be appreciated, thanks in advance!
     
  2. Antypodish

    Antypodish

    Joined:
    Apr 29, 2014
    Posts:
    10,754
    Softbody like clothes, car tires etc. may give you some ideas.
     
  3. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Say for a pole specifically you can fake it by having an animation of the pole bending to 90, then what you do is when the car hits the pole you rotate the pole to match the angle of the collision, bend it to your liking.
    you can keep the sign on the pole as a separate object so that it won't rotate with it(could also have it fly off depending on the collision impulse), if it's like a brushed aluminium texture the shift should be unnoticeable.

    if you're talking about a dynamic system, say a dent in the hood from a rock hitting it what you'll need to do is map the vertices relative to the impact, figure out what verts are closest and what direction to move them to according to the angle of the impact.
    that stuff gets really complex so if you're into it - spend some time researching it, but if you don't need to go all out on this system I suggest using some smoke & mirrors (IE faking it).
     
    Antypodish likes this.
  4. BoogieD

    BoogieD

    Joined:
    Jun 8, 2016
    Posts:
    236
    UnderscoreA likes this.
  5. Electro3_Strike

    Electro3_Strike

    Joined:
    Nov 3, 2020
    Posts:
    5
  6. AlTheSlacker

    AlTheSlacker

    Joined:
    Jun 12, 2017
    Posts:
    326
    Well, if you follow the steps of the article and don't use springs to pull the nodes back it would be deformation... so a pretty good starting point.

    I would take heed of @SparrowsNest 's post: consider that if you want anything like a general purpose solution you are either going to have to carry the burden of over refined meshes on everything you potentially want to deform, or you are going to have to dynamically re-mesh impacted meshes (extremely involved, with potentially large CPU costs).