#include <PxClothTetherCooker.h>
Public Member Functions | |
PxClothGeodesicTetherCooker (const PxClothMeshDesc &desc) | |
Compute tether data from PxClothMeshDesc using geodesic distance. | |
~PxClothGeodesicTetherCooker () | |
PxU32 | getCookerStatus () const |
Returns cooker status. | |
PxU32 | getNbTethersPerParticle () const |
Returns number of tether anchors per particle. | |
void | getTetherData (PxU32 *userTetherAnchors, PxReal *userTetherLengths) const |
Returns computed tether data. | |
Private Attributes | |
PxClothGeodesicTetherCookerImpl * | mImpl |
PxClothGeodesicTetherCooker::PxClothGeodesicTetherCooker | ( | const PxClothMeshDesc & | desc | ) |
Compute tether data from PxClothMeshDesc using geodesic distance.
The tether constraint in PxCloth requires rest distance and anchor index to be precomputed during cooking time. The provided tether cooker computes optimal tether distance with geodesic distance computation. For curved and complex meshes, geodesic distance provides the best behavior for tether constraints. But the cooking time is slower than the simple cooker.
desc | The cloth mesh descriptor prepared for cooking |
The geodesic cooker does not work with non-manifold input such as edges having more than two incident triangles, or adjacent triangles following inconsitent winding order (e.g. clockwise vs counter-clockwise).
PxClothGeodesicTetherCooker::~PxClothGeodesicTetherCooker | ( | ) |
PxU32 PxClothGeodesicTetherCooker::getCookerStatus | ( | ) | const |
Returns cooker status.
This function returns cooker status after cooker computation is done. A non-zero return value indicates a failure, 1 for non-manifold and 2 for inconsistent winding.
PxU32 PxClothGeodesicTetherCooker::getNbTethersPerParticle | ( | ) | const |
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.
void PxClothGeodesicTetherCooker::getTetherData | ( | PxU32 * | userTetherAnchors, | |
PxReal * | userTetherLengths | |||
) | const |
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 * number of tethers per particle.
PxClothGeodesicTetherCookerImpl* PxClothGeodesicTetherCooker::mImpl [private] |