17-06-2020, 02:31 PM
(17-06-2020, 02:00 PM)josemendez Wrote: Hi there,
ObiCollider will grab the first collider up its hierarchy by default, but you can manually set it too.
MeshColliders are paper-thin, by definition: they're just a collection of triangles, and have no concept of "volume" inside the object. This means that if a particle goes inside it (due to tunneling, too large a timestep, pushed by another collider, or any other reason) it won't be projected back outside.
Primitive colliders are solid however, and can project other objects inside them. That's why they're usually much more robust (and cheaper).
In Obi we have a custom collision structure, widely used in many other engines because it combines the strengths of primitive colliders and mesh colliders: distance fields. They're a grid-like data structure that precomputes the distance to the surface of an object from within any point inside its bounding box. This way, checking for collision is extremely efficient (simply read a value back from an array) and robust, since objects inside of it can be projected outside just by checking the sign of the distance (negative = inside, positive = outside).
I really recommend using them for this use case. You can read more about them here: http://obi.virtualmethodstudio.com/tutor...ields.html
ok thanks ! hope it solves my problem