Obi Official Forum
Help collision with mesh collider - Printable Version

+- Obi Official Forum (https://obi.virtualmethodstudio.com/forum)
+-- Forum: Obi Users Category (https://obi.virtualmethodstudio.com/forum/forum-1.html)
+--- Forum: Obi Cloth (https://obi.virtualmethodstudio.com/forum/forum-2.html)
+--- Thread: Help collision with mesh collider (/thread-1047.html)



collision with mesh collider - Richard - 05-04-2019

Obi cloth cannot collide with obi collider from mesh collider. Why is this happened? I tried obi collider from sphere collider, but it has no problem.


RE: collision with mesh collider - josemendez - 05-04-2019

(05-04-2019, 05:18 AM)Richard Wrote: Obi cloth cannot collide with obi collider from mesh collider. Why is this happened? I tried obi collider from sphere collider, but it has no problem.

Hi,

Collisions with mesh colliders should work. However keep in mind that mesh colliders are not "solid", they're paper-thin surfaces. So if a particle ends up inside a mesh collider due to tunneling it will not be projected back out. Depending on your use case, distance fields might be a better option. See:

http://obi.virtualmethodstudio.com/tutorials/distancefields.html


RE: collision with mesh collider - Richard - 05-04-2019

(05-04-2019, 06:16 AM)josemendez Wrote: Hi,

Collisions with mesh colliders should work. However keep in mind that mesh colliders are not "solid", they're paper-thin surfaces. So if a particle ends up inside a mesh collider due to tunneling it will not be projected back out. Depending on your use case, distance fields might be a better option. See:

http://obi.virtualmethodstudio.com/tutorials/distancefields.html

I solved the problem, thank you. However, when I increase scale object inside shirt shaped obi cloth object, it passes its collider. Why?


RE: collision with mesh collider - Richard - 05-04-2019

(05-04-2019, 07:03 AM)Richard Wrote: I solved the problem, thank you. However, when I increase scale object inside shirt shaped obi cloth object, it passes its collider. Why?



RE: collision with mesh collider - josemendez - 05-04-2019

Hi,

As I mentioned, MeshColliders are not solid. If you suddenly change the scale of the collider, chances are particles that were outside of it before the scale change will now be inside. This is a form of tunneling. You can get a better idea of what's happening by adding a ObiParticleRenderer to your cloth to see individual particles.


RE: collision with mesh collider - Richard - 05-04-2019

(05-04-2019, 08:53 AM)josemendez Wrote: Hi,

As I mentioned, MeshColliders are not solid. If you suddenly change the scale of the collider, chances are particles that were outside of it before the scale change will now be inside. This is a form of tunneling. You can get a better idea of what's happening by adding a ObiParticleRenderer to your cloth to see individual particles.

How can I avoid "suddenly change" , and tunneling?


RE: collision with mesh collider - josemendez - 05-04-2019

(05-04-2019, 09:22 AM)Richard Wrote: How can I avoid "suddenly change" , and tunneling?

Tunneling cannot be avoided, in the general case of scaling objects. As for avoiding to suddenly change scale, simply don't suddenly change the scale Guiño. Do it progressively.


RE: collision with mesh collider - Richard - 05-04-2019

(05-04-2019, 09:44 AM)josemendez Wrote: Tunneling cannot be avoided, in the general case of scaling objects. As for avoiding to suddenly change scale, simply don't suddenly change the scale Guiño. Do it progressively.
I change scale like:
     update(){
            localScale.x += 0.01
                  }

Is it not progressively?