O'Reilly logo

Learning Physics Modeling with PhysX by Krishna Kumar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a cloth

Once we are done with the creation of the cloth fabric, we will finally create a cloth by calling the PxPhysics::createCloth() function that requires four parameters. The first parameter is a type of PxTransform, and it represents the global position of the cloth. The second parameter is a type of PxClothFabric, and here we will put the reference of the cloth fabric we created before. The third parameter takes the first element of the PxClothParticle array, which is also used in the mesh description class. The last parameter is a type of PxClothFlags, and it is used to set the flag to turn the cloth related features on/off such as GPU acceleration and continuous collision detection (CCD).

A typical example for creating a cloth ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required