I have asked similar question(https://devtalk.nvidia.com/default/topic/1036655/physx-and-physics-modeling/why-does-simple-cloth-to-a-single-triangle-fails-to-response-to-collision-and-gravity-nvcloth-/) previously. This question is little different in the sense that
I have learned few during the process to find the answer to my previous question and I want to
explain the reason behind using setTriangle instead of setSphere. I would also like to know
if using setTriangle is appropriate in my case.
You can see from my previous question that I use one triangle to represent cloth and two triangle to represent body and they are separated by 4 units.
I tried collision using setSpheres method from NvCloth and it works perfectly.
Then I thought let me try with a costume body since I want to collide with some random
objects. Like humans, table, desk etc. For that I thought setTriangles is appropriate.
When I used setTriangle, collision does not work at all. Not only collision the gravity also
does not work. Also the mClothData.mNumSphere is zero (Since I only do setTriangle). To find the
root of the problem I used gdb and went inside the function collideTriangles. There this
piece if code
T4f dz = curPos - splat<2>(base);
takes the difference between the cloth and the body and uses that to compute deltaDotNormal
T4f deltaDotNormal = dx * nx + dy * ny + dz * nz;
Which is ultimately added to mCurParticles. Since single step runs 5 iteration the
Z component of the cloth get 5dz. Thus cloth ends up being at 5dz.
Is there any additional step I am missing?