Obi Official Forum
Help Getting forces on Obi colliders - 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 Getting forces on Obi colliders (/thread-2409.html)



Getting forces on Obi colliders - Oybsan - 07-08-2020

Hi,

I'd like to read forces applied by a cloth, on a collider. Is there any fonction allowing me to do that ?

Thanks,

Oybsan.


RE: Getting forces on Obi colliders - josemendez - 07-08-2020

(07-08-2020, 11:57 AM)Oybsan Wrote: Hi,

I'd like to read forces applied by a cloth, on a collider. Is there any fonction allowing me to do that ?

Thanks,

Oybsan.

Yes, you want to use collision callbacks. See:
http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html

The idea is that you iterate over all contacts between each individual cloth particle and the collider. The contact struct contains normal, tangent and bitangent impulse magnitudes applied by the contact, as explained in the above link. You just have to convert from impulses to forces (dividing by the timestep).


RE: Getting forces on Obi colliders - Oybsan - 07-08-2020

(07-08-2020, 12:27 PM)josemendez Wrote: Yes, you want to use collision callbacks. See:
http://obi.virtualmethodstudio.com/tutorials/scriptingcollisions.html

The idea is that you iterate over all contacts between each individual cloth particle and the collider. The contact struct contains normal, tangent and bitangent impulse magnitudes applied by the contact, as explained in the above link. You just have to convert from impulses to forces (dividing by the timestep).

Thanks for your answer, it will help me a lot !