How to achieve a straight cut in the cloth

Vineeth@nxOgre

13-05-2008 10:42:01

Hi betajaen,

NxU32* flags = (NxU32*)desc.vertexFlags;
NxU32 y;
NxU32 w = numX + 1;
NxU32 h = numY + 1;
for(y = 0; y < h; y++)
{
NxU32 x;
for(x = 0; x < w; x++)
{
if(((x + y) % 16 == 0) || ((x - y + 16) % 16 == 0))
flags[y * w + x] =NX_CLOTH_VERTEX_TEARABLE
else
flags[y * w + x] = 0;
}
}

desc.vertexFlags=flags;
desc.flags |= NX_CLOTH_VERTEX_TEARABLE;



Can I change this to have a preset vertex tear as mentioned in the Ageia PhysX documentation