#include <ClothTetherCooker.h>
Public Member Functions | |
virtual bool | cook (const ClothMeshDesc &desc)=0 |
Compute tether data from ClothMeshDesc with simple distance measure. | |
virtual uint32_t | getCookerStatus () const =0 |
Returns cooker status. | |
virtual physx::PxU32 | getNbTethersPerParticle () const =0 |
Returns number of tether anchors per particle. | |
virtual void | getTetherData (physx::PxU32 *userTetherAnchors, physx::PxReal *userTetherLengths) const =0 |
Returns computed tether data. | |
virtual | ~ClothTetherCooker () |
virtual nv::cloth::ClothTetherCooker::~ClothTetherCooker | ( | ) | [inline, virtual] |
virtual bool nv::cloth::ClothTetherCooker::cook | ( | const ClothMeshDesc & | desc | ) | [pure virtual] |
Compute tether data from ClothMeshDesc with simple distance measure.
The tether constraint in NvCloth requires rest distance and anchor index to be precomputed during cooking time. This cooker computes a simple Euclidean distance to closest anchor point. The Euclidean distance measure works reasonably for flat cloth and flags and computation time is very fast. With this cooker, there is only one tether anchor point per particle.
desc | The cloth mesh descriptor prepared for cooking |
virtual uint32_t nv::cloth::ClothTetherCooker::getCookerStatus | ( | ) | const [pure virtual] |
Returns cooker status.
This function returns cooker status after cooker computation is done. A non-zero return value indicates a failure.
virtual physx::PxU32 nv::cloth::ClothTetherCooker::getNbTethersPerParticle | ( | ) | const [pure virtual] |
Returns number of tether anchors per particle.
If there is no attached point in the input mesh descriptor, this will return 0 and no tether data will be generated.
virtual void nv::cloth::ClothTetherCooker::getTetherData | ( | physx::PxU32 * | userTetherAnchors, | |
physx::PxReal * | userTetherLengths | |||
) | const [pure virtual] |
Returns computed tether data.
This function returns anchor indices for each particle as well as desired distance between the tether anchor and the particle. The user buffers should be at least as large as number of particles.