23-05-2023, 10:07 AM
(This post was last modified: 23-05-2023, 10:08 AM by josemendez.)
(22-05-2023, 04:24 PM)Guillaume Wrote: Hi all,
Sorry if the question is not so precise or has already been answered earlier but here we go.
I'm trying to reproduce some of the rope mechanics as seen in The Last Of Us Part 2 because it's so fun (as reference: https://www.youtube.com/watch?v=VTRzaE3T5to).
I've got a lot of rocks, not so much buildings. Everything is mesh collider.
Hi!
Mesh colliders are "hollow", only their surface generates collisions. As soon as an object is entirely inside a MeshCollider, it can't be projected back outside because there's no way to tell if a point is inside or outside a MeshCollider (there might even be no inside/outside at all!). You can easily test this using regular objects in Unity.
Distance fields are designed for this use case. It's not only possible to tell if a point is inside or outside of them, but they're also considerably faster than MeshColliders.
(22-05-2023, 04:24 PM)Guillaume Wrote: 2) is it something that Obi solver can let us now by telling us "I couldn't solve this and a particle possibly went inside a collision"
If the solver is able to detect a collision, it can solve it. Collisions are solved last in the constraint hierarchy so they're always respected. The problem is that once a rope particle tunnels trough a triangle in a MeshCollider (due to a missed collision, or user input forcing the rope trough the collider's surface), there's no way to recover from it because it's impossible to tell if a point is inside an arbitrary triangle soup.
Also, keep in mind that The Last of Us' rope does not appear to be purely particle/body based. Judging from the videos (couldn't find any technical info about their approach anywhere) they're using a hybrid lagrangian/eulerian approach, switching between them based on rope tension: when the rope is under enough tension (for instance when a character is hanging from a rope) they seem to switch to an eulerian representation using the contact points in the rope as nodes trough which the rope slides.
(22-05-2023, 04:24 PM)Guillaume Wrote: And thanks for the plugin, it's fun to play around with it, but hard to master so far!
You're welcome! Regular rigidbodies are already challenging, but deformable body physics -such as ropes- are probably the second hardest thing to get right in simulation, only surpassed by fluids. Keep at it!